> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-kubernetes-engine-clusters-have-legacy-compute-engine-metadata-endpoints-enabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP Kubernetes Engine Clusters have legacy compute engine metadata endpoints enabled

### Synopsis

| Field               | Value                                                                                |
| ------------------- | ------------------------------------------------------------------------------------ |
| Rule Type           | Detection                                                                            |
| Finding Type        | GCP Kubernetes Engine Clusters have legacy compute engine metadata endpoints enabled |
| Finding ID          | 60000260                                                                             |
| Generates a Finding | This detection rule also generates a finding                                         |
| Severity            | Medium                                                                               |
| Category            | CONFIGURATION                                                                        |
| Cloud Providers     | GCP                                                                                  |
| Platform Module     | CSPM                                                                                 |
| Asset Types         | GOOGLE\_KUBERNETES\_ENGINE\_CONTAINER\_CLUSTER                                       |

### Description

Google Kubernetes Engine (GKE) clusters with legacy compute engine metadata endpoints enabled pose a significant security risk. These legacy endpoints expose sensitive instance metadata, potentially revealing credentials or configuration details accessible to workloads within the cluster.

GKE utilizes instance metadata for node VM configuration. Legacy APIs, unlike the more secure v1 APIs, offer broader access to this metadata. An attacker exploiting this misconfiguration could gain unauthorized access to sensitive information, leading to data breaches, privilege escalation, or lateral movement within the cloud environment.

The impact of this misconfiguration could be severe, ranging from data leaks to complete compromise of the GKE cluster. Disabling legacy APIs and using v1 APIs restricts access to sensitive information, limiting the potential attack surface and enhancing the overall security posture. This is a critical security best practice.

To mitigate this risk, ensure all GKE clusters disable legacy compute engine metadata endpoints. Implement and enforce a policy requiring the use of the v1 metadata API for all GKE deployments. Regularly audit GKE clusters to identify and remediate any instances where this misconfiguration exists.

### Remediation

You can currently disable legacy metadata APIs only when creating a new cluster, or when adding a new node pool to an existing cluster. To fix this alert, create a new GKE cluster with legacy metadata APIs disabled, migrate all required data from the reported cluster to the newly created cluster before you delete the reported GKE cluster.

To create new Kubernetes engine cluster with private node feature enabled, perform the following:

1. Login to GCP Portal
2. Go to Kubernetes Engine (Left Panel)
3. Select Kubernetes clusters
4. Click on CREATE CLUSTER button
5. Under the Node pools section, Click on the 'More node pool options' button
6. On 'Edit node pool' window, For 'GCE instance metadata' click on 'Add metadata'
7. Add 'disable-legacy-endpoints' as a metadata key and 'true' as a metadata value
8. Click on 'Save'
9. Click on 'Create'

To delete reported Kubernetes engine cluster, perform the following:

1. Login to GCP Portal
2. Go to Kubernetes Engine (Left Panel)
3. Select Kubernetes clusters
4. Click on reported Kubernetes cluster
5. Click on the DELETE button
6. On 'Delete a cluster' popup dialog, Click on DELETE to confirm the deletion of the cluster.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-kubernetes-engine-clusters-have-legacy-compute-engine-metadata-endpoints-enabled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
