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.

Credential AccessPlatforms: IaaSATT&CK v20.1 · source modified · View on MITRE ATT&CK

For leadership

Executive takeaway

IMDSv2 should be mandatory; but the real limit on damage is how much the instance role can do.

How it works in AWS

  1. A vulnerable application is induced to request the metadata endpoint (SSRF), or code runs on the host.
  2. Role credentials are returned and copied.
  3. 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

AWS API calls relevant to T1552.005
API / eventWhy it matters
IMDS iam/security-credentialsNot a CloudTrail-logged API; use of the credentials is logged.
ec2:ModifyInstanceMetadataOptionsEnforce IMDSv2 / hop limits.

A risky permission is not an observed attack

Potential exposure

Instances allowing IMDSv1; broad instance roles.

Observed behavior

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

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

Stay in the loop

Cloud security insights, early access & compliance updates

Weekly InsightsEarly AccessExpert Content
No spam, everUnsubscribe anytimeWeekly updates
Chat with Securitain