Interview Prep/DevSecOps/Kubernetes Security

How does a container escape typically happen?

AdvancedConceptKubernetes Security
Answer

Containers share the host kernel, so an escape is either a misconfiguration or a kernel/runtime bug:

  1. Misconfiguration: privileged pod, mounted container runtime socket, writable hostPath, CAP_SYS_ADMIN with cgroup v1 release_agent abuse.
  2. Runtime bug: e.g. CVE-2019-5736 (runc binary overwrite) and CVE-2024-21626 (runc leaked file descriptor giving host filesystem access via WORKDIR).
  3. Kernel bug: Dirty Pipe (CVE-2022-0847) and similar privilege escalations.

Defences: restricted PSS, seccomp, patched runc/containerd and node kernels, user namespaces (hostUsers: false), and sandboxed runtimes such as gVisor or Kata Containers for untrusted workloads.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security