Namespaces without a NetworkPolicy
Kubernetes networking is flat by default: any pod can connect to any other pod in any namespace. A NetworkPolicy restricts that traffic, limiting lateral movement.
Why it matters
After compromising one pod, an attacker's next step is to reach databases and other services; without NetworkPolicies there's nothing in the way.
Default-allow networking means a single vulnerable service exposes everything it can route to.
How to check for it
- kubectl get networkpolicy -A — namespaces with workloads but no policy are default-allow.
- Confirm your CNI (Calico, Cilium, etc.) actually enforces NetworkPolicy.
How to fix it
- Add a default-deny ingress policy per namespace, then allow only the specific flows each service needs.
- Use a CNI that supports NetworkPolicy and test that egress to sensitive services is restricted too.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.
FAQ
- Will a default-deny policy break my apps?
- Only until you add the allow rules they need. Roll it out namespace by namespace and watch for blocked connections.