T1552.005 Cloud Instance Metadata API

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>.

View in MITRE ATT&CK®

CIS Controls Mappings

Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
CIS-13.10 Perform Application Layer Filtering mitigates T1552.005 Cloud Instance Metadata API
Comments
A properly configured web application firewall can block external server-side request forgery attempts that target the cloud instance metadata API and expose temporary credentials.
References
CIS-13.4 Perform Traffic Filtering Between Network Segments mitigates T1552.005 Cloud Instance Metadata API
Comments
Restrict network access to the Cloud Instance Metadata API so only workloads with a legitimate requirement can reach the service, reducing adversary access to credentials and metadata through unintended network paths.
References
CIS-4.8 Uninstall or Disable Unnecessary Services on Enterprise Assets and Software mitigates T1552.005 Cloud Instance Metadata API
Comments
Disabling unnecessary metadata services or insecure metadata-service versions directly prevents adversary access through those endpoints.
References
    CIS-4.4 Implement and Manage a Firewall on Servers mitigates T1552.005 Cloud Instance Metadata API
    Comments
    ATT&CK mentions to limit access to the Instance Metadata API using a host-based firewall such as iptables. A properly configured Web Application Firewall (WAF) may help prevent external adversaries from exploiting Server-side Request Forgery (SSRF) attacks that allow access to the Cloud Instance Metadata API.
    References

      VERIS Mappings

      Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
      action.malware.variety.Password dumper Password dumper (extract credential hashes) related-to T1552.005 Cloud Instance Metadata API
      attribute.confidentiality.data_disclosure Confirmed or potential data disclosure related-to T1552.005 Cloud Instance Metadata API

      GCP Mappings

      Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
      cloud_key_management Cloud Key Management technique_scores T1552.005 Cloud Instance Metadata API
      Comments
      This control's protection is specific to a minority of this technique's sub-techniques and procedure examples resulting in a Minimal Coverage score and consequently an overall score of Minimal.
      References

      AWS Mappings

      Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
      aws_security_hub AWS Security Hub technique_scores T1552.005 Cloud Instance Metadata API
      Comments
      AWS Security Hub CSPM identifies EC2 instances that do not require IMDSv2 and recommends enabling it. Applying this recommendation can reduce credential exposure through metadata requests exploiting SSRF and misconfigured proxies. Security Hub does not enforce the change by default.
      References
      aws_config AWS Config technique_scores T1552.005 Cloud Instance Metadata API
      Comments
      The "ec2-imdsv2-check" managed rule can identify instances which are configured to use the outdated Instance Metadata Service Version 1 (IMDSv1), which is less secure than IMDSv2. This provides partial coverage, since adversaries may find ways to exploit the more secure IMDSv2, resulting in an overall score of Partial.
      References
        amazon_guardduty Amazon GuardDuty technique_scores T1552.005 Cloud Instance Metadata API
        Comments
        The UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration finding type flags attempts to run AWS API operations from a host outside of EC2 using temporary AWS credentials that were created on an EC2 instance in your AWS environment. This may indicate that the temporary credentials have been compromised. Score is capped at Minimal because external use is required for detection.
        References