AWS Exfiltration via EC2 Snapshot
Description
This search detects a series of AWS API calls, made in a short time window, related to EC2 snapshots that can detect a potential exfiltration via EC2 Snapshot modifications. In this attack, the attacker typically proceeds by listing and creating EC2 snapshots of the available EC2 instances followed by modifying snapshot attributes such that it can be shared externally. Once this is done, the attacker can then load that EC2 snapshot and access all the sensitive information.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2023-03-22
- 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 $user_arn$ 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: 1