Content Security Policy Modification on Windows

33 views
Skip to first unread message

David Caudill

unread,
Nov 17, 2017, 3:59:26 PM11/17/17
to Jenkins Users
hi!

I have this script, which works fine in the Jenkins Script Console:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts allow-same-origin; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;")`

I need this to run on every startup.  Documentation provides examples of running groovy scripts from a designated folder on startup...on linux.  Is there an option for Windows, or do I have to translate this to arguments?  How do I do that with this cryptic command?

Any help is appreciated!

Victor Martinez

unread,
Nov 18, 2017, 6:24:39 AM11/18/17
to Jenkins Users
If you put that particular snippet in  $JENKINS_HOME/init.groovy.d/fileXYZ.groovy it should work as explained below:


You can also force it as part of the jenkins java properties:

Cheers

Reply all
Reply to author
Forward
0 new messages