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.
More on Security Services and Data Protection
What is a minimal security services baseline for every account?BeginnerHow do you roll out GuardDuty across an organization and what protections do you turn on?IntermediateHow do you handle the flood of findings from GuardDuty and Security Hub?AdvancedWhat does Security Hub add on top of GuardDuty?BeginnerHow do you automate remediation of security findings?AdvancedHow do you design a KMS key strategy?Advanced