↳ GitHub sourceAnalytics ruleMedium

Detect DNS queries reporting multiple errors from different clients - Static threshold based (ASIM DNS Solution)

Description

'This rule creates an alert when multiple clients report errors for the same DNS query. This helps in identifying possible similar C2 communications originating from different clients. It utilizes [ASIM](https://aka.ms/AboutASIM) normalization and is applied to any source that supports the ASIM DNS schema.'
Rule type
Scheduled
Version
1.0.4
Declared status
Available
Query frequency
1h
Query period
1h
Trigger
gt 0

Declared MITRE coverage

KQL query

Original query, unchanged.

let lookback=1h;
let threshold = 2;
let errors = dynamic(['NXDOMAIN', 'SERVFAIL', 'REFUSED']); 
_Im_Dns(starttime=ago(lookback)) 
  | where EventResultDetails has_any (errors) 
  | summarize SrcIPs = make_set(SrcIpAddr, 100), Dvcs = make_set(Dvc, 100), ResourceIds = make_set(_ResourceId, 100) by DnsQuery, bin(TimeGenerated, 10min) 
  | where array_length(SrcIPs) >= threshold 
  | extend TotalIPs = array_length(SrcIPs),IPCountthreshold = threshold 
  | extend DomainName = strcat(split(DnsQuery, ".")[1], ".", split(DnsQuery, ".")[2])  
  | mv-expand SrcIPs  
  | extend SrcIP = tostring(SrcIPs)  
  | mv-expand Dvcs  
  | extend Dvc = tostring(Dvcs)  
  | mv-expand ResourceIds  
  | extend ResourceId = tostring(ResourceIds)  
  | extend Dvc = strcat(split(Dvc, ".")[0])
  | summarize Start=min(TimeGenerated), End=max(TimeGenerated) by SrcIP, Dvc, ResourceId, DnsQuery, DomainName, SrcIPs = tostring(SrcIPs), IPCountthreshold = threshold, TotalIPs
  | extend HostName = tostring(split(Dvc, ".")[0]), DomainIndex = toint(indexof(Dvc, '.'))
  | extend HostNameDomain = iff(DomainIndex != -1, substring(Dvc, DomainIndex + 1), Dvc)

Declared entities

DNSIPAzureResourceUrlHost

Related content

Links established from declared identifiers and solution manifests.

Source provenance

GitHub

Displayed values come from files in Azure/Azure-Sentinel. They describe the published template, not your workspace configuration.

Source identifier
5b8344eb-fa28-4ac3-bcff-bc19d5d63089
Additional source files 2Solutions/DNS Essentials/Analytic Rules/MultipleErrorsReportedForSameDNSQueryStaticThresholdBased.yamlsource ↗Solutions/DNS Essentials/Data/Solution_DNS.jsonsolution-membership ↗
GSTEP / CATALOG TRACKING

Added to catalog : 16 Sept 2026 · 05:49 UTC
Last change observed : 16 Sept 2026 · 05:49 UTC

GSTEP sync dates, separate from the source content’s publication dates.