Skip to content

Commit 322162f

Browse files
authored
[New Rule] AWS S3 Bucket Replicated to Another Account (#3895)
1 parent e9cb222 commit 322162f

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[metadata]
2+
creation_date = "2024/07/12"
3+
integration = ["aws"]
4+
maturity = "production"
5+
updated_date = "2024/07/12"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies when the `PutBucketReplication` operation is used to replicate S3 objects to a bucket in another AWS account. Adversaries may use bucket replication to exfiltrate sensitive data to an environment they control.
11+
"""
12+
false_positives = [
13+
"""
14+
Bucket replication accross accounts is a legitimate practice in some AWS environments. Ensure that the sharing is authorized before taking action.
15+
""",
16+
]
17+
from = "now-6m"
18+
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "AWS S3 Bucket Replicated to Another Account"
22+
note = """
23+
## Triage and Analysis
24+
25+
### Investigating AWS S3 Bucket Replicated to Another Account
26+
27+
This rule identifies when an S3 bucket is replicated to another AWS account. While sharing bucket replication is a common practice, adversaries may exploit this feature to exfiltrate data by replicating objects to external accounts under their control.
28+
29+
#### Possible Investigation Steps
30+
31+
- **Identify the Actor**: Review the `aws.cloudtrail.user_identity.arn` and `aws.cloudtrail.user_identity.access_key_id` fields to identify who made the change. Verify if this actor typically performs such actions and if they have the necessary permissions.
32+
- **Review the Sharing Event**: Identify the S3 bucket involved and review the event details. Look for `PutBucketReplication` actions where an `Account` key-value pair is included signifying replication to an external account.
33+
- **Request and Response Parameters**: Check the `aws.cloudtrail.request_parameters` and `aws.cloudtrail.response_elements` fields in the CloudTrail event to identify the role used and account ID where the bucket was replicated.
34+
- **Verify the Shared Bucket**: Check the S3 bucket that was replicated and its contents to determine the sensitivity of the data stored within it.
35+
- **Validate External Account**: Examine the AWS account to which the bucket was replicated. Determine whether this account is known and previously authorized to access such resources.
36+
- **Contextualize with Recent Changes**: Compare this sharing event against recent changes in S3 configurations. Look for any other recent permissions changes or unusual administrative actions.
37+
- **Correlate with Other Activities**: Search for related CloudTrail events before and after this change to see if the same actor or IP address engaged in other potentially suspicious activities.
38+
- **Interview Relevant Personnel**: If the share was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing DB backups and snapshots.
39+
40+
### False Positive Analysis
41+
42+
- **Legitimate Backup Actions**: Confirm if the S3 bucket replication aligns with scheduled backups or legitimate automation tasks.
43+
- **Consistency Check**: Compare the action against historical data of similar actions performed by the user or within the organization. If the action is consistent with past legitimate activities, it might indicate a false alarm.
44+
45+
### Response and Remediation
46+
47+
- **Immediate Review and Reversal**: If the change was unauthorized, update the S3 configurations to remove any unauthorized replication rules.
48+
- **Enhance Monitoring and Alerts**: Adjust monitoring systems to alert on similar actions, especially those involving sensitive data or permissions.
49+
- **Policy Update**: Review and possibly update your organization’s policies on S3 bucket/object sharing to tighten control and prevent unauthorized access.
50+
- **Incident Response**: If malicious intent is confirmed, consider it a data breach incident and initiate the incident response protocol. This includes further investigation, containment, and recovery.
51+
52+
### Additional Information:
53+
54+
For further guidance on managing and securing S3 buckets in AWS environments, refer to the [AWS S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/security.html/) and AWS best practices for security.
55+
"""
56+
references = [
57+
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html/",
58+
"https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html/",
59+
]
60+
risk_score = 47
61+
rule_id = "d488f026-7907-4f56-ad51-742feb3db01c"
62+
severity = "medium"
63+
tags = [
64+
"Domain: Cloud",
65+
"Data Source: AWS",
66+
"Data Source: Amazon Web Services",
67+
"Data Source: AWS S3",
68+
"Resources: Investigation Guide",
69+
"Use Case: Threat Detection",
70+
"Tactic: Exfiltration",
71+
]
72+
timestamp_override = "event.ingested"
73+
type = "eql"
74+
75+
query = '''
76+
any where event.dataset == "aws.cloudtrail"
77+
and event.action == "PutBucketReplication"
78+
and event.outcome == "success"
79+
and stringContains(aws.cloudtrail.request_parameters, "Account")
80+
'''
81+
82+
[[rule.threat]]
83+
framework = "MITRE ATT&CK"
84+
[[rule.threat.technique]]
85+
id = "T1537"
86+
name = "Transfer Data to Cloud Account"
87+
reference = "https://attack.mitre.org/techniques/T1537/"
88+
89+
[rule.threat.tactic]
90+
id = "TA0010"
91+
name = "Exfiltration"
92+
reference = "https://attack.mitre.org/tactics/TA0010/"
93+

0 commit comments

Comments
 (0)