Detection rules › Splunk

Detect DNS Query to Decommissioned S3 Bucket

Status
experimental
Severity
low
Group by
DNS.answer_count, DNS.query_count, DNS.vendor_product, QueryName, dns.answers.name, dns.response.code, src_ip
Author
Jose Hernandez, Splunk
Source
github.com/splunk/security_content

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.

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.

MITRE ATT&CK coverage

TacticTechniques
Impact

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 22: DNSEvent (DNS query)

Rule body

name: Detect DNS Query to Decommissioned S3 Bucket
id: 2f1c5fd1-4b8a-4f5d-a0e9-7d6a8e2f5e1e
version: 6
creation_date: '2025-02-12'
modification_date: '2026-05-13'
author: Jose Hernandez, Splunk
status: experimental
type: Anomaly
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.
data_source:
    - Sysmon EventID 22
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.answer DNS.answer_count DNS.query
         DNS.query_count DNS.reply_code_id DNS.src
         DNS.vendor_product
    | `drop_dm_object_name("DNS")`
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | eval bucket_domain = lower(query)
    | lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
    | where isnotnull(match)
    | `detect_dns_query_to_decommissioned_s3_bucket_filter`
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.
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.
references:
    - https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
    - https://labs.watchtowr.com/8-million-requests-later-we-made-the-solarwinds-supply-chain-attack-look-amateur/
intermediate_findings:
    entities:
        - field: src
          type: system
          score: 20
          message: A DNS query to decommissioned S3 bucket $query$ was detected from host $src$
threat_objects:
    - field: query
      type: domain
analytic_story:
    - AWS S3 Bucket Security Monitoring
    - Data Destruction
asset_type: Network
mitre_attack_id:
    - T1485
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: network
security_domain: network
baselines:
    - Baseline Of Open S3 Bucket Decommissioning

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Network_Resolution
  WHERE DNS.message_type=QUERY
  BY DNS.answer DNS.answer_count DNS.query
     DNS.query_count DNS.reply_code_id DNS.src
     DNS.vendor_product

Stage 2: search

| `drop_dm_object_name("DNS")`

Stage 3: search

| `security_content_ctime(firstTime)`

Stage 4: search

| `security_content_ctime(lastTime)`

Stage 5: eval

| eval bucket_domain = lower(query)

Stage 6: lookup

| lookup decommissioned_buckets bucketName as bucket_domain OUTPUT bucketName as match
Lookup table
decommissioned_buckets
Key field
bucketName as bucket_domain
Output columns
['bucketName', 'match']

Stage 7: where

| where isnotnull(match)

Stage 8: search

| `detect_dns_query_to_decommissioned_s3_bucket_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
DNS.message_typeeq
  • QUERY corpus 2 (splunk 2)
field:"DNS.message_type" kind:eq value:"QUERY"
matchis_not_null
  • (no value, null check)
field:"match" kind:is_not_null