More Info:
There are a variety of CNI plugins available for Kubernetes. If the CNI in use does not support Network Policies it may not be possible to effectively restrict traffic in the cluster.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify the current CNI plugin
- Run on: any machine with kubectl access
- Command:
- Review: Look for CNI-related DaemonSets/Pods (e.g., calico-node, cilium, weave-net, aws-node, azure-cni, antrea, kube-router) to determine which CNI is installed.
-
Determine whether the CNI supports NetworkPolicies
- Using the CNI name from step 1, consult its official documentation to confirm:
- Whether it supports Kubernetes
networking.k8s.io/v1NetworkPolicy. - Any feature flags or modes required to enable policy enforcement.
- Whether it supports Kubernetes
- Evidence:
- Save a short note in your ops documentation (e.g.,
/tmp/cni-networkpolicy-support.txt) recording:- CNI name and version (from Pod image tag).
- URL or doc section stating NetworkPolicy support and any prerequisites.
- Save a short note in your ops documentation (e.g.,
- Using the CNI name from step 1, consult its official documentation to confirm:
-
Verify NetworkPolicy CRD and usage in the cluster
- Run on: any machine with kubectl access
- Commands:
- Review:
- Confirm
networkpolicies(groupnetworking.k8s.io) are available. - Note whether any NetworkPolicies are currently defined and in which namespaces.
- Confirm
-
Test effective policy enforcement (non-disruptive check)
- Run on: any machine with kubectl access
- Apply a temporary restrictive policy in a non-critical namespace (e.g.,
default), then test connectivity: - Review:
- If the CNI enforces policies, the wget should fail (connection refused/timed out).
- If the wget succeeds, NetworkPolicies are not being enforced by the current CNI or are misconfigured.
- Cleanup:
-
Decide remediation approach if NetworkPolicies are unsupported or ineffective
- If documentation or the test indicates no or ineffective NetworkPolicy support:
- Decide whether to:
- Migrate to a CNI that supports NetworkPolicies (e.g., Calico, Cilium, Antrea, etc.), or
- Implement an alternate traffic restriction mechanism (e.g., cloud-provider security groups, service mesh policy, host firewall rules).
- Decide whether to:
- Gather current state to inform migration planning:
- Plan for:
- Maintenance window and rollback.
- CNI-specific migration guide (from vendor docs).
- Impact on existing Pods and IP addressing.
- If documentation or the test indicates no or ineffective NetworkPolicy support:
-
Verify post-remediation behavior
- After migrating CNI or enabling NetworkPolicy features, repeat step 4’s test exactly:
- Confirm:
- NetworkPolicy API is present (step 3).
- Connectivity test fails as expected under a deny-all policy.
- Record results and updated CNI details in your cluster security documentation as proof of remediation.
- After migrating CNI or enabling NetworkPolicy features, repeat step 4’s test exactly:
Using kubectl
Using kubectl
You cannot clearly identify a well-known CNI plugin from
kube-system (e.g., no Calico, Cilium, Weave Net, Antrea, Kube-router, Canal, etc.), or you see a vendor-specific/“custom” CNI that must be checked against its documentation to confirm NetworkPolicy support.- Output is:
No resources foundfor all namespaces, and you believe there should be traffic restrictions; or - Only a few test namespaces use NetworkPolicies while critical namespaces (e.g.,
default,kube-system, app namespaces) have none, suggesting network policy is not actually used for isolation.
- If the request from
clienttobackendstill succeeds after thedeny-backend-ingresspolicy is applied (i.e.,wgetreturns the Nginx HTML response instead of failing/timeouts), this strongly suggests:- The current CNI does not implement Kubernetes
NetworkPolicy, or - It is misconfigured/disabled.
- The current CNI does not implement Kubernetes
wget fails/blocks after the policy is applied, the CNI is at least enforcing basic ingress NetworkPolicies.- Which CNI you discovered in step 1 and its documentation, and
- Whether NetworkPolicy behavior in step 3 matched expectations,
Automation
Automation

