AWS Cross Account Activity From Previously Unseen Account
THIS IS A EXPERIMENTAL DETECTION
This detection has been marked experimental by the Splunk Threat Research team. This means we have not been able to test, simulate, or build datasets for this detection. Use at your own risk. This analytic is NOT supported.
Description
The following analytic identifies AssumeRole events where an IAM role in a different AWS account is accessed for the first time. It detects this activity by analyzing authentication logs and comparing the requesting and requested account IDs, flagging new cross-account activities. This behavior is significant because unauthorized cross-account access can indicate potential lateral movement or privilege escalation attempts. If confirmed malicious, an attacker could gain unauthorized access to resources in another account, potentially leading to data exfiltration, service disruption, or further compromise of the AWS environment.
- Type: Anomaly
- Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Datamodel: Authentication
- Last Updated: 2024-05-16
- Author: Rico Valdez, Splunk
- ID: 21193641-cb96-4a2c-a707-d9b9a7f7792b
Annotations
ATT&CK
Kill Chain Phase
NIST
- DE.AE
CIS20
- CIS 13
CVE
Search
1
2
3
4
5
6
7
8
9
10
11
12
| tstats min(_time) as firstTime max(_time) as lastTime from datamodel=Authentication where Authentication.signature=AssumeRole by Authentication.vendor_account Authentication.user Authentication.src Authentication.user_role
| `drop_dm_object_name(Authentication)`
| rex field=user_role "arn:aws:sts:*:(?<dest_account>.*):"
| where vendor_account != dest_account
| rename vendor_account as requestingAccountId dest_account as requestedAccountId
| lookup previously_seen_aws_cross_account_activity requestingAccountId, requestedAccountId, OUTPUTNEW firstTime
| eval status = if(firstTime > relative_time(now(), "-24h@h"),"New Cross Account Activity","Previously Seen")
| where status = "New Cross Account Activity"
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `aws_cross_account_activity_from_previously_unseen_account_filter`
Macros
The SPL above uses the following Macros:
aws_cross_account_activity_from_previously_unseen_account_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Lookups
The SPL above uses the following Lookups:
Required fields
List of fields required to use this analytic.
- _time
- Authentication.signature
- Authentication.vendor_account
- Authentication.user
- Authentication.user_role
- Authentication.src
How To Implement
You must be ingesting your cloud infrastructure logs from your cloud provider. You should run the baseline search Previously Seen AWS Cross Account Activity - Initial
to build the initial table of source IP address, geographic locations, and times. You must also enable the second baseline search Previously Seen AWS Cross Account Activity - Update
to keep this table up to date and to age out old data. You can also provide additional filtering for this search by customizing the aws_cross_account_activity_from_previously_unseen_account_filter
macro.
Known False Positives
Using multiple AWS accounts and roles is perfectly valid behavior. It's suspicious when an account requests privileges of an account it hasn't before. You should validate with the account owner that this is a legitimate request.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
15.0 | 30 | 50 | AWS account $requestingAccountId$ is trying to access resource from some other account $requestedAccountId$, for the first time. |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
Test Dataset
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
source | version: 2