Skip to content

Commit 0ec052b

Browse files
committed
updating yaml to pass build and adding lookup, minor fixes
1 parent fda0c88 commit 0ec052b

5 files changed

+22
-12
lines changed

baselines/baseline_of_open_s3_bucket_decommissioning.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
data_source: []
2-
mitre_attack_ids: ''
3-
security_domain: audit
41
name: Baseline Of Open S3 Bucket Decommissioning
52
id: 984e9022-b87b-499a-a260-8d0282c46ea2
63
version: 1
74
date: '2025-02-12'
85
author: Jose Hernandez
96
type: Baseline
107
status: production
11-
description: This baseline search identifies S3 buckets that were previously exposed to the public (either through bucket policies or website hosting) and have been subsequently deleted. This helps track the lifecycle of potentially risky S3 bucket configurations and their proper decommissioning.
12-
kind: cloud
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
1314
search: '`cloudtrail` eventSource="s3.amazonaws.com" (eventName=DeleteBucket OR eventName=PutBucketPolicy OR eventName=PutBucketWebsite)
1415
| spath input=_raw path=requestParameters.bucketName output=bucketName
1516
| spath input=_raw path=requestParameters.Host output=host
@@ -36,7 +37,7 @@ search: '`cloudtrail` eventSource="s3.amazonaws.com" (eventName=DeleteBucket OR
3637
| eval policy_details = if(isPublicPolicy==1, "Policy: Principal=" . mvjoin(principals, ", ") . " Effect=" . mvjoin(effects, ", ") . " Action=" . mvjoin(actions, ", "), "No Public Policy")
3738
| eval website_details = if(isWebsite==1, "Static Website Enabled", "No Website Hosting")
3839
| table bucketName, hosts, firstEvent, lastEvent, events, policy_details, website_details, accountIds, userARNs, awsRegions
39-
| outputlookup append=true decommissioned_buckets.csv | `baseline_of_open_s3_bucket_decommissioning_filter`'
40+
| outputlookup append=true decommissioned_buckets | `baseline_of_open_s3_bucket_decommissioning_filter`'
4041
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 file named decommissioned_buckets.csv which tracks the history of deleted buckets that were previously exposed to the public.
4142
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.
4243
references:
@@ -47,7 +48,6 @@ tags:
4748
analytic_story:
4849
- AWS S3 Bucket Security Monitoring
4950
- Suspicious AWS S3 Activities
50-
message: An S3 bucket that was previously configured with public access has been deleted
5151
product:
5252
- Splunk Enterprise
5353
- Splunk Enterprise Security

detections/network/detect_dns_query_to_decommissioned_s3_bucket.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 1
44
date: '2025-02-12'
55
author: Jose Hernandez, Splunk
66
status: experimental
7-
type: anomaly
7+
type: Anomaly
88
description: This detection identifies DNS queries to domains that match previously decommissioned S3 buckets. This activity is significant because attackers may attempt to recreate deleted S3 buckets that were previously public to hijack them for malicious purposes. If successful, this could allow attackers to host malicious content or exfiltrate data through compromised bucket names that may still be referenced by legitimate applications.
99
data_source:
1010
- DNS logs
@@ -13,7 +13,7 @@ search: '| tstats `security_content_summariesonly` count min(_time) as firstTime
1313
| `security_content_ctime(firstTime)`
1414
| `security_content_ctime(lastTime)`
1515
| eval bucket_domain = lower(query)
16-
| lookup decommissioned_buckets.csv bucketName as bucket_domain OUTPUT bucketName as match
16+
| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
1717
| where isnotnull(match)
1818
| `detect_dns_query_to_decommissioned_s3_bucket_filter`'
1919
how_to_implement: To successfully implement this detection, you need to be ingesting DNS query logs and have them mapped to the Network_Resolution data model. Additionally, ensure that the baseline search "Baseline Of Open S3 Bucket Decommissioning" is running and populating the decommissioned_buckets.csv lookup file.

detections/web/detect_web_access_to_decommissioned_s3_bucket.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 1
44
date: '2025-02-12'
55
author: Jose Hernandez, Splunk
66
status: experimental
7-
type: anomaly
7+
type: Anomaly
88
description: This detection identifies web requests to domains that match previously decommissioned S3 buckets through web proxy logs. This activity is significant because attackers may attempt to access or recreate deleted S3 buckets that were previously public to hijack them for malicious purposes. If successful, this could allow attackers to host malicious content or exfiltrate data through compromised bucket names that may still be referenced by legitimate applications.
99
data_source:
1010
- Web proxy logs
@@ -13,7 +13,7 @@ search: '| tstats `security_content_summariesonly` count min(_time) as firstTime
1313
| `security_content_ctime(firstTime)`
1414
| `security_content_ctime(lastTime)`
1515
| eval bucket_domain = lower(url_domain)
16-
| lookup decommissioned_buckets.csv bucketName as bucket_domain OUTPUT bucketName as match
16+
| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
1717
| where isnotnull(match)
1818
| `detect_web_access_to_decommissioned_s3_bucket_filter`'
1919
how_to_implement: To successfully implement this detection, you need to be ingesting web proxy logs and have them mapped to the Web data model. Additionally, ensure that the baseline search "Baseline Of Open S3 Bucket Decommissioning" is running and populating the decommissioned_buckets.csv lookup file.
@@ -43,7 +43,7 @@ tags:
4343
analytic_story:
4444
- AWS S3 Bucket Security Monitoring
4545
- Data Destruction
46-
asset_type: Web
46+
asset_type: S3 Bucket
4747
mitre_attack_id:
4848
- T1485
4949
product:

lookups/decommissioned_buckets.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bucketName, hosts, firstEvent, lastEvent, events, policy_details, website_details, accountIds, userARNs, awsRegions

lookups/decommissioned_buckets.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: decommissioned_buckets
2+
date: 2025-02-14
3+
version: 1
4+
id: b3a95eff-87cf-40f3-b6e0-5b1a11eed68f
5+
author: Bhavin Patel
6+
lookup_type: csv
7+
default_match: false
8+
description: A lookup table of decommissioned S3 buckets created by baseline - Baseline of Open S3 Bucket Decommissioning. This lookup table is used by detections searches to trigger alerts when decommissioned buckets are detected.
9+
min_matches: 1

0 commit comments

Comments
 (0)