Skip to main content

More Info:

Running The Gke Metadata Server Prevents Workloads From Accessing Sensitive Instance Metadata And Facilitates Workload Identity

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. List and review current cluster Workload Identity configuration
    • Machine: Any machine with gcloud configured
    • Command:
    • Review: Confirm whether workloadIdentityConfig / workloadPool is set to PROJECT_ID.svc.id.goog. If not set, enabling Workload Identity (and thus defaulting new node pools to use the GKE Metadata Server) is likely required.
  2. Check each node pool’s metadata server configuration
    • Machine: Any machine with gcloud configured
    • Command:
    • Review: For each node pool, confirm mode is GKE_METADATA_SERVER. Any node pool with a different mode (e.g. GCE_METADATA, UNSPECIFIED, or null) does not have the GKE Metadata Server enabled.
  3. Assess application impact and readiness for Workload Identity
    • Machine: Any machine with kubectl and cluster access
    • Commands (evidence gathering):
    • Review:
      • Identify workloads that currently rely on node service account credentials or direct instance metadata access.
      • Determine which workloads will need to be updated to use GCP IAM via Workload Identity (e.g., binding Kubernetes ServiceAccounts to GCP service accounts).
  4. Decide and plan enabling Workload Identity and GKE Metadata Server
    • If the cluster is not using Workload Identity, plan a change window to:
      • Enable Workload Identity at cluster level.
      • Migrate affected workloads to use Kubernetes ServiceAccounts mapped to GCP Service Accounts.
    • If Workload Identity is already enabled but some node pools are not using GKE_METADATA_SERVER, plan to update those node pools, considering any workloads tightly coupled to legacy metadata access patterns.
  5. Enable Workload Identity at the cluster level (if not already enabled)
    • Machine: Any machine with gcloud configured
    • Command:
    • Impact: Control-plane configuration change; does not automatically alter existing node pools, but new node pools will default to --workload-metadata-from-node=GKE_METADATA_SERVER.
  6. Enable GKE Metadata Server on existing node pools and verify
    • Machine: Any machine with gcloud configured
    • Command (per node pool):
    • Verification:
      Confirm all node pools now report "mode": "GKE_METADATA_SERVER".
kubectl cannot enable the GKE Metadata Server or configure Workload Identity, because these settings are managed at the GKE control-plane and node pool level via gcloud/console/IaC, not through Kubernetes API objects. To remediate this finding, follow the guidance in the Manual Steps section using the Google Cloud Console or gcloud commands.

Additional Reading: