AWS Discovery API Calls from VPN ASN by New Identity
This rule detects the initial use of AWS discovery APIs from VPN-associated ASNs by a previously unseen identity, indicating potential reconnaissance activity.
This detection identifies the first-time occurrence of an IAM principal invoking discovery APIs from a source IP address associated with a known VPN autonomous system number (ASN). The rule focuses on high-signal discovery actions, such as credential checks, account enumeration, bucket inventory, compute inventory, and logging introspection within AWS CloudTrail logs. The goal is to detect potential reconnaissance activities originating from anonymizing networks, which may indicate malicious intent. The rule specifically omits broad List* and Describe* patterns to reduce false positives, focusing instead on a curated list of ASNs commonly associated with VPN providers and hosting services. It’s important to validate ASN data using local intelligence and tailor the event.action list based on your environment’s baseline. Hosting ASNs are dual-use and require careful monitoring.
Attack Chain
- An attacker gains unauthorized access to AWS credentials, possibly through compromised credentials or misconfigured IAM roles.
- The attacker initiates a VPN connection to mask their origin and evade geographic restrictions or monitoring. The VPN endpoint’s ASN belongs to a known VPN provider.
- Using the compromised credentials and VPN connection, the attacker calls the AWS API to execute
GetCallerIdentityto validate access. - The attacker enumerates IAM users and roles using
ListUsersandListRolesto map out the AWS environment’s identity landscape. - The attacker inventories S3 buckets using
ListBucketsto identify potential targets for data exfiltration or manipulation. - The attacker gathers information about EC2 instances, VPCs, and security groups using
DescribeInstances,DescribeVpcs, andDescribeSecurityGroupsto understand the network infrastructure. - The attacker lists available Lambda functions using
ListFunctionsto discover potential code execution opportunities. - The attacker collects logging configurations by calling
DescribeTrailsto identify logging gaps.
Impact
A successful attack leveraging these discovery techniques can lead to unauthorized access to sensitive data, privilege escalation, and lateral movement within the AWS environment. By mapping out the cloud infrastructure, attackers can identify vulnerabilities and misconfigurations to exploit. Compromised AWS environments can result in data breaches, service disruptions, and financial losses.
Recommendation
- Deploy the Sigma rule
AWS Discovery API Calls from VPN ASN by New Identityto detect anomalous discovery activity originating from VPN ASNs. - Review the curated list of VPN-oriented ASNs within the rule query and update it with local intelligence from sources like RIPE, BGPView, or PeeringDB.
- Enable AWS CloudTrail logs to capture the necessary event data for the Sigma rule to function effectively.
- Tune the Sigma rule’s
event.actionfilter to include additional discovery-related API calls relevant to your environment, based on baseline analysis. - Investigate alerts generated by the Sigma rule by examining
aws.cloudtrail.user_identity.arn,event.action,event.provider,source.ip, andsource.as.organization.name. - Implement automated response actions, such as revoking sessions or rotating keys, when unexpected discovery activity is detected from VPN ASNs.
Detection coverage 2
AWS Discovery API Calls from VPN ASN
mediumDetects AWS API calls from known VPN ASNs.
AWS Discovery API Calls by Service Principals
mediumDetects AWS API calls from specific Service principals from VPN ASNs.
Detection queries are kept inside the platform. Get full rules →