Interview Prep/AWS/Security Services and Data Protection

How do you secure IMDS on EC2?

BeginnerProductionSecurity Services and Data Protection
Answer

Require IMDSv2 (session tokens via PUT, which blocks most SSRF-based credential theft) and set the hop limit to 1 for plain EC2, or 2 when containers on the host need IMDS access. Enforce at the account level with aws ec2 modify-instance-metadata-defaults --http-tokens required, in launch templates, and by SCP with ec2:MetadataHttpTokens. Check usage of v1 with the MetadataNoToken CloudWatch metric before enforcing.

aws All AWS questions

More on Security Services and Data Protection