Top Defenses Against runC Container Escapes

Rated with a high CVSS score of 7.2, CVE-2019-5736 posed a critical threat to Docker, containerd, and CRI-O environments. Key mitigations included upgrading runC to version 1.0-rc6.2 or later, updating Docker to 18.09.2+, and implementing the principle of least privilege by avoiding running containers as root. The patch introduced `memfd_create(2)` and file sealing to create immutable, memory-backed copies of runC.

The top 3

  1. Foremost Defense: User Namespaces for Root Isolation: User namespaces are a critical defense, mapping container root to an unprivileged host user, thereby preventing a compromised container from gaining host root privileges and accessing sensitive files.
  2. Beyond runC: Top Alternative Runtimes for Isolation: For enhanced security, runtimes like Kata Containers (VM-based isolation) and gVisor (user-space kernel) offer significantly stronger isolation than runC's shared-kernel model, mitigating a wider array of container escape threats.
  3. Critical Defense: Seccomp's Top Strategies for System Call Restriction: Seccomp (secure computing mode) is a Linux kernel feature that restricts the system calls a process can make, effectively reducing the kernel's attack surface for containers. Docker's default seccomp profile acts as an allow-list, blocking over 40 dangerous syscalls, while custom 'deny-by-default' profiles offer even stronger protection by only permitting explicitly required system calls, thus thwarting escape attempts.

Sources

Open the full topic