Docker & Containers
DevOps, containers, and the software supply chain: images and registries, CI/CD and npm/dependency attacks, container runtime and escape, and Kubernetes. Evidence here is short-lived and often off by default - preserve it before the container is gone.
Cheat sheet by areaThreat matrixIncident response planHow to analyse images & containersHistorical incidents & TTPs
Cheat sheet by area
Status: Enabled by default Partial / mixed OFF - must enable
| Area | Log source | What it captures | On by default? | How to obtain | Notes |
|---|---|---|---|---|---|
| Workloads & Runtime | Container stdout/stderr (json-file driver) | Application console output captured by the default json-file logging driver | Enabled by default | docker logs <id>; on host /var/lib/docker/containers/<id>/<id>-json.log | Lost when the container is deleted - copy before removal |
| Workloads & Runtime | Docker daemon logs (dockerd / journald) | Daemon-level events: image pulls, container create/start/stop, errors | Partial / mixed | journalctl -u docker; or /var/log/docker.log | Depends on host logging; not application activity |
| Control Plane & Management Activity | Docker events stream | Real-time engine events (create, exec, kill, mount, network) | Partial / mixed | docker events (live) or via the Engine API | Ephemeral - only live unless captured to a sink |
| Workloads & Runtime | Container filesystem changes (docker diff) | Files added/changed/deleted in the container vs its image | Enabled by default | docker diff <id> | Fast triage for attacker-dropped files |
| DevSecOps & Pipelines | Image build history (docker history) | Layer-by-layer build steps and commands baked into the image | Enabled by default | docker history --no-trunc <image>; docker inspect | Reveals entrypoint, added binaries, and secrets in layers |
| DevSecOps & Pipelines | Registry pull/push logs (Docker Hub / ECR / GCR / GAR / Harbor) | Who pulled/pushed which image and tag | Partial / mixed | Enable registry audit; ECR via CloudTrail, GAR via Cloud Audit | Key for image provenance and malicious-image scoping |
| DevSecOps & Pipelines | Image vulnerability & malware scan (Trivy / Grype / Docker Scout) | CVEs, misconfigurations, secrets, and SBOM for an image | OFF - must enable | trivy image <img>; grype <img>; syft <img> for SBOM | Not a log - run on demand during triage |
| Control Plane & Management Activity | Kubernetes API server audit logs | Every K8s API call: exec, pod create, secret access, RBAC changes | OFF - must enable | Enable audit policy on the API server; managed via provider (EKS/AKS/GKE) | The primary control-plane evidence for K8s |
| Control Plane & Management Activity | Kubernetes admission / RBAC events | Admission decisions and role/binding changes | Partial / mixed | Audit logs + admission webhook logs | Catches privileged-pod and hostPath abuse |
| Workloads & Runtime | Runtime threat detection (Falco / Sysdig / Tetragon) | Suspicious syscalls: shell in container, mount, ptrace, escape attempts | OFF - must enable | Deploy Falco/Tetragon DaemonSet | Best signal for container escape and live tradecraft |
| DevSecOps & Pipelines | CI/CD build logs (GitHub Actions / GitLab CI / Jenkins) | Build/deploy job output, dependency installs, injected steps | Partial / mixed | Repo/pipeline settings; enable audit + streaming | Where poisoned-pipeline and dependency attacks show up |
| DevSecOps & Pipelines | Package manager & lockfiles (npm / pip / yarn) | Installed dependencies, versions, and integrity hashes | Partial / mixed | package-lock.json, npm audit, install logs | Diff lockfiles to spot dependency confusion / hijacks |
| Workloads & Runtime | Container memory & process capture | Live process list and memory of a running container | OFF - must enable | nsenter/ps into the namespace; sysdig capture; memory dump | For live analysis before killing the container |
| Network & Connectivity | Container/pod network flows | East-west and egress traffic from containers (C2, exfil, mining pools) | OFF - must enable | CNI flow logs, VPC flow logs, or Falco/Cilium Hubble | Cryptomining and C2 often first seen as egress |
Threat matrix
Container and supply-chain behaviours by area, and the log that first reveals them. Cross-check against the ATT&CK Containers matrix.
| Area | Example adversary behaviours (ATT&CK) | Primary detection source |
|---|---|---|
| Images & registries | T1204.003 Malicious/typosquatted image, T1525 Implant Internal Image | Registry pull/push logs; image scan (Trivy/Grype) |
| Build & supply chain | T1195.002 Compromise Software Supply Chain, T1677 Poisoned Pipeline, T1552.001 Credentials in Files | CI/CD build logs; lockfile diff; secret scan |
| Runtime | T1610 Deploy Container, T1496 Resource Hijacking, T1611 Escape to Host | Falco/Tetragon runtime detection; container/pod network flows |
| Orchestration / control | T1190 Exploit Public-Facing App (exposed API/dashboard), T1552.007 Container API creds | Kubernetes API audit logs; admission controller logs |
| Credentials | T1552.005 Cloud Instance Metadata API, T1078.004 Cloud Accounts | Cloud audit logs; host/container process capture |
Incident response plan
- Preserve volatile state first (order of volatility). Do not kill the container yet - live memory and processes are the first to vanish.
- Freeze and snapshot.
docker pause <id>, thendocker checkpoint create(CRIU - captures RAM) or in Kubernetes the kubelet checkpoint API. - Capture the evidence set.
docker commit(writable layer),docker export(filesystem tar),docker save(image + layers),docker cpfor targeted files. Record sha256 of every artifact. - Grab metadata.
docker inspect,docker diff,docker top, anddocker logsbefore removal. - Establish provenance. Registry pull/push logs and
docker history- which image, which tag, which layers, and where it came from. - Contain. Stop the workload, revoke any credentials it held (cloud metadata, registry, CI tokens), rotate secrets, remove malicious images and pipeline steps, block egress to mining pools / C2.
- Scope the supply chain. Diff lockfiles, review CI/CD run history and injected steps, and check other repos/images the compromised token could publish to.
- Harden. Enable K8s audit logs and a runtime sensor, enforce image signing/admission (only signed, scanned images), drop privileged/hostPath/docker.sock.
How to analyse images & containers
Preserve a running container
docker pause <id> # freeze processes
docker checkpoint create <id> ck1 # CRIU snapshot incl. RAM (container unaware)
docker commit <id> ir-evidence:case123 # snapshot writable layer to an image
docker export <id> > container.tar # flattened filesystem tar
docker save <image> > image.tar # image WITH all layers + manifest
docker cp <id>:/path ./evidence/ # targeted file extraction
sha256sum *.tar > hashes.txt # integrity for chain of custodyInspect an image (static analysis)
docker inspect <image> # entrypoint/cmd, env, mounts, user
docker history --no-trunc <image> # per-layer build commands + baked-in secrets
dive <image> # interactive layer-by-layer diff
trivy image --scanners vuln,secret <image> # CVEs + secrets across layers
syft <image> -o json > sbom.json # SBOM of every package/version
grype sbom:./sbom.json # vulns against NVD/GHSA/OSVLayers never forget
Deleting a file in a later layer (RUN rm secret) does not remove it - it is still recoverable in the earlier layer. Always scan the full history, not just the final image.Runtime & escape analysis
docker top <id> # process list
nsenter -t <pid> -a ; ls /proc/<pid>/ # enter namespaces; cmdline, environ, fd, maps
# Runtime detection: deploy Falco / Tetragon for syscalls (shell-in-container, mount, ptrace, escape)
# Escape red flags: --privileged, hostPath mounts of / /proc /etc, mounted /var/run/docker.sock,
# dangerous caps (CAP_SYS_ADMIN, SYS_MODULE, SYS_PTRACE). K8s audit + admission logs record the pod spec.On modern Kubernetes the runtime is usually containerd, not the Docker daemon - the docker CLI and json-file paths may not apply. Use the kubelet checkpoint API and Kubernetes API audit logs instead.
Historical incidents & TTPs
Some entries are intentional maintainer protestware (colors/faker, node-ipc) rather than external compromises, and a few attributions (Shai-Hulud, xz-utils) are suspected but unconfirmed. Treat accordingly.
npm / JavaScript supply chain
event-stream / flatmap-stream2018
A transferred maintainer added a malicious dependency that activated only inside the Copay Bitcoin wallet build to steal wallet keys.
T1195.002T1027T1528ua-parser-js hijack2021
Maintainer npm account takeover pushed versions that ran a preinstall script deploying an XMRig miner and a password stealer.
T1195.002T1078T1496T1059coa / rc hijack2021
Same wave: account-takeover of coa and rc pushed postinstall scripts delivering a DanaBot credential stealer on Windows.
T1195.002T1078T1059T1555tj-actions/changed-files (GitHub Actions)2025
A compromised bot PAT repointed version tags to a malicious commit that dumped CI/CD secrets into workflow logs across ~23,000 repos (CVE-2025-30066).
T1195.002T1552.004T1078s1ngularity / Nx compromise2025
A GitHub Actions injection stole the npm publish token; postinstall malware harvested tokens, SSH keys, and cloud creds - even abusing local AI CLIs for recon - and exfiltrated to attacker repos.
T1195.002T1552T1567T1078.004Shai-Hulud npm worm2025
First self-replicating npm worm: steals developer/cloud/GitHub credentials, then uses stolen npm tokens to auto-republish itself into other packages. CISA alert issued; attribution unconfirmed.
T1195.002T1552T1078Other package ecosystems & dependency confusion
Dependency confusion (Alex Birsan)2021
Public packages named after companies internal private packages, at higher versions, were preferred by package managers - RCE inside 35+ major companies (authorized research).
T1195.002PyTorch torchtriton2022
A malicious torchtriton on public PyPI shadowed PyTorch nightly; installs exfiltrated /etc/passwd, SSH keys, and .gitconfig.
T1195.002T1552.001T1041Ultralytics PyPI compromise2024
A GitHub Actions script-injection obtained the PyPI token; trojanized releases deployed an XMRig miner.
T1195.002T1496T1078xz-utils / liblzma backdoor2024
A multi-year social-engineering op inserted an obfuscated backdoor into xz 5.6.0/5.6.1 that hooked sshd for RCE/auth-bypass (CVE-2024-3094). Caught before wide distro rollout; attribution suspected but unconfirmed.
T1195.002T1554T1556T1027Codecov bash uploader2021
A flaw in Codecov image build let an attacker modify the Bash Uploader to exfiltrate CI environment secrets for ~2 months; ~23,000 customers exposed.
T1195.002T1552.001T1078Containers, Docker & Kubernetes
TeamTNT2019-2021+
Financially-motivated group targeting exposed Docker/Kubernetes APIs; deploys cryptominers and steals AWS/cloud DevOps credentials. MITRE group G0139.
T1610T1204.003T1552.005T1496Kinsing / kdevtmpfsi2020+
Self-propagating campaign scanning for exposed Docker API ports; spins up a container that installs the Kinsing agent and a miner, then harvests SSH keys to spread.
T1610T1190T1496T1021.004Doki / Ngrok botnet2020
Undetected Linux backdoor spread onto exposed Docker servers; derived its C2 domain from the Dogecoin blockchain and escaped to the host.
T1610T1568.002T1611T1090Malicious Docker Hub images2020-2021
~30 Monero-mining images with ~20M pulls hosted on Docker Hub, using Tor/ProxyChains to evade detection.
T1204.003T1525T1496T1090Siloscape2021
First malware targeting Windows Server containers: thread-impersonation escape to the node, then backdoors misconfigured Kubernetes clusters over Tor.
T1611T1610T1078Tesla exposed Kubernetes dashboard2018
An unauthenticated Kubernetes console exposed AWS credentials in a pod; attackers ran stealthy cryptomining behind their own pool and Cloudflare.
T1610T1552.005T1496