Skip to main content

More Info:

Network Policies are only enforced when the clusters CNI plugin supports them. Enabling Network Policy in GKE updates the CNI to a policy-capable plugin.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. Confirm GKE Network Policy feature status (per cluster)
    • On any machine with gcloud and kubectl access, run:
    • If networkPolicy.enabled is true and a provider is shown (e.g. CALICO), the control plane is configured for Network Policy–capable CNI. If false or empty, Network Policy is not enabled.
  2. Check that NetworkPolicy objects exist and are being used
    • On any machine with kubectl access:
    • If there are no NetworkPolicy objects but you expect network isolation, plan to create them; if there are many, note key namespaces/workloads that rely on them.
  3. Validate that policies are enforced as expected (functional test)
    • Create a temporary test namespace and pods:
    • From allowed-client, verify it can reach the server before any policy:
  4. Apply a restrictive NetworkPolicy and observe behavior
    • Apply a policy that should block the above traffic:
    • Test connectivity again; it should now fail:
    • If traffic still succeeds, your CNI is not enforcing NetworkPolicies (or another plugin/feature is overriding behavior).
  5. If Network Policy is not enabled or not enforced, update cluster configuration
    • Decide cluster-by-cluster whether you require NetworkPolicy enforcement. For clusters where you do:
      • Use GKE Console: Edit the cluster → enable “Network Policy” → save (this may trigger node pool recreation/rolling updates).
      • Or via CLI on any machine with gcloud:
    • Plan maintenance windows as this can recreate nodes and briefly disrupt workloads.
  6. Re-verify after changes
    • After the update completes, repeat steps 1–4 to confirm:
      • networkPolicy.enabled is true with a supported provider.
      • The functional test shows traffic is allowed without policy and blocked with policy.
    • Clean up the test namespace when done:
Review points:
  • If you expect NetworkPolicies to be used and this returns no resources found, then NetworkPolicy is not being used; this may indicate a gap in your design, not in the CNI itself.
Review points:
  • Ensure policies target pods that actually exist (selectors match current pod labels).
  • Check kubectl describe for any events or warnings suggesting policies are not applied as expected.
Expected:
  • You should see an entry like:
    • networkpolicies networking.k8s.io/v1 true NetworkPolicy
  • If there is no line for networkpolicies, the cluster is misconfigured or very old; NetworkPolicy cannot work regardless of CNI.
Review points:
  • For gcloud container clusters list, look at:
    • networkPolicy.networkPolicyConfig.disabled
      • false → Network Policy is enabled at the GKE control-plane level.
      • true or empty → Network Policy is not enabled; even if NetworkPolicy objects exist, they will not be enforced by the CNI.
  • networkConfig.datapathProvider:
    • ADVANCED_DATAPATH or an equivalent policy-capable provider is expected when Network Policy is enabled.
    • If Network Policy is disabled and you rely on it for isolation, this is a problem.
Review points:
  • If NetworkPolicy is supported and enforced, you should see:
    • Connections that were previously succeeding now failing after the policy is applied, consistent with the policy rules.
  • If connections continue to succeed despite a clearly restrictive policy, that strongly suggests:
    • The CNI in use is not enforcing NetworkPolicies, or
    • Network Policy is not enabled at the GKE cluster level.
Finding interpretation:
  • Problem indicated when:
    • GKE cluster Network Policy is disabled, yet you rely on NetworkPolicies for pod isolation, or
    • Runtime tests show NetworkPolicies have no effect on traffic, despite being created and recognized by the API.