Container Escape: All You Need Is Cap (Capabilities)
summary
Demos show two concrete escape chains that work: compiling and insmod’ing a kernel module that calls call_usermodehelper to spawn a root reverse shell when CAP_SYS_MODULE is effective, and attaching gdb/ptrace to a host PID (container started with pid=host and CAP_SYS_PTRACE) to inject a root shell into a host process. Attack prerequisites include matching kernel headers, no AppArmor/seccomp block, or privileged mode. Tools: capsh decode, make, insmod, gdb. Mitigations: drop all caps then add only needed, use seccomp‑bpf/AppArmor and Kubernetes securityContext policies.
AI-written summary · about
chapters (14)
- 0:00Introduction and speakers
- 1:03Container attack surface
- 3:12Containers vs virtual machines
- 5:40What are capabilities
- 9:13Default Docker capabilities
- 10:38Privileged containers
- 11:41Discovering capabilities
- 13:31Cap sys module escape
- 17:55Cap sys ptrace escape
- 21:30Real-world vulnerable containers
- 23:22TeamTNT threat group
- 25:56Detection and mitigation
- 28:03Seccomp-bpf for security
- 30:14Summary and Q&A
related talks
45mThe Container Escape Room: An Exploration of Container Escapes
43mA Compendium of Container Escapes
41mEscaping Virtualized Containers
32mContainer Escape Paths Nobody Monitors: Abusing Linux Debug Interfaces
33mContainers Security Layers and How Not to Break them
38mContainer Security, capabilities an seccomp profiles
50mThe state of container security
26mContainers: Your Ally in Improving Security
