I was trying to execute a seed job(having github url with groovy scripts) in jenkins and got following error.
First time build. Skipping changelog.
Processing DSL script APIServerDeployer.groovy
ERROR: script not yet approved for use
Finished: FAILURE
This protection is provided by the Script Security plugin. As soon as an unsafe method is used in any of the scripts, the administrator can use the "In-process Script Approval" action appears in Manage Jenkins to allow the unsafe method. Unsafe methods should not be enabled without careful consideration of the impact.
The “Role-based Authorization Strategy” plugin must first be installed in the “Managed Jenkins… Manage Plugins” dialog. 2. Then the role-based strategy is selected in the “Manage Jenkins…Configure Global Security” dialog and in the Authorization section select “Role-Based Strategy”.
To create the seed job, go to your_jenkins_url , log in (if necessary), click the New Item link on the left of the dashboard. On the screen that follows, type in seed , select Freestyle project, and click OK. In the screen that follows, scroll down to the Build section and click on the Add build step dropdown.
Scriptler allows you to store/edit groovy scripts and execute it on any of the agents/nodes... no need to copy/paste groovy code anymore. Besides administering your scripts, Scriptler also provides a way to share scripts between users via hosted script catalogs on the internet.
In order to get past this Jenkins security feature, you will need to approve your script. Go to Manage Jenkins -> In-process Script Approval. In that screen, you will see the script that you are trying to execute. There should be an approve button that you'll need to click to approve that script.
Job DSL version 1.60 introduced Script Security, to restore old behavior, uncheck Enable script security for Job DSL scripts in the CSRF Protection section of the "Configure Global Security" page. This should only be done if you have another way of approving scripts, such as through git pull request approval if your seed job builds jobs living in git.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With