Menu

1 / 2

Jenkins Agent Hardening: Lock Down Build Execution

DEV Community: cicd·Oleksandr Kuryzhev·17 days ago
#XTK5PN0x
#devtocicd#devto#dev#agent#jenkins
Reading 0:00
15s threshold

Originally published on kuryzhev.cloud

The scenario

A pull request from a contributor changes a Jenkinsfile , and the build runs on a long-lived agent that also builds your release branch. Nothing in the pipeline looks malicious. However, the agent has a Docker socket mounted, a cloud credentials file in the home directory, and a workspace left over from the last job. Jenkins agent hardening exists to make that situation boring. A build can run arbitrary code, so the machine running it should have nothing worth stealing and no way to reach beyond its own job.

The Jenkins project documents the controller/agent trust model in its controller isolation guide . The short version is that anyone who can change a pipeline can execute code on an agent, so agents are a trust boundary.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.