Other Articles

GKE – Enable Workload Identity

Secure Configuration Checks > GCP

This check ensures that Workload Identity Federation is enabled for Google Kubernetes Engine (GKE) clusters. With Workload Identity, each workload gets its own identity and only the permissions that it needs, instead of sharing the credentials of the node that it runs on.

Check Details

  • Resource: GKE Cluster
  • Check: Enable Workload Identity
  • Risk: If workloads use node credentials, every pod on a node gets the permissions of the node service account. An attacker who compromises one pod can use these permissions to reach other Google Cloud resources.

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 Security section of the cluster details page, click the Edit icon next to Workload Identity. GKE Workload Identity
  4. Select Enable Workload Identity and click Save changes. GKE Enable Workload Identity
  5. For Standard clusters only: Open the Nodes tab and locate the Node Pools section. Select the node pool that you want to update.
  6. On the node pool details page, click Edit. Under Security, select Enable GKE Metadata Server and click Save.
  7. Repeat the previous two steps for every existing Standard node pool.

Note: Autopilot clusters have Workload Identity Federation enabled by default, so node pool configuration is not required. If the Nodes tab is not available in your console, use the Google Cloud CLI instructions below to update existing Standard node pools.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. List the GKE clusters that do not have Workload Identity enabled:

    gcloud container clusters list \
    --filter="NOT workloadIdentityConfig.workloadPool:*" \
    --format="table(name,location)"
    
  3. Enable Workload Identity on the cluster:

    gcloud container clusters update <CLUSTER_NAME> \
    --location <LOCATION> \
    --workload-pool=<PROJECT_ID>.svc.id.goog
    
  4. Turn on the GKE metadata server for each existing node pool:

    gcloud container node-pools update <NODE_POOL_NAME> \
    --cluster <CLUSTER_NAME> \
    --location <LOCATION> \
    --workload-metadata=GKE_METADATA
    
  5. Verify the settings:

    gcloud container clusters describe <CLUSTER_NAME> \
    --location <LOCATION> \
    --format="value(workloadIdentityConfig.workloadPool)"
    
    gcloud container node-pools describe <NODE_POOL_NAME> \
    --cluster <CLUSTER_NAME> \
    --location <LOCATION> \
    --format="value(config.workloadMetadataConfig.mode)"
    

    Replace <CLUSTER_NAME> with the name of your GKE cluster, <LOCATION> with its region or zone, <NODE_POOL_NAME> with the name of the node pool, and <PROJECT_ID> with your Google Cloud project ID. The first command must return <PROJECT_ID>.svc.id.goog and the second must return GKE_METADATA. Updating a node pool recreates its nodes in a rolling update. After the change, pods no longer use the node service account. Grant each workload the access it needs by binding its Kubernetes service account to the required IAM roles, and test your applications before you update production.

Default Value

Workload Identity is not enabled on a Standard cluster unless it is turned on. Autopilot clusters have Workload Identity enabled.

Updated on 09 November, 2026