Detection: Detect DNS Query to Decommissioned S3 Bucket

EXPERIMENTAL DETECTION

This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.

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.

 1
 2| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Network_Resolution
 3  WHERE DNS.message_type=QUERY
 4  BY DNS.answer DNS.answer_count DNS.query
 5     DNS.query_count DNS.reply_code_id DNS.src
 6     DNS.vendor_product
 7
 8| `drop_dm_object_name("DNS")`
 9
10| `security_content_ctime(firstTime)`
11
12| `security_content_ctime(lastTime)`
13
14| eval bucket_domain = lower(query)
15
16| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
17
18| where isnotnull(match)
19
20| `detect_dns_query_to_decommissioned_s3_bucket_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 22 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
detect_dns_query_to_decommissioned_s3_bucket_filter search *
detect_dns_query_to_decommissioned_s3_bucket_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1485 Data Destruction Impact
Actions on Objectives
DE.AE
CIS 13

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 Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

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.

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.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
A DNS query to decommissioned S3 bucket $query$ was detected from host $src$ src system 20

Threat Objects

Field Type
query domain

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Not Applicable N/A N/A N/A
Unit ❌ Failing Dataset cloudtrail aws:cloudtrail
Integration ❌ Failing Dataset 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: 6