Description
IMDSv2 adds defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities with enhancements to the EC2 Instance Metadata Service (IMDS).
https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/ has the details.
A bunch of projects (e.g. https://pypi.org/project/ec2-metadata/) have started using IMDSv2,
https://pypi.org/project/ec2-metadata/ says,
In November 2019, AWS released version 2 of the instance metadata service. It’s more secure against Server Side Request Forgery (SSRF) attacks. ec2-metadata now uses it exclusively. You can therefore consider disabling version 1, as per AWS’ guide.
Related: https://www.elastic.co/guide/en/beats/auditbeat/current/add-cloud-metadata.html. The The add_cloud_metadata processor
should use IMDSv2 on AWS.