Other Articles
- Cloud SQL – Configure Private IP
- Cloud SQL – Monitor CPU Utilization
- Cloud SQL – Enable Deletion Protection
- Cloud SQL – Enable Disk Encryption
- Cloud SQL – Enable Automated Backups
- Cloud SQL – Enable Log Export
- Cloud SQL – Enforce Password Validation
- Cloud SQL – Protect From Internet Access
- Cloud SQL – Enforce Secure Transport
- Compute Engine – Block Project-Wide SSH Keys
- Compute Engine – Disable IP Forwarding
- Compute Engine – Disable Public IP Addresses
- Compute Engine – Disable Serial Port Access
- Compute Engine – Enable Confidential Computing
- Compute Engine – Enable OS Login
- Compute Engine – Enable Shielded VM
- Compute Engine – Restrict Default Service Account
- General – Deny Public Access to KMS Keys
- General – Enforce Duties Separation
- General – Enforce KMS Key Rotation
- General – Restrict Admin Roles on Service Accounts
- Cloud Run – Configure Timeout Settings
- Cloud Storage – Enable Bucket Encryption
- Cloud Storage – Enable Bucket Logging
- Cloud Storage – Enable Bucket Versioning
- Cloud Storage – Enforce Uniform Bucket-Level Access
- Cloud Storage – Restrict Public Access
- IAM Users – Enforce GCP-Managed Keys
- IAM Users – Rotate External User-Managed Service Account Keys
- GKE – Enable Private Nodes
- GKE – Restrict Control Plane Access
- GKE – Enable Workload Identity
- GKE – Disable Legacy ABAC
- GKE – Enable Shielded Nodes
- GKE – Enable Node Auto-Upgrade and Auto-Repair
- GKE Cluster – Enable Cluster Logging
- General – Enable Cloud Audit Logs
- General – Configure a Log Sink
- General – Configure Log Bucket Retention
- Cloud SQL – Enable High Availability
- Cloud SQL – Configure Maintenance Window
- Cloud Storage – Configure Bucket Retention or Lifecycle
- General – Enable Security Command Center
- Compute Engine – Enable Instance Deletion Protection
- VPC Firewall – Restrict Public SSH and RDP Access
- VPC Firewall – Restrict Public Database Access
- VPC Network – Avoid the Default Network
- VPC Network – Enable Subnet Flow Logs
GKE – Enable Network Policy
Secure Configuration Checks > GCP
This check ensures that Google Kubernetes Engine (GKE) clusters enforce Kubernetes network policies through either the Calico network policy add-on or GKE Dataplane V2. Network policies control communication between pods and help isolate workloads within a cluster. Policies take effect only when a supported network plugin enforces them.
Check Details
- Resource: GKE Cluster
- Check: Enable network policy
- Risk: Without network policy enforcement, workloads can communicate with other pods without network-policy restrictions. If a workload is compromised, an attacker may use this unrestricted communication to move laterally within the cluster and access other services.
Remediation via Google Cloud Console
-
Log in to the Google Cloud Console and navigate to
Kubernetes Engine > Clusters.
- Click the affected GKE Standard cluster.
-
Under Cluster Networking, locate
Calico Kubernetes Network Policy and click
Edit network policy.
-
Select Enable Calico Kubernetes network policy for control plane
and click Save changes.
- Wait for the control-plane setting to finish updating. Then return to the same setting and click Edit network policy again.
- Select Enable Calico Kubernetes network policy for nodes and click Save changes.
- Wait for the node updates to complete. GKE recreates the nodes to apply network policy enforcement.
Note: These steps apply to Standard clusters using Calico. If the cluster uses GKE Dataplane V2, network policy enforcement is already built in, so you do not need to enable the Calico network policy add-on. Autopilot clusters use Dataplane V2.
Remediation via Google Cloud CLI
-
Open the Google Cloud Console and launch
Cloud Shell.
-
List the GKE clusters that enforce neither the network policy add-on nor Dataplane V2:
gcloud container clusters list --format=json | jq -r '.[] | select((.networkPolicy.enabled // false) | not) | select((.networkConfig.datapathProvider // "") != "ADVANCED_DATAPATH") | [.name, .location] | @tsv'
-
Turn on the network policy add-on for the control plane:
gcloud container clusters update <CLUSTER_NAME> \ --location <LOCATION> \ --update-addons=NetworkPolicy=ENABLED
-
Enforce network policy on the nodes:
gcloud container clusters update <CLUSTER_NAME> \ --location <LOCATION> \ --enable-network-policy
-
Or, create a new cluster with Dataplane V2, which enforces network policies without the add-on:
gcloud container clusters create <NEW_CLUSTER_NAME> \ --location <LOCATION> \ --enable-ip-alias \ --enable-dataplane-v2
-
Verify the settings:
gcloud container clusters describe <CLUSTER_NAME> \ --location <LOCATION> \ --format="yaml(networkPolicy,networkConfig.datapathProvider)"
Replace
<CLUSTER_NAME>with the name of your GKE cluster,<LOCATION>with its region or zone, and<NEW_CLUSTER_NAME>with a name for the new cluster. The output must shownetworkPolicyas enabled, ordatapathProviderasADVANCED_DATAPATH. Dataplane V2 is normally chosen when a cluster is created, so for an existing cluster that needs it, create a new one and move your workloads. Turning on the add-on uses extra resources on the nodes and recreates them in a rolling update. Enforcement alone does not block any traffic. Traffic is restricted only when you createNetworkPolicyobjects, so test your policies in a non-production namespace first.
Default Value
GKE Autopilot clusters use Dataplane V2, which provides network policy enforcement by default. Standard clusters can use either the Calico network policy add-on or Dataplane V2. Network policy enforcement must be enabled for policies to take effect.
Updated on 09 November, 2026