iac.htora.dev · security templates

Home/Refreshers/Container forensics: refresher

Container forensics

Where a container keeps its evidence, when each part disappears, and the order to capture it in.

EvidenceGone when
Pod definitionThe pod is deleted
Writable layer and memoryThe container restarts
Logs on the nodeThey rotate, or the pod leaves the node
emptyDir volumesThe pod leaves the node
Image, by digestRarely

In this order

Record the pod and its image digestskubectl get pod <pod> -o json > pod.json
Save logs, current and previouskubectl logs <pod> --all-containers --previous
Keep the nodekubectl annotate node <node> cluster-autoscaler.kubernetes.io/scale-down-disabled=true; kubectl cordon <node>
Snapshot the node's disks, then quarantinekubectl label pod <pod> quarantine=true

Watch out

  • exec and kubectl cp write into the writable layer you are preserving.
  • A checkpoint archive contains every memory page, secrets included.
  • A tag can move to other code. Record the digest.
Check it worked

The pod's definition, logs, and hashes are stored, and the node still exists an hour later.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.