A container is a process with some isolation - not a hard security boundary. If an attacker lands in a pod, "escaping" to the host (and then the cluster) is often one misconfiguration away.
Common escape paths
- Privileged containers (
--privileged) - nearly full host access; trivial to break out. - Mounted Docker socket (
/var/run/docker.sock) - control the daemon = control every container and the host. - Host path mounts - a container mounting
/or host directories can read/write host files. - Excessive capabilities (
CAP_SYS_ADMIN) or host namespaces (hostPID,hostNetwork). - Node/kubelet credentials - stolen service-account tokens to pivot across the cluster.
Detect + prevent
- Detect with runtime security (e.g. Falco): a shell in a container, unexpected mounts, or writes to sensitive host paths.
- Prevent with least privilege: drop capabilities, run as non-root, no privileged pods, no docker.sock mounts, and enforce Pod Security Standards / admission control.
- Scan images (Trivy/Grype) and IaC (Checkov, kube-bench) before they ship.
The rule of thumb: treat every container as potentially hostile to its host, and give it the absolute minimum it needs.
