Other Articles

GKE – Restrict Control Plane Access

Secure Configuration Checks > GCP

This check ensures that access to the control plane of a Google Kubernetes Engine (GKE) cluster is restricted. The control plane runs the Kubernetes API server. Access should use a private endpoint, or be limited to authorized networks, so that the API server is not open to the entire internet.

Check Details

  • Resource: GKE Cluster
  • Check: Restrict control plane access
  • Risk: If the control plane is reachable from any IP address, attackers can probe the Kubernetes API, try stolen or guessed credentials, and take control of the cluster and its workloads.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to Kubernetes Engine > Clusters. GKE Clusters
  2. Click the name of the affected GKE cluster.
  3. In the Cluster details tab, locate Control Plane Networking and click the Edit icon. GKE Control Plane Networking
  4. To restrict access through the external IP endpoint, enable Enable authorized networks.
  5. Click Add authorized network. Enter a name and the trusted CIDR range, for example 203.0.113.0/24. Do not add 0.0.0.0/0. GKE Add Authorized Network
  6. Review the control plane endpoint settings. If public IP access is not required, disable access using the control plane's external IP address.
  7. Click Done, then click Save changes to apply the configuration.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. List the GKE clusters that have no private endpoint and no restricted authorized networks:

    gcloud container clusters list --format=json | jq -r '
    .[] 
    | . as $c
    | select(
        ($c.controlPlaneEndpointsConfig.ipEndpointsConfig.enablePublicEndpoint
          // (($c.privateClusterConfig.enablePrivateEndpoint // false) | not))
      )
    | select(
        (($c.controlPlaneEndpointsConfig.ipEndpointsConfig.authorizedNetworksConfig.enabled
           // $c.masterAuthorizedNetworksConfig.enabled // false) | not)
        or
        (($c.controlPlaneEndpointsConfig.ipEndpointsConfig.authorizedNetworksConfig.cidrBlocks
           // $c.masterAuthorizedNetworksConfig.cidrBlocks // [])
           | map(.cidrBlock) | index("0.0.0.0/0")) != null
        or
        ($c.controlPlaneEndpointsConfig.ipEndpointsConfig.authorizedNetworksConfig.gcpPublicCidrsAccessEnabled
           // false)
      )
    | [$c.name, $c.location]
    | @tsv'
    
  3. Limit access to the control plane to your trusted networks:

    gcloud container clusters update <CLUSTER_NAME> \
    --location <LOCATION> \
    --enable-master-authorized-networks \
    --master-authorized-networks <CIDR_1>,<CIDR_2> \
    --no-enable-google-cloud-access
    
  4. Or, to give the control plane a private endpoint only:

    gcloud container clusters update <CLUSTER_NAME> \
    --location <LOCATION> \
    --enable-private-endpoint
    
  5. Verify the settings:

    gcloud container clusters describe <CLUSTER_NAME> \
    --location <LOCATION> \
    --format="yaml(controlPlaneEndpointsConfig)"
    

    Replace <CLUSTER_NAME> with the name of your GKE cluster, <LOCATION> with its region or zone, and <CIDR_1>,<CIDR_2> with your trusted ranges, for example 203.0.113.0/24. Include your own IP address in the list so that you can still manage the cluster. The output must show either a private endpoint, or authorized networks that are enabled and do not include 0.0.0.0/0.

Default Value

By default, the control plane of a GKE cluster has a public endpoint, and authorized networks are not enabled. Access still requires valid credentials, but the API server can be reached from any IP address.

Updated on 09 November, 2026