Skip to content

Network & Resource Isolation

Engineer/DeveloperSecurity SpecialistOperations & StrategyDevopsSRE

Authored by:

munamwasi
munamwasi
jubos
jubos
masterfung
masterfung

Reviewed by:

matta
matta
The Red Guild | SEAL

🔑 Key Takeaway: Treat network and compute as hard containment boundaries: deny egress by default, segment trust zones to prevent lateral movement, and enforce strict resource limits to block abuse and runaway jobs.

Network and compute controls are critical containment layers for sandboxed execution.

Without them, a compromised build or tool can:

  • exfiltrate source code and secrets
  • scan internal services and pivot laterally
  • abuse infrastructure through runaway jobs
  • create cost spikes via unbounded resource usage

Network isolation model

1) Default deny egress

Start with no outbound access. Add explicit allow rules only for required destinations (SCM host, package registries, artifact storage, approved APIs).

2) Separate trust zones

Use distinct network boundaries for:

  • untrusted PR validation
  • internal trusted builds
  • release/deploy pipelines

Do not allow direct network paths from untrusted workloads to sensitive control planes.

3) Constrain DNS and metadata access

  • Restrict DNS resolvers and block arbitrary external name resolution where feasible.
  • Deny access to cloud metadata endpoints from untrusted jobs unless explicitly required.

4) Centralize outbound controls

For mature environments, route egress through policy-enforcing gateways/proxies to monitor and block prohibited destinations.

Resource isolation model

Enforce limits at runner and workload level:

  • CPU and memory limits per job/container
  • process count (pids) limits
  • filesystem and artifact size limits
  • execution timeout limits
  • concurrency limits per workflow/repository

These controls are both security and reliability controls.

CI/CD implementation checklist

  • Untrusted jobs run in isolated runner pool
  • Default-deny egress applied to untrusted zone
  • Destination allowlists documented per pipeline stage
  • Metadata service access restricted
  • CPU/memory/pids limits configured
  • Job and step timeouts enforced
  • Max artifact/log size capped

Example control matrix

Workload typeEgress policyResource policy
Fork PR validationdeny-by-default, minimal allowliststrict CPU/memory/time limits
Internal CI buildallow required registries/APIs onlymoderate limits, queue controls
Release/deployhighly specific allowlist to deployment targetsconservative limits + approval gates

Common anti-patterns

  • “Allow all egress” for convenience in CI.
  • Reusing a single runner network profile for all trust levels.
  • Missing job timeouts (infinite loops become outages).
  • Unlimited artifact uploads from untrusted workflows.

References