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 GKE

Triage and Remediation

Remediation

Manual Steps

  1. From any machine with kubectl access, confirm whether GKE Network Policy is enabled on each cluster (GKE-managed CNI):
    For a specific cluster:
  2. If networkPolicy.enabled is false for the cluster, decide whether you can enable it based on your environment (some settings like specific datapath providers or add‑ons may be incompatible). Review Google’s constraints for enabling Network Policy and plan a maintenance window, as enabling it causes nodes to be recreated.
  3. To enable Network Policy on an existing cluster (triggers node recreation; run from any machine with gcloud access):
    For a new cluster, include Network Policy at creation:
  4. After Network Policy is enabled and the cluster has stabilized, verify that NetworkPolicy resources are accepted by the API (any machine with kubectl):
  5. Optionally validate that Network Policies are actually enforced by deploying a simple test in a non‑production namespace (any machine with kubectl):
  6. Verify behavior of the test policy (any machine with kubectl):
    If Network Policy is enabled and enforced, the first command should fail to connect while the second should succeed. Clean up when finished:
Review the labels for a networking.gke.io or network-policy-related label that reflects Network Policy being enabled on the cluster.
If you see nothing related to network policy at all, that is a red flag and you must confirm via gcloud container clusters describe or the GKE console whether Network Policy is enabled.
  • If this returns No resources found across all namespaces, Network Policies are not currently used.
    This by itself does not prove the CNI is incompatible, but it means your cluster is not actually enforcing any pod-level network restrictions yet.
  • If the object is present and kubectl describe shows no warnings or errors, the API server accepts NetworkPolicy objects.
  • If you see repeated Events or warnings about not being able to enforce the policy, or controller errors referring to network policy, this may indicate CNI/plugin or cluster configuration issues.
Look for pods with names suggesting network policy enforcement (e.g. calico-*, cilium-*, kube-router-*, or a GKE-specific network policy agent).
  • If there are no such pods or DaemonSets and you know Network Policy is supposed to be enabled, verify via GKE settings that the cluster was created with Network Policy enabled so that GKE can install the appropriate components.
  • Repeated errors that mention inability to program rules, unsupported features, or CNI issues indicate that the current CNI or configuration may not correctly support Network Policies and should be reviewed manually.
These kubectl checks surface whether:
  • NetworkPolicy resources are in use and understood by the API, and
  • There is an obvious absence or malfunction of network-policy-related components.
Determining definitively whether the CNI in use supports Network Policies still requires manual review of your GKE cluster configuration (Network Policy feature flag) and the corresponding CNI documentation.

Additional Reading: