More Info:
Without NetworkPolicy objects, all pods can communicate freely, enabling lateral movement. Install a NetworkPolicy-capable provider such as Calico and define policies for every namespace.Risk Level
HighAddress
SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Confirm current CNI and NetworkPolicy support
- On any machine with kubectl access:
- Review CNI pods (e.g.,
flannel,calico-node,cilium-...). If only flannel (or another non–NetworkPolicy-capable CNI) is present, plan to deploy a NetworkPolicy-capable provider (for example, Calico in “Calico + flannel” mode) following its official documentation before proceeding with policy design.
- On any machine with kubectl access:
-
Inventory namespaces and existing NetworkPolicies
- On any machine with kubectl access:
- Identify namespaces without any NetworkPolicy:
- List all namespaces where the count is
0; these are in scope for remediation.
- On any machine with kubectl access:
-
Classify each namespace’s intended traffic model
- For each namespace (especially those with
0policies), gather workload info: - With the application owners, decide for each namespace:
- Which external CIDRs or namespaces may reach its pods (ingress).
- Which destinations (namespaces, services, or CIDRs) its pods must contact (egress).
- Whether intra-namespace pod-to-pod traffic should be allowed by default or restricted.
- For each namespace (especially those with
-
Design and apply baseline NetworkPolicies per namespace
- For each namespace lacking policies, create at least a minimal, reviewed policy manifest. Examples to adapt (save and edit before applying):
- Default deny all ingress/egress (tightest posture):
- Allow intra-namespace traffic but deny cross-namespace by default:
- Default deny all ingress/egress (tightest posture):
- Apply with kubectl from any machine with kubectl access:
- Add additional, narrower policies (per app labels) as needed to explicitly permit required ingress/egress.
- For each namespace lacking policies, create at least a minimal, reviewed policy manifest. Examples to adapt (save and edit before applying):
-
Functionally validate impact with test pods
- In at least one hardened namespace, run a temporary debug pod:
- From that pod, test expected/blocked connectivity (adjust hostnames/IPs):
- Confirm results align with the designed policy (required paths work, disallowed paths fail). Adjust NetworkPolicies iteratively if necessary.
- In at least one hardened namespace, run a temporary debug pod:
-
Re-verify cluster-wide compliance
- After policies are in place and validated, re-run evidence collection from any kubectl-capable machine:
- Confirm every non-system namespace has at least one intentional, documented NetworkPolicy and that a NetworkPolicy-capable CNI is deployed and healthy.
- After policies are in place and validated, re-run evidence collection from any kubectl-capable machine:
Using kubectl
Using kubectl
Using kubectl
Run these commands from any machine withkubectl access.- List all namespaces and see which have zero NetworkPolicies:
0 means there is no NetworkPolicy at all in that namespace, so pod-to-pod traffic there is completely unrestricted at the Kubernetes layer.- View namespaces with and without NetworkPolicies in a more visual way:
No resources found in <namespace> namespace.→ that namespace has no NetworkPolicies.- Namespaces that only have very permissive policies (for example, a policy that selects all pods and allows all ingress and egress from/to all namespaces/CIDRs) may be effectively equivalent to having no policy and should be reviewed by a human.
- Check which CNI plugin is running on the nodes (to confirm NetworkPolicy support):
- If you only see
flannel-related pods (for example,kube-flannel-ds-*) and no NetworkPolicy-capable CNI such ascalico,cilium,antrea,weave-net, etc., then NetworkPolicy objects will not be enforced even if they exist.
- Inspect the details of existing NetworkPolicies in a specific namespace (replace
NAMESPACEas needed):
- Policies that have
podSelector: {}and allow all ingress/egress from everywhere (e.g.,from: []orto: []or broadipBlockranges) can indicate a configuration that does not meaningfully restrict traffic and should be assessed manually.
Automation
Automation

