Ensure that GKE Metadata Server is enabled for your Google Kubernetes Engine (GKE) cluster nodes in order to enhance security by restricting workload access to sensitive instance information. The GKE Metadata Server feature requires Workload Identity for improved authentication and authorization.
Every Google Kubernetes Engine (GKE) cluster node maintains a metadata server that stores critical information. Some of this data, including sensitive credentials like kubelet credentials and VM instance identity tokens, should remain inaccessible to Kubernetes workloads. Enabling the GKE Metadata Server feature safeguards this sensitive information by preventing pods (not running on the host network) from accessing it. Additionally, it lays the groundwork for Workload Identity, a mechanism that allows pods to assume specific service account roles without relying on traditional service accounts. This streamlined approach enhances security and simplifies authentication, contributing to overall cluster efficiency and security. When the feature is disabled, the GKE cluster node defaults to a less secure configuration, granting running pods unrestricted access to the node's underlying metadata server.
Audit
To determine if GKE Metadata Server is enabled for your Google Kubernetes Engine (GKE) cluster nodes, perform the following operations:
Remediation / Resolution
To enable the GKE Metadata Server feature for your Google Kubernetes Engine (GKE) clusters, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- About VM metadata
- Protecting cluster metadata
- NodeConfig
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud container clusters list
- gcloud container clusters describe
- gcloud container node-pools list
- gcloud container node-pools describe
- gcloud container node-pools update