We've had an issue reported (#151) that Concordion reports are no longer viewable in Jenkins, with an error " Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'"."
If anyone has already fixed this would you please add a
comment to the issue #151.
Here's the research I've added to the issue:
This is due to a new Content Security Policy which Jenkins has introduced:
Jenkins 1.641 / Jenkins 1.625.3 introduce the Content-Security-Policy header to static files served by Jenkins (specifically, DirectoryBrowserSupport). This header is set to a very restrictive default set of permissions to protect Jenkins users from malicious HTML/JS files in workspaces, /userContent, or archived artifacts.
Unfortunately, several popular, useful plugins are affected by this and lose part of their functionality unless the default rules are relaxed.
This rule set results in the following:
No JavaScript allowed at all
No plugins (object/embed) allowed
No inline CSS, or CSS from other sites allowed
...In order to modify the policy, you will need to set the system property
hudson.model.DirectoryBrowserSupport.CSPas documented in the article linked to above.Since Concordion reports use inline CSS and Javascript, it appears you will need to add
script-src 'unsafe-inline'andstyle-src 'unsafe-inline'.With the default settings for Jenkins currently being
sandbox; default-src 'none'; img-src 'self'; style-src 'self';, I'd suggest setting the property tosandbox; default-src 'none'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';Please reply as to whether this works and we will add it to our documentation.
Also, as per the above article, please make sure your HTML Publisher plugin is v1.10 or later.
--
You received this message because you are subscribed to the Google Groups "concordion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion+...@googlegroups.com.
To post to this group, send email to conco...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion/569983C6.8090803%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "concordion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion+...@googlegroups.com.
To post to this group, send email to conco...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion/b233175c-0769-426b-8318-bdcea25fe9fa%40googlegroups.com.
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox; default-src 'none'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; script-src 'unsafe-inline';")