More Info:
Namespaces without NetworkPolicies allow unrestricted pod-to-pod traffic. Define policies to segment and restrict network flows.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all namespaces and identify those without any NetworkPolicies
- Run on: any machine with kubectl access
- Compare the two lists and note any namespaces that do not appear in the NetworkPolicy list.
-
Confirm traffic requirements for each uncovered namespace
- For each namespace without a NetworkPolicy, gather workload and usage info:
- With application owners, determine:
- Which pods/services must be reachable from outside the namespace (and from where).
- Which pods can talk to which other pods within the namespace.
- Any external (egress) destinations that are required.
-
Decide enforcement strategy per namespace
- For each namespace, choose an approach:
- Strict isolation: deny all ingress/egress by default and explicitly allow required flows.
- Ingress-only control: restrict which sources can reach pods, leave egress open.
- Baseline: start with a “deny-all” + explicit allow for known critical paths, plan to refine later.
- Confirm with stakeholders that introducing NetworkPolicies will not unexpectedly break known traffic paths.
- For each namespace, choose an approach:
-
Draft and apply appropriate NetworkPolicy manifests
- Create one or more YAML files per namespace (examples to adapt, do not apply blindly):
- Baseline deny-all ingress/egress for the namespace:
- Example: allow ingress only from same namespace:
- Apply after review:
-
Validate connectivity and adjust policies
- After applying policies, verify application behavior (health checks, functional tests).
- If needed, iteratively relax or tighten rules (edit YAML, then re-apply):
-
Re-run evidence collection to confirm coverage
- Verify that all namespaces now have at least one NetworkPolicy and that policies match your intent:
- Document which namespaces intentionally have specific NetworkPolicies and any namespaces (if any) that are intentionally left without them, including the risk rationale.
Using kubectl
Using kubectl
kube-system, kube-public, and any application namespaces).- Namespaces that show
0in the count column have no NetworkPolicy objects defined. - Lack of any NetworkPolicy usually indicates unrestricted pod-to-pod traffic within that namespace (and from other namespaces, depending on the CNI behavior), which is what this control wants you to review and likely tighten.
- Even if a namespace has one or more NetworkPolicies, they may not actually restrict traffic (for example, a policy that selects no pods, or allows all ingress/egress).
- Use
describe/-o yamlto review:podSelector: which pods are affected.policyTypes:Ingress,Egress, or both.ingress/egressrules: whether they meaningfully restrict traffic or effectively allow everything.
- Namespaces that have running pods but zero NetworkPolicies are typically the highest priority for review, since they are actively used and currently not segmented by policy.
- Which namespaces require isolation.
- How strict ingress/egress should be for each namespace.
- Whether some namespaces (e.g., certain system namespaces) should intentionally remain more permissive.
Automation
Automation
- Lines starting with
[WARN]in the summary and the list underNamespaces with NO NetworkPoliciesindicate a problem: those namespaces currently have zeroNetworkPolicyobjects and therefore allow unrestricted pod-to-pod traffic by default. - These namespaces require manual review and design of appropriate
NetworkPolicyobjects based on application communication requirements. The script does not and cannot create policies automatically.

