GCP Professional Cloud Security Engineer Practice Question
Your security team discovered that a third-party component in one of your Compute Engine VMs can be tricked into making arbitrary HTTP requests (a potential SSRF vector). The application still needs to retrieve instance identity tokens from the metadata server for workload identity federation. Which control most effectively reduces the risk of an attacker exfiltrating the token without breaking the application's legitimate calls?
Delete the VM's default service account so that no OAuth tokens are ever issued by the metadata server.
Enable the project metadata key "block-project-ssh-keys" to prevent automatic SSH key injection into the VM.
Create an egress VPC firewall rule denying all traffic to 169.254.169.254 from the VM subnet.
Set the project metadata key "disable-legacy-endpoints" to "true" so that only the v1 metadata path requiring the Metadata-Flavor header remains reachable.
Setting the project-wide metadata key "disable-legacy-endpoints" to "true" disables the older metadata paths /0.1/ and /v1beta1/. These legacy endpoints do not require the "Metadata-Flavor: Google" request header, making them vulnerable to simple SSRF attempts. When they are disabled, only the /v1/ endpoint remains accessible, and every request must include the special header, which typical blind SSRF payloads cannot add. Removing a service account, blocking project SSH keys, or creating a VPC firewall rule do not protect the metadata server because tokens can still be fetched via the unauthenticated legacy paths or, in the case of firewall rules, because traffic to 169.254.169.254 never leaves the VM and is therefore not subject to VPC firewall enforcement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is SSRF and why is it a security risk?
Open an interactive chat with Bash
What is the purpose of the 'Metadata-Flavor: Google' header in the context of Google Cloud Platform?
Open an interactive chat with Bash
Why won’t VPC firewall rules stop access to the metadata server at 169.254.169.254?
Open an interactive chat with Bash
What is SSRF and why is it a security concern?
Open an interactive chat with Bash
What is the Metadata Flavor header and why is it important?
Open an interactive chat with Bash
How does disabling legacy metadata endpoints improve VM security?
Open an interactive chat with Bash
GCP Professional Cloud Security Engineer
Ensuring data protection
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .