The “Content-Security-Policy” header is designed to modify the way browsers render pages, and thus to protect from various cross-site injections, including Cross-Site Scripting. It is important to set the header value correctly, in a way that will not prevent proper operation of the web site. For example, if the header is set to prevent execution of inline JavaScript, the web site must not use inline JavaScript in it’s pages.
To protect against Cross-Site Scripting, it is important to set the ‘default-src’ policy, or ‘script-src’ AND ‘object-src’ with proper values. Insecure values such as '*", 'data:", 'unsafe-inline", or ‘unsafe-eval’ should be avoided.
In addition, to protect against Cross-Frame Scripting or clickjacking, it is important to set the ‘frame-ancestors’ policy with proper values. Insecure values such as ‘*’ or ‘data:’ should be avoided.
Thanks for notifying us about the CSP header - we are going to discuss it internally the next days. I will let you know the outcome of the discussions.
As SonarQube currently fetches resources from several different external hosts, many of them in a dynamic way, setting a meaningful CSP header turned out to be a non-trivial task.
We are convinced that we need to implement it but it requires a bit more thought. We aim to do it this year at least.
Any updates on this @ganncamp with the 8.6 LTS? Our security teams ping us periodically on the status, so, we’re simply passing it along. Thanks in advance!
Was this eventually implemented? We’ve gone past LTS, v8.9 and have implemented v9.4. Curious if CSP Headers were included in any of the updates since this was brought up. Thanks for any updates!
This is not yet supported. We’d like to start adding a first CSP before the next LTS and iteratively and carefully introduce other CSPs in the following SonarQube versions.
I’m happy to inform you that SonarQube 9.9 LTS is adding the CSP header (SONAR-17619). We’ve also made an additional improvement to strengthen the security policy in 10.0 (SONAR-18809).
You’ll find references to these changes in the 9.8 announcement and in the 10.0 announcement.