Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ec2_launch_template_imdsv2_requiredProvider: AWS
Service:
ec2Severity: HIGH
Categories:
secretsResource type:
AwsEc2LaunchTemplateWhat this check verifies
EC2 launch templates are inspected for Instance Metadata Service configuration. It identifies versions wherehttp_endpoint is enabled and http_tokens is required (IMDSv2 enforced), versions with the metadata service disabled, and versions that allow metadata without requiring tokens.
Risk
Allowing metadata access without IMDSv2 enables SSRF and open proxy paths to query instance metadata, exposing temporary credentials and secrets. Attackers can steal IAM role credentials to access data, modify resources, and pivot within the account, threatening confidentiality and integrity.Recommendation
Enforce IMDSv2 in all launch template versions by setting token use torequired; disable the metadata service when not needed. Apply least privilege to instance roles and use defense in depth (egress filtering, input validation) to reduce SSRF paths. Ensure applications and SDKs are compatible with IMDSv2.
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
References
- https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html#change-metadata-options
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-170
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_launch_template_imdsv2_required. 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