MITRE ATT&CK technique · T1552.005
Unsecured Credentials: Cloud Instance Metadata API
How are credentials stolen from the EC2 instance metadata service? Adversaries obtain temporary role credentials from the instance metadata service — through SSRF in a web application or code running on the host — and use them outside the instance.
For leadership
Executive takeaway
How it works in AWS
- A vulnerable application is induced to request the metadata endpoint (SSRF), or code runs on the host.
- Role credentials are returned and copied.
- The credentials are used until they expire.
Sub-technique of T1552 Unsecured Credentials.
What the attacker needs
- SSRF or local execution
- IMDSv1 (for many SSRF cases)
Relevant AWS API calls
| API / event | Why it matters |
|---|---|
| IMDS iam/security-credentials | Not a CloudTrail-logged API; use of the credentials is logged. |
| ec2:ModifyInstanceMetadataOptions | Enforce IMDSv2 / hop limits. |
A risky permission is not an observed attack
Instances allowing IMDSv1; broad instance roles.
Instance credentials used outside the instance.
Preventive and limiting controls
- Require IMDSv2
- Least-privilege instance roles
- Egress restrictions for SSRF-prone services
Mapped cloud controls
- preventiveEnforce IMDSv2 and limit metadata reachability
IMDSv2 requires a PUT-issued session token, which defeats many SSRF patterns that can only issue GET requests.
- restrictiveLeast-privilege identity policies
Instance-role permissions determine the blast radius of any metadata credential theft.
- detectiveManaged threat detection across accounts and regions
GuardDuty can flag instance credentials used from outside AWS or from another account.
See assumptions and validation evidence in the Cloud Control Explorer →
Detection signals and telemetry
- Instance credential exfiltration findings — GuardDuty
MITRE detection strategies (official, cloud-relevant analytics)
- DET0001 Detect Access to Cloud Instance Metadata API (IaaS)
- AN0001 (IaaS): Detects access attempts to cloud instance metadata endpoints (e.g., 169.254.169.254) from virtual machines or containerized workloads. This includes both direct access and SSRF exploitation patterns.Log sources: AWS:VPCFlowLogs — Outbound connection to 169.254.169.254 from EC2 workload; AWS:CloudTrail — GetInstanceIdentityDocument; ebpf:syscalls — Process within container accesses link-local address 169.254.169.254
MITRE mitigations
Official MITRE description (excerpt)
Adversaries may attempt to access the Cloud Instance Metadata API to collect credentials and other sensitive data.
Common misconceptions
- “IMDSv2 prevents all credential theft.”
- Local code execution can still read credentials.
Attack scenarios using this technique
Excessive IAM permissions
Sensitive data access through an overprivileged workload role
Container-to-cloud identity exposure
References
MITRE ATT&CK® and ATT&CK® are registered trademarks of The MITRE Corporation. ATT&CK data © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (ATT&CK v20.1). Securitain is not affiliated with or endorsed by MITRE. Explanations, scenarios and control mappings on this page are Securitain’s own analysis. Sources and licensing