Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ec2_instance_imdsv2_enabledProvider: AWS
Service:
ec2Severity: HIGH
Categories:
identity-access, secretsResource type:
AwsEc2InstanceWhat this check verifies
EC2 instances are evaluated for IMDSv2 enforcement: metadata endpoint enabled withhttp_tokens: required, or metadata service fully disabled (http_endpoint: disabled).
Risk
Permitting IMDSv1 or optional tokens lets SSRF or compromised workloads retrieve temporary IAM credentials, impacting confidentiality and integrity. Stolen role creds can drive privilege escalation, unauthorized data access, and lateral movement across AWS resources.Recommendation
Apply defense in depth:- Require IMDSv2 tokens on all instances (
http_tokens: required) - Disable metadata where not needed (
http_endpoint: disabled) - Minimize hop limit to
1when feasible - Update SDKs/apps for IMDSv2
- Restrict instance profile permissions (least privilege)
- Block metadata access from untrusted workloads
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
aws ec2 modify-instance-metadata-options —instance-id <instance-id> —http-tokens required —http-endpoint enabled
References
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/EC2/require-imds-v2.html
- https://support.icompaas.com/support/solutions/articles/62000234166-5-7-ensure-that-the-ec2-metadata-service-only-allows-imdsv2-automated-
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html#configuring-instance-metadata-options
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = ec2_instance_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