Excessive AWS S3 Object Encryption with SSE-C
Identifies a high-volume of AWS S3 objects stored in a bucket using 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 Threshold rule that flags when this behavior is observed for a specific bucket more than 15 times in a short time-window.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/01/15"
3integration = ["aws"]
4maturity = "production"
5updated_date = "2025/01/15"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies a high-volume of AWS S3 objects stored in a bucket using using Server-Side Encryption with Customer-Provided Keys
11(SSE-C). Adversaries with compromised AWS credentials can encrypt objects in an S3 bucket using their own encryption
12keys, rendering the objects unreadable or recoverable without the key. This can be used as a form of ransomware to
13extort the bucket owner for the decryption key. This is a [Threshold](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-threshold-rule) rule that flags when
14this behavior is observed for a specific bucket more than 15 times in a short time-window.
15"""
16false_positives = [
17 """
18 Legitimate use of Server-Side Encryption with Customer-Provided Keys (SSE-C) to encrypt objects in an S3 bucket.
19 """,
20]
21from = "now-9m"
22index = ["filebeat-*", "logs-aws.cloudtrail-*"]
23language = "kuery"
24license = "Elastic License v2"
25name = "Excessive AWS S3 Object Encryption with SSE-C"
26note = """### Triage and Analysis
27
28#### Investigating Excessive AWS S3 Object Encryption with SSE-C
29This rule identifies a high volume of objects being encrypted using 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.
30
31##### Possible Investigation Steps
32
331. **Identify the User and Source**:
34 - Review the `aws.cloudtrail.user_identity.arn` to identify the IAM user or role performing the operation.
35 - Cross-check the `source.ip` and `user_agent.original` fields for unusual IPs or user agents that could indicate unauthorized access.
36 - Review the `aws.cloudtrail.user_identity.access_key_id` to identify the access key used. This could be a compromised key.
37
382. **Examine the Targeted Resources**:
39 - Check `aws.cloudtrail.flattened.request_parameters.bucketName` to identify the bucket involved.
40 - Analyze the object key from `aws.cloudtrail.flattened.request_parameters.key`.
41
423. **Evaluate Encryption Behavior**:
43 - Confirm the encryption details in `aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm` and `aws.cloudtrail.flattened.additional_eventdata.SSEApplied`.
44 - Note if `SSEApplied` is `SSE-C`, which confirms encryption using a customer-provided key.
45
464. **Correlate with Recent Events**:
47 - 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.
48 - Identify `ListBucket` or `GetObject` operations on the same bucket to determine all affected objects.
49 - For `PutObject` events, identify any other unusual objecs uploaded such as a ransom note.
50
515. **Validate Access Permissions**:
52 - Check the IAM policies and roles associated with the user to verify if they had legitimate access to encrypt objects.
53
546. **Assess Impact**:
55 - Identify the number of encrypted objects in the bucket by examining other similar events.
56 - Determine if this encryption aligns with standard business practices or constitutes a deviation.
57
58### False Positive Analysis
59
60- **Legitimate Use Cases**:
61 - Confirm if SSE-C encryption is part of regular operations for compliance or data protection.
62 - Cross-reference known processes or users authorized for SSE-C encryption in the affected bucket.
63
64### Response and Remediation
65
661. **Immediate Actions**:
67 - Disable access keys or permissions for the user if unauthorized behavior is confirmed.
68 - Rotate the bucket's encryption configuration to mitigate further misuse.
69
702. **Data Recovery**:
71 - Attempt to identify and contact the party holding the SSE-C encryption keys if recovery is necessary.
72
733. **Enhance Monitoring**:
74 - Enable alerts for future SSE-C encryption attempts in critical buckets.
75 - Review and tighten IAM policies for roles and users accessing S3.
76
774. **Post-Incident Review**:
78 - Audit logs for additional activities by the same user or IP.
79 - Document findings and apply lessons learned to improve preventive measures.
80"""
81references = [
82 "https://www.halcyon.ai/blog/abusing-aws-native-services-ransomware-encrypting-s3-buckets-with-sse-c",
83 "https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html",
84]
85risk_score = 73
86rule_id = "909bf7c8-d371-11ef-bcc3-f661ea17fbcd"
87setup = "AWS S3 data event types need to be enabled in the CloudTrail trail configuration."
88severity = "high"
89tags = [
90 "Domain: Cloud",
91 "Data Source: AWS",
92 "Data Source: Amazon Web Services",
93 "Data Source: AWS S3",
94 "Resources: Investigation Guide",
95 "Use Case: Threat Detection",
96 "Tactic: Impact",
97]
98timestamp_override = "event.ingested"
99type = "threshold"
100
101query = '''
102event.dataset: "aws.cloudtrail"
103 and event.provider: "s3.amazonaws.com"
104 and event.action: "PutObject"
105 and event.outcome: "success"
106 and aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm: "AES256"
107 and aws.cloudtrail.flattened.additional_eventdata.SSEApplied: "SSE_C"
108'''
109
110
111[[rule.threat]]
112framework = "MITRE ATT&CK"
113[[rule.threat.technique]]
114id = "T1486"
115name = "Data Encrypted for Impact"
116reference = "https://attack.mitre.org/techniques/T1486/"
117
118
119[rule.threat.tactic]
120id = "TA0040"
121name = "Impact"
122reference = "https://attack.mitre.org/tactics/TA0040/"
123
124[rule.threshold]
125field = ["aws.cloudtrail.flattened.request_parameters.bucketName"]
126value = 20
Triage and Analysis
Investigating Excessive AWS S3 Object Encryption with SSE-C
This rule identifies a high volume of objects being encrypted using 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
-
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
anduser_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.
- Review the
-
Examine the Targeted Resources:
- Check
aws.cloudtrail.flattened.request_parameters.bucketName
to identify the bucket involved. - Analyze the object key from
aws.cloudtrail.flattened.request_parameters.key
.
- Check
-
Evaluate Encryption Behavior:
- Confirm the encryption details in
aws.cloudtrail.flattened.request_parameters.x-amz-server-side-encryption-customer-algorithm
andaws.cloudtrail.flattened.additional_eventdata.SSEApplied
. - Note if
SSEApplied
isSSE-C
, which confirms encryption using a customer-provided key.
- Confirm the encryption details in
-
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
orGetObject
operations on the same bucket to determine all affected objects. - For
PutObject
events, identify any other unusual objecs uploaded such as a ransom note.
-
Validate Access Permissions:
- Check the IAM policies and roles associated with the user to verify if they had legitimate access to encrypt objects.
-
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
-
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.
-
Data Recovery:
- Attempt to identify and contact the party holding the SSE-C encryption keys if recovery is necessary.
-
Enhance Monitoring:
- Enable alerts for future SSE-C encryption attempts in critical buckets.
- Review and tighten IAM policies for roles and users accessing S3.
-
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
- Unusual AWS S3 Object Encryption with SSE-C
- AWS S3 Bucket Enumeration or Brute Force
- SNS Topic Message Publish by Rare User
- AWS IAM Deactivation of MFA Device
- AWS CloudTrail Log Updated