AWS EC2 Bulk User Data Enumeration
Identifies when the same AWS principal, from the same source IP, successfully calls EC2 "DescribeInstanceAttribute" for the "userData" attribute against more than 20 distinct instances within a 10-minute lookback.…
Description
Identifies when the same AWS principal, from the same source IP, successfully calls EC2 "DescribeInstanceAttribute" for the "userData" attribute against more than 20 distinct instances within a 10-minute lookback. Instance user data often contains bootstrap scripts and hardcoded credentials, so retrieving it across many instances in a short window can indicate reconnaissance or credential harvesting. Known CSPM roles, AWS service invocations, and Terraform calls from major cloud and carrier networks are excluded.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 2 ATT&CK techniques it maps to.
Known benign triggers
- Inventory jobs, configuration management, and security scanners that are not in the exclusion list may read `userData` across a large fleet. Confirm the principal ARN, source IP, ASN, and user agent against approved automation before treating the activity as malicious.
- Terraform running from an ASN other than Amazon, Google, Microsoft, Verizon, or AT&T is still in scope. A large apply or refresh can exceed 20 instances.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstanceAttribute.html | 2 |
| docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html | 2from 2 sources |
| hackingthe.cloud/aws/exploitation/local_ec2_priv_esc_through_user_data | 3 |
From the source
- At source
- Open at source
- Upstream identifier
- 7f6bc52c-fb52-46b5-8081-b78db15af501
- Tagged by the source as
- Data Source: Amazon Web ServicesData Source: AWSData Source: AWS CloudTrailDomain: CloudPlatform: AWSResources: Investigation GuideRule Type: ES|QLService: AWS EC2Tactic: Credential AccessTactic: DiscoveryUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Nov 3, 2026
- Version
- 1