No Kubernetes Network Policies
The cluster has no network policies, so every pod can connect to every other pod and service, and to external networks, without restriction.
| Severity | Medium |
| CVSS 3.1 | 4.6 CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N Open in the calculator |
| CVSS 4.0 | 5.1 CVSS:4.0/AV:A/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-653: Improper Isolation or Compartmentalization |
| OWASP Top 10 | A06:2025 Insecure Design |
| MITRE ATT&CK | T1046 Network Service Discovery, T1210 Exploitation of Remote Services, T1552.005 Cloud Instance Metadata API |
| Category | Security Misconfiguration |
Description
By default, Kubernetes allows all network traffic between pods, across all namespaces, and from pods to any destination the node can reach. NetworkPolicy resources restrict this by selecting pods and defining which incoming and outgoing connections they accept, but only where the cluster's network plugin enforces them; creating a policy has no effect on a plugin that does not.
The weakness arises when no policies are defined, or when policies cover only a few workloads, since pods that no policy selects remain open in both directions. Network policies do not prevent the first compromise, but their absence lets it spread: an attacker who compromises one pod, for example through an application vulnerability, can reach every other workload in the cluster, including databases, internal APIs and administrative interfaces assumed to be internal, as well as the kubelet on each node and, in cloud clusters, often the instance metadata service and the credentials it issues. Unrestricted egress also lets them download tools and send data out.
A default deny policy in each namespace is therefore the usual starting point. The weakness is identified by listing policies with kubectl get networkpolicies -A, checking which namespaces have none, and testing from a pod whether services in other namespaces, the nodes, the cloud instance metadata service and the internet can be reached.
Remediation
- Confirm that the cluster's network plugin enforces NetworkPolicy, and move to one that does if not.
- Apply a default deny policy for ingress and egress in every application namespace, then add policies that allow only the connections each workload needs, selected by pod and namespace labels.
- When restricting egress, allow DNS lookups to the cluster DNS service, and block the cloud instance metadata address (169.254.169.254) for pods that do not need it.
- Limit egress to the internet to the destinations each workload needs, through an egress gateway or proxy where possible.
Confirm the fix by repeating the connection tests from a pod in each namespace and checking that only the intended connections succeed.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.