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.1 A cloud metadata API has been used in at least one high profile compromise.2
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.3
The de facto standard across cloud service providers is to host the Instance Metadata API at http[:]//169.254.169.254
.
Item | Value |
---|---|
ID | T1552.005 |
Sub-techniques | T1552.001, T1552.002, T1552.003, T1552.004, T1552.005, T1552.006, T1552.007 |
Tactics | TA0006 |
Platforms | IaaS |
Version | 1.3 |
Created | 11 February 2020 |
Last Modified | 08 March 2022 |
Procedure Examples
ID | Name | Description |
---|---|---|
S0601 | Hildegard | Hildegard has queried the Cloud Instance Metadata API for cloud credentials.6 |
S0683 | Peirates | Peirates can query the query AWS and GCP metadata APIs for secrets.5 |
G0139 | TeamTNT | TeamTNT has queried the AWS instance metadata service for credentials.7 |
Mitigations
ID | Mitigation | Description |
---|---|---|
M1042 | Disable or Remove Feature or Program | Disable unnecessary metadata services and restrict or disable insecure versions of metadata services that are in use to prevent adversary access.4 |
M1037 | Filter Network Traffic | 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.3 |
Detection
ID | Data Source | Data Component |
---|---|---|
DS0002 | User Account | User Account Authentication |
References
-
AWS. (n.d.). Instance Metadata and User Data. Retrieved July 18, 2019. ↩
-
Krebs, B.. (2019, August 19). What We Can Learn from the Capital One Hack. Retrieved March 25, 2020. ↩
-
Higashi, Michael. (2018, May 15). Instance Metadata API: A Modern Day Trojan Horse. Retrieved July 16, 2019. ↩↩
-
MacCarthaigh, C. (2019, November 19). Add defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities with enhancements to the EC2 Instance Metadata Service. Retrieved October 14, 2020. ↩
-
InGuardians. (2022, January 5). Peirates GitHub. Retrieved February 8, 2022. ↩
-
Chen, J. et al. (2021, February 3). Hildegard: New TeamTNT Cryptojacking Malware Targeting Kubernetes. Retrieved April 5, 2021. ↩
-
Fiser, D. Oliveira, A. (n.d.). Tracking the Activities of TeamTNT A Closer Look at a Cloud-Focused Malicious Actor Group. Retrieved September 22, 2021. ↩