AWS Exfiltration via EC2 Snapshot
Description
The following analytic detects a series of AWS API calls related to EC2 snapshots within a short time window, indicating potential exfiltration via EC2 Snapshot modifications. It leverages AWS CloudTrail logs to identify actions such as creating, describing, and modifying snapshot attributes. This activity is significant as it may indicate an attacker attempting to exfiltrate data by sharing EC2 snapshots externally. If confirmed malicious, the attacker could gain access to sensitive information stored in the snapshots, leading to data breaches and potential compliance violations.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-10
- Author: Bhavin Patel, Splunk
- ID: ac90b339-13fc-4f29-a18c-4abbba1f2171
Annotations
Kill Chain Phase
- Actions On Objectives
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
`cloudtrail` eventName IN ("CreateSnapshot", "DescribeSnapshotAttribute", "ModifySnapshotAttribute", "DeleteSnapshot") src_ip !="guardduty.amazonaws.com"
| bin _time span=5m
| stats count dc(eventName) as distinct_api_calls values(eventName) values(requestParameters.attributeType) as attributeType values(requestParameters.createVolumePermission.add.items{}.userId) as aws_account_id_added values(userAgent) as userAgent by _time userName src_ip aws_account_id
| where distinct_api_calls >= 2
| `aws_exfiltration_via_ec2_snapshot_filter`
Macros
The SPL above uses the following Macros:
aws_exfiltration_via_ec2_snapshot_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- eventName
- user_arn
- src_ip
- requestParameters.attributeType
- aws_account_id
- vendor_region
- user_agent
- userIdentity.principalId
- requestParameters.createVolumePermission.add.items{}.userId
How To Implement
You must install splunk AWS add on and Splunk App for AWS. This search works with AWS CloudTrail logs. We have intentionally removed guardduty.amazonaws.com
from src_ip to remove false positives caused by guard duty. We recommend you adjust the time window as per your environment.
Known False Positives
It is possible that an AWS admin has legitimately shared a snapshot with an other account for a specific purpose. Please check any recent change requests filed in your organization.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
64.0 | 80 | 80 | Potential AWS EC2 Exfiltration detected on account id - $aws_account_id$ by user $userName$ from src_ip $src_ip$ |
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
- https://labs.nettitude.com/blog/how-to-exfiltrate-aws-ec2-data/
- https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySnapshotAttribute.html
- https://bleemb.medium.com/data-exfiltration-with-native-aws-s3-features-c94ae4d13436
- https://stratus-red-team.cloud/attack-techniques/list/
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