More Info:
The CNI plugin must support NetworkPolicy resources for traffic segmentation to be enforceable. Use a CNI plugin that supports network policies and follow least-privilege network design.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Confirm the CNI plugin and its NetworkPolicy support
- Run on: any machine with kubectl access
- Commands:
- Review:
- Identify the CNI in use (e.g., Calico, Cilium, Antrea) from pod/DaemonSet names.
- Cross-check its documentation to confirm it supports Kubernetes
NetworkPolicy(and whether it supports both ingress and egress).
-
Check whether NetworkPolicy objects are in use at all
- Run on: any machine with kubectl access
- Commands:
- Review:
- If no
NetworkPolicyresources exist, the cluster currently has no enforced traffic segmentation. You must design and deploy policies (starting with least-privilege) once you confirm the CNI supports them.
- If no
-
Identify namespaces lacking a default restrictive policy
- Run on: any machine with kubectl access
- Commands:
- Review for each namespace:
- Check whether there is at least one “default deny” style policy that selects all pods and denies all ingress and (if supported) egress by default. Typical patterns:
- PodSelector is empty (
podSelector: {}) to match all pods. - No
ingresssection, orpolicyTypesincludesIngressbut no allowed peers. - For egress control,
policyTypesincludesEgressand either noegressrules or only narrowly scoped destinations.
- PodSelector is empty (
- Check whether there is at least one “default deny” style policy that selects all pods and denies all ingress and (if supported) egress by default. Typical patterns:
-
Assess current policies against least-privilege
- Run on: any machine with kubectl access
- Commands:
- Review
/tmp/all-networkpolicies.yaml:- Look for broad rules such as:
podSelector: {}combined withingressfrom all sources oregressto0.0.0.0/0.namespaceSelector: {}without additional constraints.
- Determine whether each policy exists to explicitly allow necessary traffic given a default-deny stance, or if it unintentionally creates wide-open access.
- Look for broad rules such as:
-
Design and apply least-privilege “default deny” and scoped allow policies
- Run on: any machine with kubectl access
- For a namespace missing default-deny, create a manifest like:
- Apply:
- Then, iteratively define additional
NetworkPolicymanifests that:- Select only the pods that must communicate.
- Allow only specific ingress sources and/or egress destinations and ports required for application function.
-
Verify enforcement and adjust as needed
- Run on: any machine with kubectl access
- Commands:
- Optional functional check:
- Use test pods (e.g.,
kubectl run -it --rm test --image=busybox --restart=Never -- sh) to attempt connections that should be blocked or allowed, confirming the CNI is enforcingNetworkPolicyas designed. Adjust policies if legitimate traffic is unintentionally denied.
- Use test pods (e.g.,
Using kubectl
Using kubectl
calico-*, cilium-*, azure-cni-*, aws-node, weave-net, antrea-*, etc.Investigate the documented capabilities of the detected CNI. If it does not explicitly support Kubernetes NetworkPolicy (or you see only a basic CNI like
flannel without policy add-ons), network policies will not be enforced.No resources found (or very few policies in only one namespace), then there is likely no meaningful segmentation. This is a policy gap even if the CNI supports NetworkPolicy.- No “default deny” style policy (e.g. policies that select many/all pods and deny all ingress/egress by default).
- Policies only allow traffic but never restrict it (no baseline deny).
podSelector: {}with overly broadingress/egressrules that effectively allow all.
default or other application namespaces have no NetworkPolicy objects at all, pods there can communicate freely with each other and, often, with the internet. That conflicts with a least-privilege design.- The CNI plugin does not enforce NetworkPolicy, or
- The policy is misconfigured (e.g. selectors don’t match pods).
- Whether your current CNI needs to be replaced/upgraded to one that supports NetworkPolicy.
- Where to design and apply deny-all (or global) policies as a baseline and then add narrowly scoped allow rules.
Automation
Automation
- CNI detection only shows plugins known not to enforce NetworkPolicy (e.g., plain flannel, or a cloud CNI without NP support enabled).
No NetworkPolicy resources found in any namespace.for a production cluster.- Sensitive namespaces listed under “Namespaces without any NetworkPolicy defined”.
- No or very few “default deny”-style policies in the heuristic section for critical namespaces.

