AWS IMDSv2
Was ist AWS IMDSv2?
AWS IMDSv2The session-token-based replacement for the AWS EC2 Instance Metadata Service, designed to defeat SSRF-based credential theft of EC2 instance role tokens by requiring a PUT-issued, short-lived token on every request.
IMDSv2 is the second version of the EC2 Instance Metadata Service, introduced in 2019 in direct response to the Capital One breach and other SSRF-driven cloud credential theft attacks. Unlike IMDSv1, where any code on the instance — including a webserver tricked into making a GET to `http://169.254.169.254/latest/meta-data/iam/security-credentials/`— could read the instance role credentials, IMDSv2 requires the client to first issue a PUT to `/latest/api/token` with a TTL header, then include the returned session token on every metadata read. A reflected or server-side request forgery cannot easily issue both calls because the PUT requires a non-default HTTP method and a custom header, and the response is a short-lived token. IMDSv2 also lets administrators set the `HttpPutResponseHopLimit` to 1, blocking containers on the host from reaching the metadata service. As of 2023, new AWS resources and most launch templates default to `HttpTokens: required`; legacy AMIs and infra still permitting IMDSv1 remain a common Wiz/CSPM finding and an active path for cloud token theft.
● Beispiele
- 01
An EC2 launch template sets `HttpTokens: required` and `HttpPutResponseHopLimit: 1`, blocking both IMDSv1 access and container-side metadata theft.
- 02
A CSPM finding flags every EC2 instance still allowing IMDSv1 because the legacy CentOS AMI was launched before the org-wide policy.
● Häufige Fragen
Was ist AWS IMDSv2?
The session-token-based replacement for the AWS EC2 Instance Metadata Service, designed to defeat SSRF-based credential theft of EC2 instance role tokens by requiring a PUT-issued, short-lived token on every request. Es gehört zur Kategorie Cloud-Sicherheit der Cybersicherheit.
Was bedeutet AWS IMDSv2?
The session-token-based replacement for the AWS EC2 Instance Metadata Service, designed to defeat SSRF-based credential theft of EC2 instance role tokens by requiring a PUT-issued, short-lived token on every request.
Wie funktioniert AWS IMDSv2?
IMDSv2 is the second version of the EC2 Instance Metadata Service, introduced in 2019 in direct response to the Capital One breach and other SSRF-driven cloud credential theft attacks. Unlike IMDSv1, where any code on the instance — including a webserver tricked into making a GET to `http://169.254.169.254/latest/meta-data/iam/security-credentials/`— could read the instance role credentials, IMDSv2 requires the client to first issue a PUT to `/latest/api/token` with a TTL header, then include the returned session token on every metadata read. A reflected or server-side request forgery cannot easily issue both calls because the PUT requires a non-default HTTP method and a custom header, and the response is a short-lived token. IMDSv2 also lets administrators set the `HttpPutResponseHopLimit` to 1, blocking containers on the host from reaching the metadata service. As of 2023, new AWS resources and most launch templates default to `HttpTokens: required`; legacy AMIs and infra still permitting IMDSv1 remain a common Wiz/CSPM finding and an active path for cloud token theft.
Wie schützt man sich gegen AWS IMDSv2?
Schutzmaßnahmen gegen AWS IMDSv2 kombinieren typischerweise technische Kontrollen und operative Praktiken, wie in der Definition oben beschrieben.
Welche anderen Bezeichnungen gibt es für AWS IMDSv2?
Übliche alternative Bezeichnungen: EC2 Instance Metadata Service v2, IMDSv2.
● Verwandte Begriffe
- cloud-security№ 092
AWS-IMDSv1-Angriff
Diebstahl von EC2-Instance-Role-Credentials durch unauthentifizierte GET-Requests an den Legacy-Endpunkt IMDSv1, meist ueber SSRF.
- cloud-security№ 208
Cloud-Metadata-SSRF
Server-Side-Request-Forgery-Angriff, der eine verwundbare Anwendung dazu bringt, den Instance-Metadata-Service des Cloud-Anbieters abzufragen und temporaere Zugangsdaten zu stehlen.
- attacks№ 1120
Server-Side-Request-Forgery (SSRF)
Web-Schwachstelle, die einem Angreifer erlaubt, einen Server zu HTTP- oder anderen Netzwerkanfragen an seine gewünschten Ziele zu zwingen, oft zu internen Systemen.
- cloud-security№ 212
Cloud-Token-Diebstahl
Diebstahl von OAuth-, SAML- oder Signatur-Tokens aus einem Cloud-Identitaetsdienst und deren Replay, um Benutzer oder Services ohne Passwoerter zu imitieren.
- cloud-security№ 561
IAM-Fehlkonfiguration (Cloud)
Unsichere oder zu großzügige Cloud-IAM-Einstellungen, die Nutzern, Rollen oder Diensten Aktionen über das tatsächliche Bedarfsmaß hinaus erlauben.
- cloud-security№ 209
Cloud-Fehlkonfiguration
Sicherheitslücke durch falsche oder unsichere Einstellungen von Cloud-Diensten, etwa offene Speicher, schwache IAM-Richtlinien oder freigegebene Management-Ports.