← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux Docker Socket Mount Container Escape Dataset

This hunt uses a simulated container-host dataset (linux_docker_escape_2022-08-19T113000.json) capturing T1611: Escape to Host, where an attacker with access inside one container abuses a mounted /var/run/docker.sock to launch a new, privileged container with the host filesystem bind-mounted, achieving full host root access.

Step 1: Hypothesis Formation

Hypothesis: A process running inside an existing container issues Docker API calls (via a mounted docker.sock) to create and start a new container with --privileged and a host-root bind mount (-v /:/host), then executes a chroot or direct file write to plant a host-level backdoor. Indicators:

Null Hypothesis: A legitimate CI/CD or container-orchestration tool (e.g., a Docker-in-Docker build agent) is intentionally using the mounted socket to build/deploy other containers as designed. Invalidate by confirming the calling container against the approved CI/CD image inventory and checking for a corresponding pipeline run.

Rationale: Mounting the Docker socket into a container is a common but dangerous misconfiguration that is functionally equivalent to giving that container root on the host; this hunt validates monitoring Docker API calls for privileged/host-mount container creation as a detection layer for what is otherwise a fully "legitimate-looking" use of a documented Docker feature.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm the webapp-frontend container - which had docker.sock mounted for an undocumented reason - used it to spin up a privileged container with the host root filesystem mounted, then wrote an SSH authorized key to the host.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-08-19 11:30:05docker-host-04Docker daemon logAPI call from container webapp-frontend-7d9f8 (via mounted socket) to POST /containers/createSocket-Abuse IOC: an application container issuing Docker daemon-management API calls is not normal webapp behavior.
2022-08-19 11:30:06docker-host-04Docker daemon logRequest body: {"Image":"alpine","HostConfig":{"Privileged":true,"Binds":["/:/host"]}}Escape IOC: Privileged: true combined with a full host-root bind mount is the textbook Docker-socket container-escape payload.
2022-08-19 11:30:08docker-host-04Falco alert"Launch Privileged Container" and "Container Run with Sensitive Mount (/ mounted)" fired simultaneouslyIndependent container-runtime security tool corroborates the daemon-log finding in real time.
2022-08-19 11:30:20docker-host-04 (host fs, via new container)auditd (cgroup-enriched)/host/root/.ssh/authorized_keys written, appending an attacker-controlled public keyImpact IOC: this is a direct host-filesystem write from inside a container, made possible only by the /:/host bind mount - full host persistence achieved.
--(image inventory check)webapp-frontend is not on the approved CI/CD build-agent image list; no pipeline run corresponds to this timestampConfirms this is not legitimate Docker-in-Docker build activity.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an application container with an unnecessarily mounted Docker socket was abused to launch a privileged, host-root-mounted container, achieving full host filesystem compromise via a planted SSH key!