Security for Jenkinss
Jenkins security is the set of controls that stop unauthorised access and protect secrets: authentication, authorisation, credential handling, script approval, agent isolation and plugin hygiene. It sits in the Managing Jenkins stage, because a CI server holds deployment keys and source code and is a high-value target.
Stage: Managing Jenkins · Part of the Jenkins roadmap · Last reviewed 19 November 2026
What to learn in Security
- Configure a security realm and an authorisation strategy such as role-based access
- Store credentials in the credentials store and mask them in logs
- Disable builds on the built-in node and run jobs on agents instead
- Explain Script Security and why Groovy sandbox approval exists
- Keep Jenkins core and plugins patched using security advisories
Security interview questions
Why should you not run builds on the Jenkins controller?
Build code can read files and secrets on the machine it runs on. If it runs on the controller, a malicious or buggy job can access JENKINS_HOME and credentials. Running builds on separate agents with limited rights keeps the controller protected.
How do you avoid leaking secrets in Jenkins logs?
Store secrets as Jenkins credentials and use withCredentials or the credentials helper, which masks values in console output. Never echo them, pass them on a command line that is logged, or hardcode them in a Jenkinsfile that is committed to Git.
Where Security fits in the Jenkins roadmap
Security belongs to the Managing Jenkins stage (intermediate level). Configuration.
Other units in this stage
Back to the full Jenkins roadmap