ID | Technique | Tactic |
---|---|---|
T1530 | Data from Cloud Storage | Collection |
Detection: Detect New Open S3 buckets
Description
The following analytic identifies the creation of open/public S3 buckets in AWS. It detects this activity by analyzing AWS CloudTrail events for PutBucketAcl
actions where the access control list (ACL) grants permissions to all users or authenticated users. This activity is significant because open S3 buckets can expose sensitive data to unauthorized access, leading to data breaches. If confirmed malicious, an attacker could read, write, or fully control the contents of the bucket, potentially leading to data exfiltration or tampering.
Search
1`cloudtrail` eventSource=s3.amazonaws.com eventName=PutBucketAcl
2| rex field=_raw "(?<json_field>{.+})"
3| spath input=json_field output=grantees path=requestParameters.AccessControlPolicy.AccessControlList.Grant{}
4| search grantees=*
5| mvexpand grantees
6| spath input=grantees output=uri path=Grantee.URI
7| spath input=grantees output=permission path=Permission
8| search uri IN ("http://acs.amazonaws.com/groups/global/AllUsers","http://acs.amazonaws.com/groups/global/AuthenticatedUsers")
9| search permission IN ("READ","READ_ACP","WRITE","WRITE_ACP","FULL_CONTROL")
10| rename requestParameters.bucketName AS bucketName
11| stats count min(_time) as firstTime max(_time) as lastTime by user_arn userIdentity.principalId userAgent uri permission bucketName
12| `security_content_ctime(firstTime)`
13| `security_content_ctime(lastTime)`
14| `detect_new_open_s3_buckets_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
AWS CloudTrail | AWS | 'aws:cloudtrail' |
'aws_cloudtrail' |
Macros Used
Name | Value |
---|---|
cloudtrail | sourcetype=aws:cloudtrail |
detect_new_open_s3_buckets_filter | search * |
detect_new_open_s3_buckets_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
Setting | Value |
---|---|
Disabled | true |
Cron Schedule | 0 * * * * |
Earliest Time | -70m@m |
Latest Time | -10m@m |
Schedule Window | auto |
Creates Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
You must install the AWS App for Splunk.
Known False Positives
While this search has no known false positives, it is possible that an AWS admin has legitimately created a public bucket for a specific purpose. That said, AWS strongly advises against granting full control to the "All Users" group.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
User $user_arn$ has created an open/public bucket $bucketName$ with the following permissions $permission$ | 48 | 60 | 80 |
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | aws_cloudtrail |
aws:cloudtrail |
Integration | ✅ Passing | Dataset | aws_cloudtrail |
aws:cloudtrail |
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 5