You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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.
name: Detect DNS Query to Decommissioned S3 Bucket
2
+
id: 2f1c5fd1-4b8a-4f5d-a0e9-7d6a8e2f5e1e
3
+
version: 1
4
+
date: '2025-02-12'
5
+
author: Jose Hernandez, Splunk
6
+
status: experimental
7
+
type: Anomaly
8
+
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.
9
+
data_source:
10
+
- Sysmon EventID 22
11
+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Network_Resolution where DNS.message_type=QUERY by DNS.query DNS.src
12
+
| `drop_dm_object_name("DNS")`
13
+
| `security_content_ctime(firstTime)`
14
+
| `security_content_ctime(lastTime)`
15
+
| eval bucket_domain = lower(query)
16
+
| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
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 KVstore lookup.
20
+
known_false_positives: Some applications or scripts may continue to reference old S3 bucket names after they have been decommissioned. These should be investigated and updated to prevent potential security risks.
name: Detect Web Access to Decommissioned S3 Bucket
2
+
id: 3a1d8f62-5b9c-4e7d-b8f3-9d6a8e2f5e1f
3
+
version: 1
4
+
date: '2025-02-12'
5
+
author: Jose Hernandez, Splunk
6
+
status: experimental
7
+
type: Anomaly
8
+
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.
9
+
data_source:
10
+
- AWS Cloudfront
11
+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime values(Web.http_method) as http_method values(Web.http_user_agent) as http_user_agent values(Web.url) as url values(Web.user) as user from datamodel=Web where Web.url_domain!="" by Web.src Web.url_domain
12
+
| `drop_dm_object_name("Web")`
13
+
| `security_content_ctime(firstTime)`
14
+
| `security_content_ctime(lastTime)`
15
+
| eval bucket_domain = lower(url_domain)
16
+
| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
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 KVStore Lookup.
20
+
known_false_positives: Some applications or web pages may continue to reference old S3 bucket URLs after they have been decommissioned. These should be investigated and updated to prevent potential security risks.
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.
description: This analytic story contains detections that monitor AWS S3 bucket configurations, access patterns, and potential security risks, with a specific focus on tracking decommissioned public buckets to prevent bucket hijacking attempts.
8
+
narrative: 'Amazon Simple Storage Service (S3) is a widely used object storage service that allows organizations to store and retrieve any amount of data. While S3 buckets are private by default, they can be configured for public access through bucket policies or static website hosting. This flexibility, while useful for legitimate purposes, can also lead to security risks if not properly managed.
9
+
10
+
A particularly concerning attack vector is the hijacking of decommissioned S3 buckets. When a public S3 bucket is deleted, its unique name becomes available for anyone to claim. Attackers can monitor for deleted buckets that were previously public and attempt to recreate them, potentially intercepting data from applications that still reference these buckets or using them to host malicious content.
11
+
12
+
This analytic story focuses on:
13
+
1. Tracking S3 buckets that were public (via policy or website hosting) before deletion
14
+
2. Detecting attempts to access or query these decommissioned bucket names
4. Helping organizations maintain proper S3 bucket hygiene and prevent security incidents related to bucket name reuse
17
+
18
+
The detections in this story leverage AWS CloudTrail logs, DNS queries, and web proxy data to provide comprehensive monitoring of S3 bucket lifecycle and access patterns.'
0 commit comments