Skip to main content
Mostafa85
New Member
December 29, 2024
Question

FortiOS 7.6.1 Content-Security-Policy Issue with WSS

  • December 29, 2024
  • 6 replies
  • 2635 views

Hi everyone,

I'm encountering an issue with configuring Content-Security-Policy (CSP) in FortiOS 7.6.1. I'm trying to implement the following CSP rule:

default-src 'self' https://*.mydomain.net; font-src 'self' https://fonts.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net; img-src 'self' data: https:; object-src 'none'; frame-ancestors 'none';

 

This configuration, however, blocks WebSocket (WSS) connections. To allow these, I attempted to add wss://*.mydomain.net to the default-src directive. However, the FortiOS validator throws the following error:In directive default-src, wss://*.mydomain.net is an invalid source.

I've tried various formats for including the wss:// scheme, but all resulted in the same validation error.

As a workaround, I've bypassed the validation and used this configuration:

default-src 'self' https://*.mydomain.net wss://*.mydomain.net;

 

This configuration does seem to work, allowing WSS connections.

My question is: Is this a bug in the FortiOS validation, or is it not possible to directly specify wss:// sources within the default-src directive using the validator?

Any insights or suggestions would be greatly appreciated.

Thanks!

6 replies

Anthony_E
Staff
Staff
January 2, 2025

Hello Mostafa,


Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.


Thanks,

Best Regards
Jean-Philippe_P
Staff & Editor
Staff & Editor
January 6, 2025

Hello,

 

We are still looking for an answer to your question.

 

We will come back to you ASAP.

 

Thanks,

Jean-Philippe - Fortinet Community Team
Anthony_E
Staff
Staff
January 13, 2025

Hello Mostafa,

 

Could we please invite you to open a ticket with our TAC team: https://support.fortinet.com/welcome/

 

They will help you.

 

Regards,

 

 

Best Regards
JohnRiver
New Member
January 22, 2025

Great question, Do you guys have an answer from support?

JohnRiver
New Member
January 22, 2025

Do you have an answer from support team?

JohnRiver
New Member
January 22, 2025

You should be able to add the custom value in CLI, that resolved the same issue reported here

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT