When a Kubernetes cluster is compromised, the damage is rarely visible at first glance. Attackers move laterally, probing microservices, exploiting misconfigurations, and slipping through overly permissive NetworkPolicies. Forensic investigations in Kubernetes are about finding these invisible threads—and pulling them before they tighten.
Kubernetes NetworkPolicies are supposed to be the firewall of your cluster. They define which pods can talk to which, and on what ports. But in many forensic cases, the NetworkPolicies were either missing, overly broad, or misapplied. This gap is often the attacker’s entry point and escape route. Understanding how to spot breaches, trace malicious flows, and lock down workloads is as important as the workloads themselves.
Step One: Snapshots of the Crime Scene
Before changing anything, collect evidence. Pull pod manifests, capture traffic with tools like tcpdump, and store direct copies of etcd state when you can. Every packet and policy matters. If you overwrite logs or redeploy pods without a capture, you’re erasing the footprints you need.
Step Two: Trace and Map Flows
Review your current NetworkPolicies line by line. Identify “allow all” rules first—they are the usual enablers. Then visualize pod-to-pod communication. Seeing actual traffic patterns often reveals pods talking across namespaces or reaching out to external IPs that have no business in your architecture.