Check ID: ec2_instance_account_imdsv2_enabled
Provider: AWS
Service: ec2
Severity: HIGH
Categories: secrets
Resource type: AwsEc2Instance

What this check verifies

EC2 account IMDS defaults with http_tokens=required ensure new instances in the Region use IMDSv2 by default and disable IMDSv1. Existing instances keep their current setting.

Risk

Without a default of IMDSv2, new instances may enable IMDSv1, exposing metadata via simple HTTP. SSRF or proxy misconfigs can steal temporary IAM credentials, enabling data exfiltration (confidentiality), unauthorized API changes (integrity), and lateral movement that can disrupt services (availability).

Recommendation

Enforce IMDSv2 at the account level in every Region by setting http_tokens to required. Add guardrails with SCP/IAM conditions. Standardize AMIs and launch templates to require tokens, validate workload compatibility, and apply least privilege to instance roles for defense in depth. For containers, prefer hop limit 2.

Remediation

aws ec2 modify-instance-metadata-defaults —region <region> —http-tokens required

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = ec2_instance_account_imdsv2_enabled. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks