Unusual AWS S3 Object Encryption with SSE-C

Identifies when AWS S3 objects stored in a bucket are encrypted using Server-Side Encryption with Customer-Provided Keys (SSE-C). Adversaries with compromised AWS credentials can encrypt objects in an S3 bucket using their own encryption keys, rendering the objects unreadable or recoverable without the key. This can be used as a form of ransomware to extort the bucket owner for the decryption key. This is a New Terms rule that flags when this behavior is observed for the first time user and target bucket name.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2025/01/15"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2025/07/10"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies when AWS S3 objects stored in a bucket are encrypted using Server-Side Encryption with Customer-Provided Keys (SSE-C). Adversaries with compromised AWS credentials can encrypt objects in an S3 bucket using their own encryption keys, rendering the objects unreadable or recoverable without the key. This can be used as a form of ransomware to extort the bucket owner for the decryption key. This is a New Terms rule that flags when this behavior is observed for the first time user and target bucket name.
 11"""
 12false_positives = [
 13    """
 14    Legitimate use of Server-Side Encryption with Customer-Provided Keys (SSE-C) to encrypt objects in an S3 bucket.
 15    """,
 16]
 17from = "now-6m"
 18index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 19language = "kuery"
 20license = "Elastic License v2"
 21name = "Unusual AWS S3 Object Encryption with SSE-C"
 22note = """### Triage and Analysis
 23
 24#### Investigating Unusual AWS S3 Object Encryption with SSE-C
 25This rule identifies the use of Server-Side Encryption with Customer-Provided Keys (SSE-C) in AWS S3. This could indicate malicious activity, such as ransomware encrypting objects, rendering them inaccessible without the corresponding encryption keys.
 26
 27##### Possible Investigation Steps
 28
 291. **Identify the User and Source**:
 30   - Review the `aws.cloudtrail.user_identity.arn` to identify the IAM user or role performing the operation.
 31   - Cross-check the `source.ip` and `user_agent.original` fields for unusual IPs or user agents that could indicate unauthorized access.
 32   - Review the `aws.cloudtrail.user_identity.access_key_id` to identify the access key used. This could be a compromised key.
 33
 342. **Examine the Targeted Resources**:
 35   - Check `aws.cloudtrail.request_parameters` to identify the bucket involved.
 36   - Analyze the object key from `aws.cloudtrail.request_parameters`.
 37
 383. **Evaluate Encryption Behavior**:
 39   - Confirm the encryption details in `aws.cloudtrail.request_parameters` and `aws.cloudtrail.additional_eventdata`.
 40   - Note if `SSEApplied` is `SSE-C`, which confirms encryption using a customer-provided key.
 41
 424. **Correlate with Recent Events**:
 43   - Look for any suspicious activity in proximity to the encryption event, such as new access key creation, policy changes, or unusual access patterns from the same user or IP.
 44   - Identify `ListBucket` or `GetObject` operations on the same bucket to determine all affected objects.
 45   - For `PutObject` events, identify any other unusual objecs uploaded such as a ransom note.
 46
 475. **Validate Access Permissions**:
 48   - Check the IAM policies and roles associated with the user to verify if they had legitimate access to encrypt objects.
 49
 506. **Assess Impact**:
 51   - Identify the number of encrypted objects in the bucket by examining other similar events.
 52   - Determine if this encryption aligns with standard business practices or constitutes a deviation.
 53
 54### False Positive Analysis
 55
 56- **Legitimate Use Cases**:
 57  - Confirm if SSE-C encryption is part of regular operations for compliance or data protection.
 58  - Cross-reference known processes or users authorized for SSE-C encryption in the affected bucket.
 59
 60### Response and Remediation
 61
 621. **Immediate Actions**:
 63   - Disable access keys or permissions for the user if unauthorized behavior is confirmed.
 64   - Rotate the bucket's encryption configuration to mitigate further misuse.
 65
 662. **Data Recovery**:
 67   - Attempt to identify and contact the party holding the SSE-C encryption keys if recovery is necessary.
 68
 693. **Enhance Monitoring**:
 70   - Enable alerts for future SSE-C encryption attempts in critical buckets.
 71   - Review and tighten IAM policies for roles and users accessing S3.
 72
 734. **Post-Incident Review**:
 74   - Audit logs for additional activities by the same user or IP.
 75   - Document findings and apply lessons learned to improve preventive measures.
 76"""
 77references = [
 78    "https://www.halcyon.ai/blog/abusing-aws-native-services-ransomware-encrypting-s3-buckets-with-sse-c",
 79    "https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html",
 80]
 81risk_score = 73
 82rule_id = "c1a9ed70-d349-11ef-841c-f661ea17fbcd"
 83setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration."
 84severity = "high"
 85tags = [
 86    "Domain: Cloud",
 87    "Data Source: AWS",
 88    "Data Source: Amazon Web Services",
 89    "Data Source: AWS S3",
 90    "Resources: Investigation Guide",
 91    "Use Case: Threat Detection",
 92    "Tactic: Impact",
 93]
 94timestamp_override = "event.ingested"
 95type = "new_terms"
 96
 97query = '''
 98event.dataset: "aws.cloudtrail"
 99    and event.provider: "s3.amazonaws.com"
100    and event.action: "PutObject"
101    and event.outcome: "success"
102    and aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm: "AES256"
103'''
104
105
106[[rule.threat]]
107framework = "MITRE ATT&CK"
108[[rule.threat.technique]]
109id = "T1486"
110name = "Data Encrypted for Impact"
111reference = "https://attack.mitre.org/techniques/T1486/"
112
113
114[rule.threat.tactic]
115id = "TA0040"
116name = "Impact"
117reference = "https://attack.mitre.org/tactics/TA0040/"
118
119[rule.investigation_fields]
120field_names = [
121    "@timestamp",
122    "source.ip",
123    "user_agent.original",
124    "aws.cloudtrail.user_identity.arn",
125    "aws.cloudtrail.user_identity.type",
126    "aws.cloudtrail.user_identity.access_key_id",
127    "event.action",
128    "event.outcome",
129    "aws.cloudtrail.request_parameters",
130    "aws.cloudtrail.additional_eventdata",
131    "aws.cloudtrail.response_elements",
132    "cloud.region",
133    "cloud.account.id",
134]
135
136[rule.new_terms]
137field = "new_terms_fields"
138value = ["cloud.account.id", "user.name", "tls.client.server_name"]
139[[rule.new_terms.history_window_start]]
140field = "history_window_start"
141value = "now-14d"

Triage and Analysis

Investigating Unusual AWS S3 Object Encryption with SSE-C

This rule identifies the use of Server-Side Encryption with Customer-Provided Keys (SSE-C) in AWS S3. This could indicate malicious activity, such as ransomware encrypting objects, rendering them inaccessible without the corresponding encryption keys.

Possible Investigation Steps
  1. Identify the User and Source:

    • Review the aws.cloudtrail.user_identity.arn to identify the IAM user or role performing the operation.
    • Cross-check the source.ip and user_agent.original fields for unusual IPs or user agents that could indicate unauthorized access.
    • Review the aws.cloudtrail.user_identity.access_key_id to identify the access key used. This could be a compromised key.
  2. Examine the Targeted Resources:

    • Check aws.cloudtrail.request_parameters to identify the bucket involved.
    • Analyze the object key from aws.cloudtrail.request_parameters.
  3. Evaluate Encryption Behavior:

    • Confirm the encryption details in aws.cloudtrail.request_parameters and aws.cloudtrail.additional_eventdata.
    • Note if SSEApplied is SSE-C, which confirms encryption using a customer-provided key.
  4. Correlate with Recent Events:

    • Look for any suspicious activity in proximity to the encryption event, such as new access key creation, policy changes, or unusual access patterns from the same user or IP.
    • Identify ListBucket or GetObject operations on the same bucket to determine all affected objects.
    • For PutObject events, identify any other unusual objecs uploaded such as a ransom note.
  5. Validate Access Permissions:

    • Check the IAM policies and roles associated with the user to verify if they had legitimate access to encrypt objects.
  6. Assess Impact:

    • Identify the number of encrypted objects in the bucket by examining other similar events.
    • Determine if this encryption aligns with standard business practices or constitutes a deviation.

False Positive Analysis

  • Legitimate Use Cases:
    • Confirm if SSE-C encryption is part of regular operations for compliance or data protection.
    • Cross-reference known processes or users authorized for SSE-C encryption in the affected bucket.

Response and Remediation

  1. Immediate Actions:

    • Disable access keys or permissions for the user if unauthorized behavior is confirmed.
    • Rotate the bucket's encryption configuration to mitigate further misuse.
  2. Data Recovery:

    • Attempt to identify and contact the party holding the SSE-C encryption keys if recovery is necessary.
  3. Enhance Monitoring:

    • Enable alerts for future SSE-C encryption attempts in critical buckets.
    • Review and tighten IAM policies for roles and users accessing S3.
  4. Post-Incident Review:

    • Audit logs for additional activities by the same user or IP.
    • Document findings and apply lessons learned to improve preventive measures.

References

Related rules

to-top