Rolling Out Egress Control for Jenkins Build Steps: A Six-Step Plan From Open Outbound to an Enforced Allowlist
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Rolling Out Egress Control for Jenkins Build Steps: A Six-Step Plan From Open Outbound to an Enforced Allowlist
Most Jenkins build steps can reach any host on the internet today. Moving them to an enforced allowlist is less a tooling problem than a sequencing problem: write the list, name the owner, apply it to one pipeline, then widen. This plan walks through that order with CreateOS Sandbox, where each build gets a fresh microVM and the allowlist is enforced in the host kernel with eBPF, outside the guest.
If you are still deciding whether build agents need egress control at all, start with why Jenkins build agents need egress control and how to get it. This page assumes the decision is made and covers the rollout.
The starting point: what outbound looks like on day one
One fact shapes the whole plan. A sandbox with no egress rules has open outbound access. Deny-by-default starts only when the first rule is set. After that, everything not on the list is denied. Inbound is closed either way.
So installing the plugin changes the machine boundary on day one. Each build runs on its own Firecracker microVM with its own guest kernel, destroyed when the build finishes. It changes nothing about outbound reach until you set a rule. Treat the allowlist as part of the rollout, not a follow-up ticket.
A second fact decides who does the work. The plugin's Sandbox Template has no egress field. Nothing in Jenkins, the Jenkinsfile or the plugin UI sets the policy. Rules are set on the sandbox itself through the CreateOS API or CLI.
Step 1: Pick the pipeline that runs the least trusted code
Do not start with every job. Start with the pipeline that executes code nobody on your team reviewed: pull requests from outside contributors, dependency install hooks, generated code. That is where an allowlist pays for itself first. It is also where you learn what your builds actually reach.
Leave fully trusted internal pipelines for later. If a build only ever runs code your team wrote and reviewed, a microVM per build is more machine than the risk calls for.
Step 2: Inventory what that build reaches today
Write down every outbound destination the pipeline needs, by category:
- The Git host for checkout.
- Package registries for dependency resolution.
- Your artifact store for publishing.
- Test endpoints the suite calls.
- Anything plugins phone home to.
The list is the deliverable. The enforcement mechanism is the easy part once it exists. If you cannot state what a build should reach, no tool will state it for you.
Step 3: Translate the inventory into rules
Rules take a host, host:port, wildcard subdomains, IPs and CIDRs. Use the narrowest form that works:
- host:port where a destination needs only one port.
- Wildcard subdomains for registries and CDNs that spread across many hosts, so the list stays short.
- IPs and CIDRs only where a destination has no stable hostname.
Watch the tradeoff on wildcards. A wildcard over a large CDN keeps builds green and widens the boundary. Every broad rule is a place a compromised dependency can still reach. The egress reference lists the accepted formats.
Step 4: Name the owner, and keep the build out of the rules
Rules live outside Jenkins, so someone outside the pipeline owns them. That owner needs a CreateOS API key and a change path through the API or CLI. Name them before the first untrusted build runs.
Four routes set rules:
- The
egressfield at sandbox create time. PUT /v1/sandboxes/{id}/egress, which applies live with no restart.- The SDK's
setEgressmethod. - The CLI's
createos sandbox firewall set <sandbox> <host>.
Keep the rule set in version control beside the pipeline. A change to what builds can reach then goes through review like any other change.
One placement rule matters more than syntax. The allowlist holds only if the build cannot change it. If the API key that sets the rules sits in the build's own environment, code in the build can call the same API. Apply rules from outside the build, with a key the build never sees.
Step 5: Apply rules to the pilot and close the open window
Because the Sandbox Template has no egress field, the sandbox exists before its first rule does. The window between agent start and that first rule is open outbound. Shrink it: apply rules as early as your process allows, and count any delay as exposure.
Then run the pipeline and watch for failures. A build that breaks on a blocked host means one of two things: the allowlist did its job, or the inventory has a gap. Either way, the fix is a reviewed rule change. The PUT route applies live, so a correction lands on a running build without a restart.
If the build still passes with a handful of destinations instead of the whole internet, you have learned something about your dependency graph that no scanner told you.
Step 6: Expand to the next pipeline, then maintain
Roll the pattern to the next least-trusted pipeline, reusing the same inventory format. Two habits keep the allowlists from drifting:
- New dependencies need new rules. A build that adds a registry host is blocked until someone approves the rule. That is the point. Give it a fast review path, or people will loosen the list to stop the noise.
- Internal services are a separate decision. Attach build sandboxes to a private overlay network with per-network private DNS. Traffic between networks is denied by default, so internal reach is explicit too.
What the rollout costs, and what is still young
There is no long-lived agent pool to clean up, because each build's machine is destroyed when it finishes. Billing is per second with $0 egress, so the allowlist adds no egress charges, and pausing stops vCPU billing (memory and disk are still billed). New accounts start with 500 free credits, enough to run the pilot pipeline for real. Rates are on the Sandbox pricing page.
The plugin shipped on 30 September 2026, so the Jenkins integration is new. The isolation and host-side egress mechanics are the proven part. The fastest evidence for your team is one of your own pipelines running under an allowlist.
Questions teams ask during the rollout
Does installing the plugin before writing rules restrict anything?
It restricts the machine, not the network. Each build gets a fresh microVM with its own guest kernel and inbound closed. Outbound stays open until the first rule exists.
Can a compromised build undo the allowlist once it is set?
Not from inside the guest. Enforcement sits in the host kernel with eBPF, outside the VM, and holds through a full guest compromise. Keep the API key out of the build so it cannot use the API route either.
How do we add a host mid-rollout without rebuilding anything?
Send the new rule through PUT /v1/sandboxes/{id}/egress or the CLI. It applies live with no restart. The CLI command reference covers the firewall commands.
Where do I configure the allowlist in the plugin?
Nowhere. The plugin's Sandbox Template has no egress field, so rules go on the sandbox through the API or CLI. The plugin itself is listed on the Jenkins plugin index.
Install the CreateOS Sandbox plugin for Jenkins. It is listed on the Jenkins plugin index at plugins.jenkins.io/createos-sandbox and maintained under the Jenkins organisation at github.com/jenkinsci/createos-sandbox-plugin. Install it from Manage Jenkins > Plugins > Available plugins. You need a CreateOS API key, which you can create free at createos.sh.
About CreateOS
CreateOS runs AI agents and the code they write. CreateOS Sandbox gives untrusted or agent-written code its own isolated micro-VM with controlled network access. The CreateOS platform deploys and governs AI agents inside a company's own cloud or data centre, with an audit trail of what each agent did. Start at createos.sh.
Related Articles
- Which Jenkins Jobs Need a Per-Build MicroVM Agent? A Job-by-Job Checklist for the CreateOS Sandbox Plugin
- Egress Policy for Jenkins Build Agents: Why the Allowlist Belongs Outside the Build
- What an Untrusted Build Step Can Reach From a Docker Pipeline Container, and Which Alternative Closes Each Gap