Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Docker container forensics recovers evidence from workloads that may live for minutes, using the host filesystem layers, daemon metadata, and runtime telemetry rather than a conventional disk image.

What Is Docker Container Forensics?
Containers break the assumption that forensics starts with a machine. A container may have existed for ninety seconds, written nothing to persistent storage, and been replaced by an identical replica before anyone looked at the alert. Docker container forensics is the practice of recovering evidence anyway, mostly from the host that ran the workload and from telemetry collected while it was alive.
Docker’s state lives under /var/lib/docker. The overlay2 directory holds image layers and, for each running container, a writable upper layer containing every file the process created or modified since start. That upper layer is the closest equivalent to a disk image and is frequently where a dropped miner, a web shell, or a staged archive is found. Alongside it, containers/<id>/config.v2.json and hostconfig.json record the command line, environment variables, mounted volumes, network settings, and privilege flags, and <id>-json.log holds the captured stdout and stderr of the process.
Those files answer the questions clients ask first: was this container privileged, what was mounted into it from the host, and what did it print while it ran. A container started with the Docker socket mounted, or with --privileged, turns a single compromised workload into host compromise, which is the mechanism behind most container escapes.
Order matters, because every action risks losing state.
docker rm destroys the writable layer outright.docker inspect, the process list, open network connections, and the output of docker diff, which lists every filesystem change against the base image.docker commit to produce an image you can export and hash.The thing that makes containers hard also makes them revealing. Because an image is fixed at build time, any file in the writable layer is by definition a change made at runtime, and in a well-built image there should be almost none. Comparing the running container against its declared image gives a clean signal that a traditional server, with years of accumulated drift, never provides.
That is why provenance matters so much. Pull the original image from the registry, verify the digest, and compare layer by layer — the technique behind container image layer analysis. If the compromise was baked into the image rather than introduced at runtime, every replica is affected and restarting the workload changes nothing.
For ephemeral workloads the decisive evidence is usually collected before the incident, not after it. Falco, Tetragon, and similar eBPF-based tools record process execution, file writes, and network activity per container and ship it off the host immediately. Without something in that class, a container that ran for two minutes three days ago leaves you with the daemon log and little else.
Where Docker is orchestrated, the control plane carries its own trail — see Kubernetes incident analysis for the audit log layer, and cloud forensics for the managed services underneath.
Set a container log retention policy and forward logs off the node. Enable runtime security monitoring in at least detect mode. Record image digests in your deployment pipeline so you can prove what was running. Define who may isolate a production pod and on what authority, since the instinct to restart a misbehaving workload destroys evidence in seconds. At Privia Security, we review exactly those readiness questions as part of our cloud security services.
Not in the conventional sense, but you can preserve the equivalent. Copy the container’s writable overlay layer from the host, or use docker commit to create an image you can export and hash. Combine that with host memory capture, the daemon metadata files, and the container log. The base image itself is immutable and can be pulled again from the registry by digest.
Removing a container deletes its writable layer and its JSON log, so the file changes made at runtime are gone. Stopping it preserves those files but loses process memory. Isolate the container at the network level instead, capture memory from the host first, then preserve the filesystem layer before anyone cleans up.
No. Containers are processes on the host kernel with namespace and cgroup isolation, so their memory resides in host RAM. A standard host memory capture includes it, and a memory analysis framework can attribute regions to the relevant processes. This is one of the few areas where container forensics is simpler than virtual machine forensics.
Compare the running container with its source image. Pull the image by digest from the registry and diff its layers against the writable layer on the host. Changes in the writable layer indicate runtime compromise affecting that instance; malicious content inside the image layers means every deployment from that image is affected and redeploying fixes nothing.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.