Safeguard
Security Guides•

How do I harden a Jenkins server? A short checklist

A short Jenkins hardening checklist: no anonymous access, builds off the controller, agent access control on, scoped credentials, and sandboxed Groovy.

Safeguard Security Team
3 min read

Harden Jenkins in five moves: keep anonymous access off, run builds on agents with the built-in node at 0 executors, leave agent to controller access control on, scope credentials tightly, and keep Groovy sandboxed with admin-reviewed approvals. Each move comes from the official Jenkins documentation.

The checklist

ControlWhat to checkWhere it comes from
AccessAnonymous access is off and admins are fewJenkins does not allow anonymous access by default, but a disabled setup wizard may not set this
CSRF protectionStill enabledOn by default
Built-in nodeExecutors set to 0Controller isolation guidance
Agent to controller access controlNot disabledAlways on since Jenkins 2.326
CredentialsScoped to folders or jobs, bound with IDsCredentials documentation
GroovySandbox on, approvals reviewedScript Security plugin

Step by step

  1. Confirm authentication. Open Manage Jenkins and check the security settings. If you disabled the setup wizard at install time, verify access control yourself, since the wizard is what configures it securely.
  2. Move builds off the controller. Add agents, then set the built-in node to 0 executors.
  3. Review who can edit jobs. Job/Configure holders can run arbitrary steps. Treat them as less trusted than admins.
  4. Audit credentials. Remove ones nobody uses. Prefer scoped credentials bound with the credentials() helper or withCredentials, with single-quoted shell steps.
  5. Check the approval queue. Look at the In-process Script Approval page and reject anything you do not recognise. Consider forcing the sandbox globally on a locked-down instance.
  6. Update. Apply Jenkins core and plugin updates on a schedule. Plugins are code that runs inside the controller.

What this checklist leaves out

It does not cover network placement, backups, or TLS in front of Jenkins, all of which matter and depend on your environment. It also does not protect the code your jobs build. A hardened controller can still ship a vulnerable dependency, which is why a scan step belongs in the pipeline.

Common mistakes

  • Treating the setup wizard as optional and never revisiting access control afterward.
  • Giving every developer Job/Configure on every folder, which lets any of them run commands on an agent.
  • Leaving one shared credential with broad reach because splitting it felt like work.
  • Skipping plugin updates because a job might break, then running a plugin with a known flaw for months.
  • Approving scripts in the approval queue without reading them, to unblock a colleague.

A good rhythm is monthly for updates and approval queue review, and quarterly for credentials and user permissions. Put those dates in a calendar, not in someone's memory.

Quick check

Which single change helps most?

Moving builds off the controller. It separates job authors from the host that stores your credentials.

How often should I review credentials?

On a schedule you can keep, such as quarterly, and immediately after anyone with job access leaves.

Safeguard adds dependency scanning, SBOM generation and pull request gates around a pipeline like this. The free scan is a quick way to see your current dependency exposure.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.