Problem Statement
What is the main benefit of AWS IMDSv2 compared to IMDSv1?
Explanation
IMDSv2 adds a hop-count aware session token. This reduces basic SSRF and open-proxy abuse. Pair it with egress controls and least-privilege roles.
Code Solution
SolutionRead Only
aws ec2 modify-instance-metadata-options --http-endpoint enabled --http-tokens required --instance-id i-123456
