Lesson 1 of 9 · 26m
The Container Evidence Model: What Actually Exists
Learn what a container really is on the host, where runtime evidence lives, and why the container abstraction hides evidence rather than destroying it.
The first container case I inherited began with a sentence that still makes me tired: "the container is gone, so the evidence is gone." The container was gone. The evidence was not. A container is not a tiny virtual machine with its own disk and brain. It is Linux namespaces, cgroups, filesystem layers, capabilities, and runtime metadata glued together on a host. Investigate those primitives, not the abstraction.
Start below the orchestrator
Docker, containerd, CRI-O, Kubernetes, and cloud services are control layers. The durable evidence is host-visible:
process table /proc/<pid> and cgroup membership
filesystem overlay upper/lower dirs and bind mounts
runtime metadata inspect output and runtime state
logs stdout/stderr captured by runtime or kubelet
network netns, conntrack, iptables/nftables, eBPF
identity uid/gid, service account tokens, cloud identityWhen someone says a container was deleted, ask which pieces were removed. The writable layer may be gone while image layers, pod logs, volumes, audit events, cloud logs, and flow records survive.
Map the container to host evidence
On Docker hosts:
docker ps -a --no-trunc
docker inspect 4f7c9c... --format '{{json .State}}' | jq
docker inspect 4f7c9c... --format '{{json .Mounts}}' | jqOn Kubernetes nodes, use the CRI endpoint rather than assuming Docker exists:
crictl ps -a
crictl inspect 9c31d... | jq '{info, status}'
crictl logs 9c31d...Socket paths differ: containerd commonly uses /run/containerd/containerd.sock; CRI-O commonly uses /var/run/crio/crio.sock.
The process is the Rosetta stone
Find the host PID and cross namespace boundaries through /proc:
PID=$(crictl inspect 9c31d... | jq -r '.info.pid')
sudo ls -l /proc/$PID/root /proc/$PID/exe /proc/$PID/fd
sudo cat /proc/$PID/cgroup /proc/$PID/mountinfo/proc/<pid>/root is the container filesystem as that process sees it. cwd, exe, environ, and fd can reveal working directories, deleted executables, environment variables, and open files. environ may contain secrets, so capture it only under authorization and handle it accordingly.
Namespaces explain the confusion
PID 1 inside the container is not host PID 1. A path inside the container is not the same host path until resolved through /proc/<pid>/root or mount metadata. nsenter can help controlled inspection:
sudo nsenter -t $PID -m -n -p -u -i shBut entering a namespace is interaction, not preservation. Every command can alter access times, shell history, process state, or the artifact you came to collect.
Field notes
docker inspectandcrictl inspectare metadata, not proof of file contents.- A stopped container often retains its writable layer; a removed container usually does not.
- Pods can contain init containers, sidecars, and multiple restarts. Do not assume one pod means one container.
- Record collection commands and timestamps. Your investigation is part of the timeline.
Was this lesson helpful?