CAP_SYS_ADMIN is a Linux capability that grants a huge, catch-all set of privileged operations, mounting filesystems, configuring namespaces, and much more, so broad it is often called "the new root". A container holding CAP_SYS_ADMIN can usually escape to the host, classically by abusing the cgroup `release_agent` mechanism or mounting host filesystems. It is sometimes added for convenience, but it effectively undoes capability dropping. Containers should run with it removed.
What CAP_SYS_ADMIN is
Linux capabilities split the old all-or-nothing root power into units, so a process can be given just the privileges it needs. CAP_SYS_ADMIN is the exception: it bundles such a large and varied set of privileged operations (mount, pivot_root, namespace and cgroup configuration, and more) that it approximates full root.
That breadth is why it is called "the new root" and why granting it to a container largely defeats the point of running containers with reduced privileges.
The escape and payload
A container with CAP_SYS_ADMIN has well-known escape routes:
- cgroup release_agent escape: mount the cgroup filesystem, set a
release_agentscript andnotify_on_release, then trigger it so the host executes the attacker’s script as root. - Mounting host filesystems directly, then reading or writing host files (similar to a privileged container).
These turn the capability into root code execution on the host. Documented techniques shown for defenders.
How to defend
- Do not grant CAP_SYS_ADMIN to application containers; find a narrower capability or a different design.
- Drop all capabilities (
--cap-drop=ALL) and add back only the specific, minimal ones required. - Block added capabilities with Pod Security Standards (restricted) and admission control.
- Keep seccomp and AppArmor enabled to limit what even a capable container can do.
- Audit manifests for
SYS_ADMINincapabilities.addand test for cgroup-based escapes.
References
- [1]Linux man-pages: capabilities(7)(man7.org)
- [2]NIST SP 800-190 Application Container Security Guide(NIST)
- [3]MITRE ATT&CK: Containers Matrix(MITRE)