Skip to content

Course

Container Escape & Defense

How Linux namespaces, cgroups, capabilities, and seccomp actually isolate containers; the privileged-mode, socket-mount, runtime-bug, and kernel-CVE escape paths; and the user-namespace, gVisor/Kata, and hardening practices that hold.

14 lessons

Course Q&A

Keep reading

Related articles from the SudoSecurity blog.

Reviews

Enrolled members can rate this course.

No reviews yet.

What a Container Actually Is

Namespaces, cgroups, capabilities, and seccomp: the bookkeeping that is the whole wall.

  1. 01A Container Is a Process With a Broken ViewDocker containers are ordinary processes lying about their view via clone() namespace flags, and /proc/<pid>/ns/ inodes prove which walls exist.12mOpen
  2. 02The Three Namespaces That MatterMount, PID, and network namespaces each privatize a different table, and each host-mode flag deliberately unbuilds one of them.13mOpen
  3. 03cgroups Are a Meter, Not a Wallcgroups count and throttle resources; they never isolated anything except device access — and their release_agent feature became an escape.10mOpen
  4. 04Capabilities: The Real Permission SystemRoot is a bitmask: Docker keeps fourteen capabilities, drops the dangerous rest, and CAP_SYS_ADMIN is the new root.13mOpen
  5. 05Seccomp: The Syscall GateThe default seccomp profile is an allowlist that denies roughly 44 dangerous syscalls, and blocking io_uring in 2021 erased dozens of CVEs' worth of surface.13mOpen

Escape Paths

Privileged mode, mounted daemon sockets, shared namespaces, runtime bugs, kernel CVEs, and Kubernetes-specific surfaces.

  1. 01--privileged Means HostPrivileged mode disables capabilities, seccomp, MAC, and the device filter all at once, making escape a menu instead of an exploit.11mOpen
  2. 02Mounting docker.sock Is Mounting rootThe Docker API socket is a root daemon with no scoped permissions — mounting it, or exposing port 2375, is remote root on the host.10mOpen
  3. 03Shared Namespaces and Bad Mounts--pid=host, --network=host, hostPath mounts, and writable /proc or cgroupfs each delete a specific wall, including the loopback-is-private assumption.14mOpen
  4. 04When the Runtime Is the Holerunc CVE-2019-5736 and CVE-2024-21626 show the tool that builds the boundary leaking across it, and BuildKit made docker build attack surface too.12mOpen
  5. 05One Kernel, One Blast RadiusAll containers share one kernel, so Dirty Pipe, nf_tables, and OverlayFS bugs escape every namespace at once and kernel updates are container security updates.14mOpen
  6. 06Kubernetes Adds an Orchestrator With CredentialsPods carry API tokens, nodes hold kubelet identity, and Siloscape, the subPath race, NVIDIA toolkit bugs, and cloud metadata each turn pod access into node access.15mOpen

Defense in Depth

User namespaces, rootless runtimes, gVisor and Kata second kernels, and the hardening checklist that holds.

  1. 01User Namespaces and RootlessUser namespaces remap container root to an unprivileged host UID, rootless daemons demote the daemon itself, and the same feature arms nf_tables bugs.12mOpen
  2. 02When Namespaces Aren't EnoughgVisor reimplements syscalls in a Go userspace kernel, Kata gives each pod its own VM kernel, and RuntimeClass routes untrusted pods to them.12mOpen
  3. 03The Hardening ChecklistEvery lesson lands in a config line: dropped caps, no-new-privileges, RuntimeDefault seccomp, read-only rootfs, PSA enforcement, and a patch cadence.15mOpen