Issue
I am setting up a jenkins service on docker swarm. In my image, I am shipping a basic configuration (incl. config.xml
, proxy.xml
, ...) for jenkins. I want the "Enable Agent → Master Access Control" option under "Configure global security" to be swithed on by default, so what do I have so set in which configuration file?
I started a jenkins service in my docker swarm without that switch, turned the option on via web interface and checked ${JENKINS_HOME}/config.xml
but I could not find anything in config.xml
that sounds like the option I want.
The "Enable Agent → Master Access Control" option should be switched on via config file. Can anyone advice?
Solution
$JENKINS_HOME/secrets/slave-to-master-security-kill-switch
is the file you're looking for.
Excerpt from the official doc:
There are essentially three ways of enabling the access control mechanism:
- Through web UI, go to http://jenkins/configureSecurity and check "Enable Agent → Master Access Control" option.
- Through file system, create or edit the file $JENKINS_HOME/secrets/slave-to-master-security-kill-switch so that it contains false.
- Using a Groovy Hook Script and doing something like this:
import jenkins.security.s2m.AdminWhitelistRule
import jenkins.model.Jenkins
Jenkins.instance.getInjector().getInstance(AdminWhitelistRule.class)
.setMasterKillSwitch(false)
Answered By - Technext
Answer Checked By - Timothy Miller (JavaFixing Admin)