Est.

How Docker Containers Isolate Network Traffic Between Tenants

Namespaces, cgroups, and eBPF each close different gaps, but none replaces the shared kernel.

· 9 min read
Cover illustration for “How Docker Containers Isolate Network Traffic Between Tenants”
Sandbox Isolation Primitives · November 12, 2026 · 9 min read · 1,991 words

Docker isolates tenant network traffic through a stack of Linux primitives and policy controls. Each layer answers a different question about visibility, resource use, permitted operations, or traffic flow. Understanding those distinctions, and the shared-kernel limit beneath them, is what makes a multi-tenant design defensible under adversarial conditions.

Why network isolation in multi-tenant container environments is harder than it looks

The expectation that “each container is its own box” hides the most consequential part of Docker’s architecture. Containers share the host OS kernel, so their separation depends on controls within that kernel. The box has a shared foundation. Network separation adds another complication because tenant traffic must ultimately pass through the same physical NIC and datacenter switching infrastructure.

What, then, does a separate container actually guarantee? Thiyagarajan & Nayak identify insufficient network segmentation as a distinct Docker security challenge, together with runtime misconfigurations and supply chain risks. The practical concern is that configuration errors can expose information between tenant networks. Probing those errors can reveal leaks despite the apparent separation of the containers themselves.

What Linux network namespaces actually do, and what they deliberately leave untouched

A Linux network namespace gives a container its own network devices, IP addresses, routing tables, port numbers, and firewall rules. Two containers can both listen on port 80 without a conflict. Their port numbers belong to different network stacks. This is a precise form of separation, but it does not mean that the two containers cannot exchange traffic or that their traffic is secured at the physical layer.

Seeing, reaching, and consuming are different capabilities. A namespace determines which network objects a process sees, while connectivity depends on how that namespace is connected and what traffic policy permits. Docker establishes a virtual Ethernet bridge between container namespaces and the host network, creating a point where tenant traffic paths converge. Resource consumption is a separate question again, because a container can exhaust resources without seeing the host’s other processes.

Other namespace types partition different parts of the system. PID namespaces separate process trees, MNT namespaces separate filesystem mounts, and USER namespaces provide UID/GID mapping. IPC namespaces isolate shared memory and semaphores, preventing one container from eavesdropping on or disrupting another’s interprocess communication through those mechanisms. None of these jobs substitutes for network policy.

How cgroups, seccomp, and LSMs layer on top of namespaces to constrain what a container can do

Control groups, or cgroups, constrain consumption. Resource limits cover CPU, memory, disk I/O, and network bandwidth, addressing the noisy-neighbor problem in which one tenant starves neighboring workloads. But an allocation is not an authorization policy. A container that stays within its memory limit can still try system calls that its resource limits do not block.

Seccomp filters which system calls a container may make. Linux Security Modules, including AppArmor and SELinux, add restrictions on permitted operations, reducing what a compromised container can do. Together, these controls supplement namespaces to narrow the attack surface while leaving residual exposure.

Configuration determines how much of that protection holds. Thiyagarajan & Nayak identify runtime misconfigurations as a major exploitable vulnerability class, which explains why the existence of these layers is not evidence that a deployment uses them correctly. None of these layers can guarantee that a kernel exploit will be stopped before it reaches the host. The stack constrains access to a shared kernel rather than replacing that kernel with a separate tenant boundary.

Where Docker's default network model creates inter-tenant exposure

Docker’s default bridge allows every container attached to it to communicate with the others. A frontend can reach a database unless explicit controls prevent it. That is convenient for development on one host. When the frontend and database belong to different customers, however, the same default creates an unintended cross-tenant path.

Reachability creates an opportunity to access neighboring workloads and, through exposed services or compromised applications, their credentials and data. The distinction is important because network segmentation closes communication paths, while application controls govern what a reachable service discloses. Neither can stand in for the other.

Setting icc to false disables inter-container communication on the default bridge, with explicit communication available through the legacy --link mechanism. User-defined networks are separate from that setting and may permit communication freely, so their membership requires deliberate configuration. These choices address traffic exposure. Runc flaws have allowed containers to escape to the host, demonstrating a failure mode that bridge configuration cannot contain.

What multi-tenant patent approaches reveal about the limits of container-native isolation

US Patent 11,842,217 covers how to isolate tenants that run in multi-tenant software containers. US Patent 10,432,466 addresses translating PaaS/CaaS abstractions into logical network topologies. Their subjects expose a common engineering gap. Container primitives do not, by themselves, translate the concept of a tenant into a complete enforcement model.

The filings are evidence of design work around that gap, rather than proof that every proposed mechanism succeeds. They help show how a container’s location on the network differs from the identity of the tenant who has the right to use it. A tenant-aware control plane must track that identity and map its intended permissions into enforcement. Bridge membership or an IP address alone does not express the full relationship.

How eBPF-based enforcement shifts network policy from IP addresses to workload identity

Standard Kubernetes networking is permissive by default, and NetworkPolicies specify segmentation without enforcing it themselves. Enforcement depends on the CNI plugin. A policy document has no protective effect unless the networking implementation applies it.

Cilium uses eBPF to enforce policy in the Linux kernel at the source of traffic, without extra components in that data path. Its identity-based rules refer to services, pods, or containers. Policy can keep referring to the same workload even when its container addresses change.

Policy can also distinguish operations within a connection. At L7, rules can allow GET /items while blocking POST /admin/shutdown, so they apply least privilege at the API level. Hubble provides per-flow telemetry so that teams can observe traffic rather than infer enforcement from configuration alone. Without that visibility, policy errors can remain unnoticed and audits lack evidence of what actually crossed the boundary.

Even identity-aware enforcement needs vulnerability tracking and maintenance. Under those conditions, a wildcard namespace allow rule is created by mistake in place of the intended restrictive rule. The remedy is an upgrade to a patched version or later, illustrating why policy correctness depends on implementation as well as intent.

Where the kernel boundary remains the ceiling that network controls cannot raise

Network namespaces and eBPF policies operate within the shared-kernel substrate compromised by a successful kernel exploit. Once an attacker gains host-level access, other tenants on that host are potentially exposed, regardless of how carefully their normal network traffic was segmented.

Binkowski et al. identify Docker’s direct operation on the host system as the reason it is more vulnerable to attacks than hypervisor-based virtualization. This identifies the limits of a model suited to single-tenant, trusted-code workloads. When a multi-tenant deployment executes untrusted code or code generated at runtime from LLM output, stronger isolation is required in addition to network policy.

Stronger isolation runtimes and what they change about the tenant boundary

MicroVMs change the boundary by placing workloads behind hardware-enforced virtualization rather than relying only on host-kernel access controls. Kata Containers makes that approach available through standard container APIs, orchestrating VMMs including Firecracker, Cloud Hypervisor, and QEMU. Teams can use it through kubectl and containerd without building custom VMM orchestration. The image need not define the isolation boundary.

gVisor takes a different approach to the same structural problem. It interposes a user-space kernel that intercepts container system calls before they reach the host kernel. A compromised container meets a user-space sandbox before those calls can reach the host. The gain comes with performance overhead, making workload requirements part of the architectural choice.

These approaches strengthen different parts of the execution path. MicroVMs introduce a virtualization boundary, while gVisor changes how system calls reach the host. Neither replaces the need to decide which tenant may contact which service. For existing Docker infrastructure, a Kata or gVisor RuntimeClass in Kubernetes offers an incremental path that retains the image pipeline while changing runtime isolation.

For an agent, a stronger boundary can contain execution but still lose its progress through a restart. Generic microVM orchestration and Docker alone were not designed to solve that whole execution problem. Isolation strength and execution continuity must therefore be evaluated separately.

Stateful execution and long-running agents and the gaps in ephemeral models

An agent that loses intermediate state on restart must reconstruct work before it can continue. For a multi-step workflow, that can be slow and unreliable. Ephemeral execution leaves an operational gap even when the sandbox boundary is appropriate.

Event-sourced replay records actions, file edits, and terminal commands as immutable events. A restarted container can replay them to rebuild state, but the cost grows with workflow length. VM-level memory snapshots preserve a different kind of continuity. By capturing memory and processes, they allow resumption with intermediate computations and attached debuggers intact.

MicroVM runtimes can also use copy-on-write forks of warm sessions to branch agent workflows without paying the full initialization cost for each branch. The Crab checkpoint/restore approach uses runc for lifecycle management, ZFS snapshots for filesystem state, and CRIU for process state to smooth checkpoint bursts. These mechanisms fall at different points between replay and full snapshots. For long-running agents, the design requirement is a sandbox that is stateful by design and able to run indefinitely, pairing containment with a viable continuation mechanism.

Compliance consequences of tenant network isolation choices

Tenant separation also becomes part of the evidence used to demonstrate compliance with PCI-DSS, SOC 2, HIPAA, and GDPR. Microsegmentation sets clear boundaries between tenants and environments and limits lateral movement after an attack. Its rules can be documented and versioned. Architecture and evidence are connected, but neither is a substitute for the other.

Declarative network policies managed in Git, often called Policy as Code, provide a record of which rules existed and how they changed. That history must come with evidence that the rules were applied. Flow-level telemetry shows the traffic, while immutable logs keep an audit trail that teams can use to investigate incidents.

GDPR’s 72-hour breach notification requirement makes that investigative capability especially consequential. An architecture without immutable flow-level logs leaves a gap in the network audit trail needed to support notification. When regulated deployments run AI-generated code, the execution environment must include compliance controls from the start. Built-in controls make it easier to meet those requirements for each deployment, but runtime isolation alone does not guarantee compliance.

A practical decision framework for matching isolation depth to tenant threat model

The decision begins with three questions about who wrote the code, how many tenants share a host, and what an escape could expose. These variables determine the required boundary. For single-tenant, trusted code, namespaces, cgroups, seccomp, and careful bridge configuration provide an appropriate standard Docker model. There is no need to treat every workload as though it has the same adversary.

For multiple tenants running trusted code, the lesson is to add identity-based eBPF policy and flow-level observability. That deployment should use user-defined networks in place of shared default-bridge connectivity and turn off inter-container communication on any default bridge that remains by setting icc to false. User-defined networks still need explicit policy for segmentation because the setting does not apply to them. Network membership is not tenant authorization.

For multiple tenants executing untrusted or AI-generated code, microVM or syscall-interception runtimes are required beyond those network controls. Long-running agents add statefulness as a fourth variable, calling for snapshots or checkpoint/restore so that progress survives interruption. Existing Docker teams can retain their image pipelines, adopt Kata or gVisor through a Kubernetes RuntimeClass, add Cilium for identity-based enforcement, and instrument Hubble for flow-level audit trails without rewriting the application stack. The defensible choice is the combination whose guarantees match the threat model, with each primitive’s limits understood as precisely as its protections.

Sources

  1. Docker under Siege: Securing Containers in the Modern Era
  2. Securing 3rd Party App Integration in Docker-based Cloud Software Ecosystems
  3. Isolating tenants executing in multi-tenant software containers
  4. Translating PAAS/CAAS abstractions to logical network topologies
  5. A Fresh Look at the Architecture and Performance of Contemporary Isolation Platforms

More in Sandbox Isolation Primitives