Detection rules › Splunk

AWS Exfiltration via EC2 Snapshot

Status
production
Severity
medium
Group by
_time, aws::awsRegion, aws::recipientAccountId, src, user, vendor_product
Author
Bhavin Patel, Splunk
Source
github.com/splunk/security_content

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.

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.

MITRE ATT&CK coverage

TacticTechniques
Exfiltration

Telemetry coverage

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: AWS Exfiltration via EC2 Snapshot
id: ac90b339-13fc-4f29-a18c-4abbba1f2171
version: 10
creation_date: '2023-03-22'
modification_date: '2026-05-13'
author: Bhavin Patel, Splunk
status: production
type: TTP
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.
data_source:
    - AWS CloudTrail CreateSnapshot
    - AWS CloudTrail DescribeSnapshotAttribute
    - AWS CloudTrail ModifySnapshotAttribute
    - AWS CloudTrail DeleteSnapshot
search: |-
    `cloudtrail` eventName IN ("CreateSnapshot", "DescribeSnapshotAttribute", "ModifySnapshotAttribute", "DeleteSnapshot") src_ip !="guardduty.amazonaws.com"
      | bin _time span=5m
      | rename user_name as user
      | stats count dc(signature) as distinct_api_calls values(signature) as signature values(dest) as dest values(requestParameters.attributeType) as attributeType values(requestParameters.createVolumePermission.add.items{}.userId) as aws_account_id_added values(user_agent) as user_agent
        BY _time user src
           vendor_account vendor_region vendor_product
      | where distinct_api_calls >= 2
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `aws_exfiltration_via_ec2_snapshot_filter`
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.
references:
    - 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/
finding:
    title: Potential AWS EC2 Exfiltration detected on account id - $vendor_account$ by user $user$ from src_ip $src$
    entity:
        field: user
        type: user
        score: 50
threat_objects:
    - field: src
      type: ip_address
analytic_story:
    - Suspicious Cloud Instance Activities
    - Data Exfiltration
asset_type: EC2 Snapshot
mitre_attack_id:
    - T1537
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat

Stages and Predicates

Stage 1: search

`cloudtrail` eventName IN ("CreateSnapshot", "DescribeSnapshotAttribute", "ModifySnapshotAttribute", "DeleteSnapshot") src_ip !="guardduty.amazonaws.com"

Stage 2: bucket

| bin _time span=5m

Stage 3: rename

| rename user_name as user

Stage 4: stats

| stats count dc(signature) as distinct_api_calls values(signature) as signature values(dest) as dest values(requestParameters.attributeType) as attributeType values(requestParameters.createVolumePermission.add.items{}.userId) as aws_account_id_added values(user_agent) as user_agent
    BY _time user src
       vendor_account vendor_region vendor_product

Stage 5: where

| where distinct_api_calls >= 2

Stage 6: search

| `security_content_ctime(firstTime)`

Stage 7: search

| `security_content_ctime(lastTime)`

Stage 8: search

| `aws_exfiltration_via_ec2_snapshot_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
distinct_api_callsge
  • 2
field:"distinct_api_calls" kind:ge value:"2"
eventNamein
  • "CreateSnapshot"
  • "DeleteSnapshot"
  • "DescribeSnapshotAttribute"
  • "ModifySnapshotAttribute"
field:"aws::eventName" kind:in
sourcetypeeq
  • aws:cloudtrail
field:"sourcetype" kind:eq value:"aws:cloudtrail"
src_ipne
  • "guardduty.amazonaws.com"
field:"src_ip" kind:ne