Skip to main content

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

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. 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.
  2. 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/v1 NetworkPolicy.
      • Any feature flags or modes required to enable policy enforcement.
    • 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.
  3. Verify NetworkPolicy CRD and usage in the cluster
    • Run on: any machine with kubectl access
    • Commands:
    • Review:
      • Confirm networkpolicies (group networking.k8s.io) are available.
      • Note whether any NetworkPolicies are currently defined and in which namespaces.
  4. 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:
  5. 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).
    • 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.
  6. 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.
Problem indication:
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.

Problem indication:
  • Output is: No resources found for 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.

Problem indication (NetworkPolicy behavior test):
  • If the request from client to backend still succeeds after the deny-backend-ingress policy is applied (i.e., wget returns the Nginx HTML response instead of failing/timeouts), this strongly suggests:
    • The current CNI does not implement Kubernetes NetworkPolicy, or
    • It is misconfigured/disabled.
If wget fails/blocks after the policy is applied, the CNI is at least enforcing basic ingress NetworkPolicies.
You must now manually decide, based on:
  • Which CNI you discovered in step 1 and its documentation, and
  • Whether NetworkPolicy behavior in step 3 matched expectations,
whether to keep the current CNI, replace it with one that supports NetworkPolicies, or implement an alternate traffic restriction mechanism. kubectl cannot make that decision automatically.

Additional Reading: