ID | Technique | Tactic |
---|---|---|
T1537 | Transfer Data to Cloud Account | Exfiltration |
Detection: AWS AMI Attribute Modification for Exfiltration
Description
The following analytic detects suspicious modifications to AWS AMI attributes, such as sharing an AMI with another AWS account or making it publicly accessible. It leverages AWS CloudTrail logs to identify these changes by monitoring specific API calls. This activity is significant because adversaries can exploit these modifications to exfiltrate sensitive data stored in AWS resources. If confirmed malicious, this could lead to unauthorized access and potential data breaches, compromising the confidentiality and integrity of organizational information.
Search
1`cloudtrail` eventName=ModifyImageAttribute (requestParameters.launchPermission.add.items{}.userId = * OR requestParameters.launchPermission.add.items{}.group = all)
2| rename requestParameters.launchPermission.add.items{}.group as group_added
3| rename requestParameters.launchPermission.add.items{}.userId as accounts_added
4| eval ami_status=if(match(group_added,"all") ,"Public AMI", "Not Public")
5| stats count min(_time) as firstTime max(_time) as lastTime values(group_added) values(accounts_added) as accounts_added values(ami_status) by src_ip region eventName userAgent user_arn aws_account_id userIdentity.principalId
6| `security_content_ctime(firstTime)`
7| `security_content_ctime(lastTime)`
8| `aws_ami_attribute_modification_for_exfiltration_filter`
Data Source
Name | Platform | Sourcetype | Source | Supported App |
---|---|---|---|---|
AWS CloudTrail ModifyImageAttribute | AWS | 'aws:cloudtrail' |
'aws_cloudtrail' |
N/A |
Macros Used
Name | Value |
---|---|
cloudtrail | sourcetype=aws:cloudtrail |
aws_ami_attribute_modification_for_exfiltration_filter | search * |
aws_ami_attribute_modification_for_exfiltration_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
You must install splunk AWS add on and Splunk App for AWS. This search works with AWS CloudTrail logs.
Known False Positives
It is possible that an AWS admin has legitimately shared a snapshot with others for a specific purpose.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
AWS AMI from account $aws_account_id$ is shared externally with $accounts_added$ from $src_ip$ or AMI made is made Public. | 80 | 100 | 80 |
References
-
https://labs.nettitude.com/blog/how-to-exfiltrate-aws-ec2-data/
-
https://stratus-red-team.cloud/attack-techniques/AWS/aws.exfiltration.ec2-share-ami/
-
https://hackingthe.cloud/aws/enumeration/loot_public_ebs_snapshots/
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | aws_cloudtrail |
aws:cloudtrail |
Integration | ✅ Passing | Dataset | aws_cloudtrail |
aws:cloudtrail |
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: GitHub | Version: 3