Who Owns the Egress Allowlist for Jenkins Builds That Run Untrusted Code?
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.
Who Owns the Egress Allowlist for Jenkins Builds That Run Untrusted Code?
Not the Jenkins job, and not the plugin. When builds run on CreateOS Sandbox agents, the egress allowlist lives on the sandbox itself, set through the CreateOS API or CLI, and it is enforced in the host kernel outside the build's microVM. That makes outbound access an infrastructure policy, owned by whoever owns build security, rather than a line of job configuration. Until the first rule is set, outbound is open.
Why outbound access is the exfiltration path in a build
A Jenkins controller holds deploy keys, credentials and network reach into staging and production. Builds pull in dependencies, scripts from forked pull requests and code an agent wrote. A malicious postinstall script does not need to break anything to do damage. It only needs to read a secret and send it somewhere.
A fresh microVM per build contains what the code can touch on the machine. Egress policy decides what the code can reach off the machine. For untrusted builds you need both, and the second is the one teams leave for later.
The default you start from
On CreateOS Sandbox, isolation is on by default. Egress restriction is not.
- A sandbox with no egress rules has open outbound access.
- Once at least one rule is set, everything else is denied.
- Enforcement sits in the host kernel with eBPF, outside the guest, so it survives a full guest compromise.
- Inbound is closed by default, whatever the egress state.
So the first decision is not which hosts to allow. It is who is responsible for making sure a rule exists before untrusted code runs.
Why the plugin has no egress field, and why that helps
The CreateOS Sandbox plugin's Sandbox Template has no egress field. The allowlist is never something you configure inside Jenkins or the plugin UI. You set it on the sandbox through one of these routes:
- 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>
The routes and rule formats are documented on the Egress page and in the CLI command reference.
Keeping policy out of job configuration has a useful side effect. Editing a job does not change the network rules, and neither does code running inside the build. The people who own the build's trust boundary own the allowlist, and the build cannot negotiate with it.
What belongs on a build allowlist
Start from what builds genuinely need and nothing else. For most compile-and-test builds, that is a short list:
- your artifact registry
- your package mirrors
- your git host
Rules take a host, a host:port pair, wildcard subdomains, IPs and CIDRs. Prefer exact hosts over wildcards where you can, and a port where you know it.
A list that grows by copying a working build's network log is a list nobody reviewed. Begin narrow, add an entry when a build fails for a reason you understand, and record why each entry exists.
A simple ownership model
| Decision | Who usually owns it | Where it lives |
|---|---|---|
| Which stages run on a sandbox agent | Pipeline owners | Jenkins job configuration |
| Which hosts sandboxed builds may reach | Security or platform team | The sandbox, through the CreateOS API or CLI |
| The CreateOS API key | Jenkins administrators | Jenkins credentials |
| Changing a rule mid-run | Security or platform team | PUT /v1/sandboxes/{id}/egress, applied live |
| Proving the rules hold | Security or platform team | A deliberate test against a host not on the list |
The split mirrors the trust split. Pipeline authors decide what runs. The team accountable for the network decides what it can reach.
Proving the policy holds
An allowlist you have not tested is an assumption. After setting rules, run a build that tries to reach a host outside the list. The connection should fail at the host. Keep that check and repeat it after every allowlist change.
If a build fails because a legitimate host is missing, that is the system working. Add the host through the API or CLI with a note on why, and rerun.
Tradeoffs to plan for
- Open until the first rule. A sandbox agent with no rules can reach anything outbound. Make rule creation part of the rollout, not a follow-up ticket.
- A machine per build costs more than a shared container. Per-second billing and $0 egress keep the bill tied to build time, and shapes start at a quarter CPU.
- The rootfs needs a JVM. The plugin's agent runs inside the microVM, so a minimal custom image needs Java added.
- Some builds cannot leave your perimeter. Bring your own compute runs the same API on your machines; see Self-Hosting.
For the full plugin setup from install to first build, follow our step-by-step guide to sandboxing untrusted code in Jenkins. This page stays on the network policy.
Questions about Jenkins build egress
Is the egress allowlist configured in the Jenkins plugin?
No. The plugin's Sandbox Template has no egress field. Rules are set on the sandbox through the CreateOS API or CLI: the egress field at create time, PUT /v1/sandboxes/{id}/egress, the SDK's setEgress method, or createos sandbox firewall set. The plugin page covers what the plugin itself does.
Can code inside a build change its own rules?
No. Enforcement is in the host kernel with eBPF, outside the VM. Code inside the build cannot rewrite the rules or route around them, even after a full guest compromise.
Does changing a rule restart the build agent?
No. PUT /v1/sandboxes/{id}/egress applies live with no restart needed.
Is inbound access open while we work out the rules?
No. Inbound is closed by default regardless of egress state. Only outbound is open until the first rule exists.
What can we tell our auditors about build network access?
That the allowlist is set outside Jenkins, enforced in the host kernel outside each build's VM, and tested by a deliberate failed connection. Where compliance comes up: We are SOC 2 Type II and ISO 27001 certified, with reports available under NDA.
Install the plugin
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.