Adversaries may attempt to access the Cloud Instance Metadata API to collect credentials and other sensitive data.

Most cloud service providers support a Cloud Instance Metadata API which is a service provided to running virtual instances that allows applications to access information about the running virtual instance. Available information generally includes name, security group, and additional metadata including sensitive data such as credentials and UserData scripts that may contain additional secrets. The Instance Metadata API is provided as a convenience to assist in managing applications and is accessible by anyone who can access the instance.(Citation: AWS Instance Metadata API) A cloud metadata API has been used in at least one high profile compromise.(Citation: Krebs Capital One August 2019)

If adversaries have a presence on the running virtual instance, they may query the Instance Metadata API directly to identify credentials that grant access to additional resources. Additionally, adversaries may exploit a Server-Side Request Forgery (SSRF) vulnerability in a public facing web proxy that allows them to gain access to the sensitive information via a request to the Instance Metadata API.(Citation: RedLock Instance Metadata API 2018)

The de facto standard across cloud service providers is to host the Instance Metadata API at <code>http[:]//169.254.169.254</code>.

Cloud Instance Metadata API
source_name: mitre-attack  url: https://attack.mitre.org/techniques/T1552/005  external_id: T1552.005     source_name: AWS Instance Metadata API  description: AWS. (n.d.). Instance Metadata and User Data. Retrieved July 18, 2019.  url: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html     source_name: RedLock Instance Metadata API 2018  description: Higashi, Michael. (2018, May 15). Instance Metadata API: A Modern Day Trojan Horse. Retrieved July 16, 2019.  url: https://redlock.io/blog/instance-metadata-api-a-modern-day-trojan-horse     source_name: Krebs Capital One August 2019  description: Krebs, B.. (2019, August 19). What We Can Learn from the Capital One Hack. Retrieved March 25, 2020.  url: https://krebsonsecurity.com/2019/08/what-we-can-learn-from-the-capital-one-hack/     