EilonA
EilonA

Reputation: 571

Jenkins - scriptler scripts require admin approval, how to auto-approve scripts?

I have scripts in Scriptler plugin that require approval from administrator.

I'm running Jenkins in K8S and I'm adding scripts into /var/jenkins_home/scriptler/scripts.

How do I auto approve new scripts or disable the request to approve?

Things I have done that didn't work - I have installed 'permissive-script-security' plugin and enabled it.

Upvotes: 3

Views: 316

Answers (1)

Joey.Lu
Joey.Lu

Reputation: 124

As Dec 2024, looks like there is no way to auto approve it when the script is first time running.. You can either auto-approve existing pending scripts by looking at HamoriZ's answer [here][1] , or disabling this particular security feature by looking at Erwin Alberto's answer in the same post [here][1]. To disable it using code:

java -jar "${CLI_JAR_DIR}/jenkins-cli.jar" -s "http://${JENKINS_URL}" -auth "admin:${API_TOKEN}" groovy = <<EOF

import javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration

import jenkins.model.GlobalConfiguration GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class).useScriptSecurity=false GlobalConfiguration.all().get(GlobalJobDslSecurityConfiguration.class).save()

EOF

I also tried a plugin everyone talked about. It does not work with today's Jenkins. I also tried to pre-approve a lot of signatures, it does not seem to work for my case either. So My occlusion is, it is the most convenient to disable this security feature, since it will blocks the script again even with the smallest changes to the script itself. [1]: seed job asks for script approval in jenkins

Upvotes: 0

Related Questions