Detection rules › Splunk

AWS Detect Users with KMS keys performing encryption S3

Status
production
Severity
low
Group by
aws::awsRegion, aws::recipientAccountId, aws::userAgent, bucketName, dest, dest_file, signature, src, src_file, user, vendor_product
Author
Rod Soto, Patrick Bareiss Splunk
Source
github.com/splunk/security_content

The following analytic identifies users with KMS keys performing encryption operations on S3 buckets. It leverages AWS CloudTrail logs to detect the CopyObject event where server-side encryption with AWS KMS is specified. This activity is significant as it may indicate unauthorized or suspicious encryption of data, potentially masking exfiltration or tampering efforts. If confirmed malicious, an attacker could be encrypting sensitive data to evade detection or preparing it for exfiltration, posing a significant risk to data integrity and confidentiality.

Known false positives

  • There maybe buckets provisioned with S3 encryption

MITRE ATT&CK coverage

TacticTechniques
Impact

Telemetry coverage

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: AWS Detect Users with KMS keys performing encryption S3
id: 884a5f59-eec7-4f4a-948b-dbde18225fdc
version: 11
creation_date: '2020-10-27'
modification_date: '2026-05-13'
author: Rod Soto, Patrick Bareiss Splunk
status: production
type: Anomaly
description: The following analytic identifies users with KMS keys performing encryption operations on S3 buckets. It leverages AWS CloudTrail logs to detect the `CopyObject` event where server-side encryption with AWS KMS is specified. This activity is significant as it may indicate unauthorized or suspicious encryption of data, potentially masking exfiltration or tampering efforts. If confirmed malicious, an attacker could be encrypting sensitive data to evade detection or preparing it for exfiltration, posing a significant risk to data integrity and confidentiality.
data_source:
    - AWS CloudTrail
search: |-
    `cloudtrail` eventName=CopyObject requestParameters.x-amz-server-side-encryption="aws:kms"
      | rename requestParameters.bucketName AS bucketName, requestParameters.x-amz-copy-source AS src_file, requestParameters.key AS dest_file
      | rename user_name as user
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY signature dest user
           user_agent src vendor_account
           vendor_region vendor_product bucketName
           src_file dest_file
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `aws_detect_users_with_kms_keys_performing_encryption_s3_filter`
how_to_implement: You must install Splunk AWS add on and Splunk App for AWS. This search works with AWS CloudTrail logs
known_false_positives: There maybe buckets provisioned with S3 encryption
references:
    - https://rhinosecuritylabs.com/aws/s3-ransomware-part-1-attack-vector/
    - https://github.com/d1vious/git-wild-hunt
    - https://www.youtube.com/watch?v=PgzNib37g0M
intermediate_findings:
    entities:
        - field: user
          type: user
          score: 20
          message: User $user$ with KMS keys is performing encryption, against S3 buckets on these files $dest_file$
analytic_story:
    - Ransomware Cloud
asset_type: S3 Bucket
mitre_attack_id:
    - T1486
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat

Stages and Predicates

Stage 1: search

`cloudtrail` eventName=CopyObject requestParameters.x-amz-server-side-encryption="aws:kms"

Stage 2: rename

| rename requestParameters.bucketName AS bucketName, requestParameters.x-amz-copy-source AS src_file, requestParameters.key AS dest_file

Stage 3: rename

| rename user_name as user

Stage 4: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY signature dest user
       user_agent src vendor_account
       vendor_region vendor_product bucketName
       src_file dest_file

Stage 5: search

| `security_content_ctime(firstTime)`

Stage 6: search

| `security_content_ctime(lastTime)`

Stage 7: search

| `aws_detect_users_with_kms_keys_performing_encryption_s3_filter`

Indicators

These rows show field, operator, and value matches.