More Info:

Disable the legacy GCE instance metadata APIs for GKE nodes. Under some circumstances, these can be used from within a pod to extract the node’s credentials

Risk Level

High

Address

Security, Reliability, Operational Excellence, Performance Efficiency

Compliance Standards

CISGKE

Triage and Remediation

Remediation

To remediate the misconfiguration “Ensure Legacy Compute Engine Instance Metadata APIs Are Disabled” for GCP using GCP console, follow the below steps:

  1. Open the Google Cloud Console and select your project.
  2. Navigate to the Compute Engine page from the left-hand menu.
  3. From the Compute Engine page, select the “Metadata” tab.
  4. Under the “Metadata” tab, click on the “Edit” button.
  5. Scroll down to the “Legacy Metadata Access” section.
  6. Select the “Disallow” option to disable the legacy metadata access.
  7. Click on the “Save” button to save the changes.

Once you have completed these steps, the legacy Compute Engine instance metadata APIs will be disabled, and your GCP environment will be more secure.

Additional Reading: