“In theory, theory and practice are the same. In production, attackers get a vote.”
These chains are realistic sequences attackers use. They’re written from a defender’s perspective: entry → escalation → persistence → impact → detection points.
Theme: Mounting docker.sock (or other runtime socket) turns a container into a host admin.
- A container has access to
/var/run/docker.sock(or a Docker TCP API), or similar privileged runtime API exposure.
-
Initial foothold in container
- Attacker gets code execution (RCE), or shells in via weak creds, SSRF-to-metadata, leaked token, etc.
-
Discover the socket
- Check for
/var/run/docker.sockor environment hints. - If present, attacker can talk to Docker daemon.
- Check for
-
Query Docker daemon
- Enumerate images/containers/volumes.
- Identify host mounts, privileged containers, secrets in env vars.
-
Start a new privileged container
- Run a container with:
--privilegedOR added capabilities- host mounts like
-v /:/host - host PID/network if needed
- Run a container with:
-
Host takeover
chroot /host→ attacker is effectively on the host filesystem.- Add SSH keys, modify systemd units, drop persistence.
-
Pivot
- Harvest kubelet creds, cloud credentials, registry tokens from host.
- Move laterally to other nodes / control plane.
- Full node compromise → cluster compromise → cloud account compromise (depending on IAM).
- Any container mounting runtime sockets
- Container spawning containers / creating privileged workloads
- Unexpected access to
/var/run/docker.sock - New container with host mounts or privileged flags
- Never mount runtime sockets into workloads
- Use admission policies to block
hostPathon runtime sockets - Least-priv runtime and separate build infrastructure
Theme: Kubernetes misconfig gives attacker node-level control without exploiting a CVE.
- Attacker can create pods (or modify workloads) with:
privileged: trueOR dangerous capshostPathmounts OR host namespaces
-
Get a Kubernetes credential
- Steal ServiceAccount token from a pod (
/var/run/secrets/...). - Or find token in logs / env / CI artifacts.
- Steal ServiceAccount token from a pod (
-
Enumerate RBAC permissions
- Identify ability to create pods / exec / patch deployments.
-
Create an “escape pod”
- Pod spec includes:
securityContext.privileged: truehostPath: /mounted at/host- (optional)
hostPID: trueto see host processes
- Pod spec includes:
-
Break out via host filesystem
chroot /host- Modify host binaries, cron jobs, systemd services.
-
Establish persistence
- Drop a systemd unit or cron job on the node.
- Add SSH keys if sshd exists.
-
Cluster expansion
- Read kubelet config/kubeconfig on host.
- Access container runtime and extract other pods’ secrets.
- Node compromise → secret harvesting → potential cluster-admin → cloud creds.
- Pod creation with
privileged,hostPath,hostPID,hostNetwork - Writes to
/etc/systemd,/etc/cron*,/root/.ssh - New DaemonSet with suspicious mounts
- Admission controls (OPA/Gatekeeper/Kyverno): block privileged + hostPath
- Pod Security Standards “restricted” baseline
- Minimize who can create/patch workloads
Theme: Most real compromises are identity abuse, not container escapes.
- Tokens auto-mounted widely
- Workloads with over-permissive RBAC exist
-
Initial foothold
- Attacker compromises one pod via app vuln or exposed endpoint.
-
Steal ServiceAccount token
- Read token from the standard mount path.
- Query API server using that token.
-
RBAC reconnaissance
- List permissions: can it list secrets? create pods? patch roles?
-
Privilege escalation Common paths:
- Secrets read → grab higher-priv tokens
- Patch deployment in a privileged namespace → inject malicious container
- Create RoleBinding/ClusterRoleBinding if allowed → self-grant admin
- Impersonate if
impersonatepermissions exist
-
Establish control
- Create a “controller” Deployment/DaemonSet for persistence.
- Add backdoor RBAC binding.
-
Harvest everything
- Cluster secrets, registry creds, cloud IAM creds, TLS keys.
- Total cluster compromise.
- Unusual API calls from a workload identity (especially listing secrets)
- New RoleBinding/ClusterRoleBinding events
- Deployment patches adding host mounts/privileged containers
- New service accounts created in system namespaces
- Disable auto-mount tokens by default; mount only where needed
- Use short-lived projected tokens + audience restrictions
- RBAC least privilege + continuous review
- API audit + alerting on RoleBinding/ClusterRoleBinding changes
Theme: Exposed kubelet APIs have historically been abused; misconfig is common.
- Kubelet read-only port exposed (legacy), or weak kubelet authn/authz settings
- Network access to node kubelet from attacker-controlled workload/network
-
Network discovery
- Scan node IP ranges for kubelet ports.
-
Query kubelet endpoints
- Enumerate running pods, container IDs, sometimes logs/metrics.
-
Extract sensitive data
- Pull env vars, config, potentially tokens (depends on config/endpoints).
-
Remote exec (worst case)
- If exec endpoints are reachable and auth is weak, execute commands in pods.
-
Token theft / lateral movement
- Move to higher privilege pods (CI, ingress, controllers).
- Broad workload compromise without touching API server RBAC.
- Unexpected kubelet endpoint traffic (east-west)
- Exec activity spikes
- Access to kubelet from non-control-plane sources
- Lock down kubelet: proper authn/authz, disable insecure endpoints
- Node firewalling / network segmentation
- Restrict who can reach node ports
Theme: The attacker doesn’t break in — they get deployed.
- Unsigned images allowed
- Mutable tags used (
latest) - Build pipeline or registry access weak
-
Compromise pipeline or registry
- Steal registry creds from CI logs/secrets
- Push a trojan image with same tag
-
Wait for pull
- Auto-deploy pulls
latestor auto-updates.
- Auto-deploy pulls
-
Run malicious init
- Backdoor starts as PID 1 or sidecar.
- Exfil tokens, probe metadata endpoints, scan internal network.
-
Escalate
- Abuse RBAC via stolen token
- Deploy privileged pods if possible
-
Persistence
- Create a hidden Deployment/DaemonSet
- Add cron-like behavior via Kubernetes Jobs
- Cluster compromise at scale (often silent).
- Image digest drift for same tag
- Workloads pulling unexpected registries
- New outbound connections from base images that shouldn’t talk externally
- Use pinned digests, not tags
- Enforce signing/provenance (policy + verification)
- SBOM + admission checks
- Lock down registry permissions
Theme: Shared-kernel reality: if attacker can run code, kernel LPE can become node takeover.
- Attacker has code execution inside container
- Node kernel vulnerable and not patched
- Container not sufficiently constrained (still often workable)
-
Initial foothold
- Obtain shell in container.
-
Kernel version check
- Determine if vulnerable based on kernel build.
-
Exploit local privilege escalation
- Gain elevated privileges on the host kernel context (depends on exploit + mitigations).
-
Post-exploit stabilization
- Ensure persistence (systemd, cron, dropper).
- Harvest kubelet / runtime access.
-
Cluster expansion
- Use node position to steal secrets and pivot.
- Node → cluster compromise.
- Suspicious syscall patterns, exploit-like behavior
- Unexpected writes to sensitive host paths
- New privileged processes on node
- Patch kernels aggressively
- Strong seccomp profiles (reduce exploit primitives)
- Use user namespaces + drop capabilities
- Runtime detection (syscalls/process/file integrity)
Theme: Kubernetes networking is “easy mode” for attackers unless you segment.
- No NetworkPolicy
- Broad pod-to-pod reachability
- Compromise a low-value pod
- Scan internal services
- Databases, metadata endpoints, admin panels, internal APIs
- Exploit internal-only services
- Weak auth because “it’s internal”
- Steal creds / tokens
- Pivot to high-value namespaces
- CI/CD, ingress controllers, secrets managers
- Exfiltrate
- Data, credentials, signing keys
- “One pod” becomes “many services.”
- East-west scanning behavior
- Unusual DNS patterns / connection spikes
- New connections to DB/admin ports
- Default-deny NetworkPolicies + allowlists
- Segmentation by namespace/app identity
- Egress controls where possible
- Most common: token theft + RBAC abuse + privileged pod creation
- Most catastrophic misconfig: runtime socket exposure, privileged + hostPath, wildcard RBAC
- Most overlooked: supply chain (tags, unsigned images), flat networking, kubelet exposure
- Most “CVE-shaped” risk: shared kernel LPE + runtime escape bugs
- Best defenders do: prevention and runtime detection + API audit correlation
“The attacker doesn’t need your zero-day if you give them your
ClusterRoleBinding.”
- A MITRE ATT&CK mapping for each chain
- A detections checklist (Falco-style rules + API audit rules)
- A defense playbook (admission policies + RBAC guardrails + runtime baseline)