Skip to content

Commit cf52e66

Browse files
authored
Merge branch 'develop' into nterl0k-t1114-sus-o365-email-actions
2 parents f9ab1d1 + c254e91 commit cf52e66

File tree

309 files changed

+8280
-4346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+8280
-4346
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Baseline Of Open S3 Bucket Decommissioning
2+
id: 984e9022-b87b-499a-a260-8d0282c46ea2
3+
version: 1
4+
date: '2025-02-12'
5+
author: Jose Hernandez
6+
type: Baseline
7+
status: production
8+
description: |-
9+
The following analytic identifies S3 buckets that were previously exposed to the public and have been subsequently deleted. It leverages AWS CloudTrail logs to track the lifecycle of potentially risky S3 bucket configurations. This activity is crucial for ensuring that public access to sensitive data is properly managed and decommissioned. By monitoring these events, organizations can ensure that exposed buckets are promptly deleted, reducing the risk of unauthorized access. Immediate investigation is recommended to confirm the proper decommissioning of these buckets and to ensure no sensitive data remains exposed. This baseline detection creates a lookup table of decommissioned buckets.csv and their associated events which can be used by detection searches to trigger alerts when decommissioned buckets are detected.
10+
11+
The following detections searches leverage this baseline search and the lookup table.
12+
* Detect DNS Query to Decommissioned S3 Bucket
13+
* Detect Web Access to Decommissioned S3 Bucket
14+
search: '`cloudtrail` eventSource="s3.amazonaws.com" (eventName=DeleteBucket OR eventName=PutBucketPolicy OR eventName=PutBucketWebsite)
15+
| spath input=_raw path=requestParameters.bucketName output=bucketName
16+
| spath input=_raw path=requestParameters.Host output=host
17+
| spath input=_raw path=requestParameters.bucketPolicy.Statement{} output=statements
18+
| spath input=statements output=principal path=Principal
19+
| spath input=statements output=effect path=Effect
20+
| spath input=statements output=action path=Action
21+
| stats values(eventName) as events,
22+
values(requestParameters.bucketPolicy) as policies,
23+
values(principal) as principals,
24+
values(effect) as effects,
25+
values(action) as actions,
26+
min(_time) as firstEvent,
27+
max(_time) as lastEvent,
28+
values(userIdentity.accountId) as accountIds,
29+
values(userIdentity.arn) as userARNs,
30+
values(awsRegion) as awsRegions,
31+
values(host) as hosts
32+
by bucketName
33+
| eval isPublicPolicy = if( (mvfind(principals, "\\*")>=0) AND (mvfind(effects, "Allow")>=0) AND (mvfind(actions, "s3:GetObject")>=0), 1, 0)
34+
| eval isWebsite = if(mvfind(events, "PutBucketWebsite")>=0, 1, 0)
35+
| eval is_open = if(isPublicPolicy==1 OR isWebsite==1, 1, 0)
36+
| where is_open==1 AND (mvfind(events, "DeleteBucket")>=0)
37+
| eval policy_details = if(isPublicPolicy==1, "Policy: Principal=" . mvjoin(principals, ", ") . " Effect=" . mvjoin(effects, ", ") . " Action=" . mvjoin(actions, ", "), "No Public Policy")
38+
| eval website_details = if(isWebsite==1, "Static Website Enabled", "No Website Hosting")
39+
| table bucketName, hosts, firstEvent, lastEvent, events, policy_details, website_details, accountIds, userARNs, awsRegions
40+
| outputlookup append=true decommissioned_buckets | `baseline_of_open_s3_bucket_decommissioning_filter`'
41+
how_to_implement: To implement this baseline, you need to have AWS CloudTrail logs being ingested into Splunk with the AWS Add-on properly configured. The search looks for S3 bucket events related to bucket policies, website hosting configuration, and bucket deletion. The results are stored in a lookup KVStore named decommissioned_buckets which tracks the history of deleted buckets that were previously exposed to the public.
42+
known_false_positives: Some buckets may be intentionally made public for legitimate business purposes before being decommissioned. Review the policy_details and website_details fields to understand the nature of the public access that was configured.
43+
references:
44+
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
45+
- https://labs.watchtowr.com/8-million-requests-later-we-made-the-solarwinds-supply-chain-attack-look-amateur/
46+
- https://aws.amazon.com/premiumsupport/knowledge-center/secure-s3-resources/
47+
tags:
48+
analytic_story:
49+
- AWS S3 Bucket Security Monitoring
50+
- Suspicious AWS S3 Activities
51+
product:
52+
- Splunk Enterprise
53+
- Splunk Enterprise Security
54+
- Splunk Cloud
55+
detections:
56+
- Detect DNS Query to Decommissioned S3 Bucket
57+
- Detect Web Access to Decommissioned S3 Bucket
58+
security_domain: audit
59+
deployment:
60+
scheduling:
61+
cron_schedule: 0 2 * * 0
62+
earliest_time: -30d@d
63+
latest_time: -1d@d
64+
schedule_window: auto

0 commit comments

Comments
 (0)