Azure-Sentinel icon indicating copy to clipboard operation
Azure-Sentinel copied to clipboard

Potential DGA(Domain Generation Algorithm) detected via Repetitive Failures - Rule Uses Wrong Column

Open migrande opened this issue 5 months ago • 5 comments

Describe the bug I want to re-open the issue described at https://github.com/Azure/Azure-Sentinel/issues/11663. I came across the same issue and can confirm that the original reporter was accurate. This rule should be written to use the DstIpAddr as the pivot, not the SrcIpAddr. As the NXDOMAIN responses are "responses" logs, they all come from the DNS servers. In this case, the IPs of interest are the destination IPs, which are the IPs that originally sent in the request.

To Reproduce n/a

Expected behavior see above

Screenshots see above

migrande avatar Jun 23 '26 21:06 migrande

@v-utpalkumar and @v-kasghosh any update on this? The item was opened two weeks ago, and there's been no activity.

migrande avatar Jul 06 '26 16:07 migrande

Hello @migrande, apologies for the delayed response! We’re actively looking into this and will get back to you as soon as possible. Thank you for your cooperation and patience!

v-utpalkumar avatar Jul 14 '26 00:07 v-utpalkumar

Hello @migrande, thank you for your continued cooperation and support! Please find the analysis below for your reference.

After tracing this end-to-end (analytic rule → unifying parser → source parsers → the stored ASIM table), the conclusion is that the detection is correct as written, and the SrcIpAddr → DstIpAddr change should not be made. The behavior you observed is a data normalization issue at the parser/source layer, not a flaw in the rule. Here is the full details.

1. The root of the confusion: raw log semantics vs. ASIM semantics

Your reasoning is correct for raw DNS logs: in a response packet, the network-layer source IP is the resolver and the destination is the client. But ASIM fields are not "the network source/destination of this packet." They are normalized, semantic fields:

  • SrcIpAddr = the client that originated the DNS query
  • DstIpAddr = the DNS server that received the query

This holds regardless of whether the underlying record is a request or a response. The whole purpose of ASIM normalization is that the parser places the querying client into SrcIpAddr, even for EventSubType == "response" records.

2. How the rule connects to the data

The rule never reads a raw table or a single source directly. It calls the ASIM DNS unifying parser:

_Im_Dns(responsecodename='NXDOMAIN', ...)
        │
        ▼
_Im_Dns  (union isfuzzy=true over all source parsers)
        │
        ├── _Im_Dns_MicrosoftOMS      (Windows DNS / DnsEvents)
        ├── _Im_Dns_AzureFirewall
        ├── _Im_Dns_CiscoUmbrella
        ├── _Im_Dns_CorelightZeek
        ├── _Im_Dns_Gcp
        ├── _Im_Dns_InfobloxNIOS
        ├── _Im_Dns_VectraAI
        ├── _Im_Dns_ZscalerZIA
        └── … other sources …

Each source-specific parser is responsible for mapping its raw fields into the ASIM schema, including deciding what goes into SrcIpAddr.

3. Every supported source maps SrcIpAddr to the client

I checked the SrcIpAddr assignment in each parser that feeds the DNS Essentials solution:

Source Parser SrcIpAddr mapped from Result
Windows Server DNS vimDnsMicrosoftOMS ClientIP (a dedicated DnsEvents field) Client
Azure Firewall vimDnsAzureFirewall SourceIp (AZFWDnsQuery) Client
Cisco Umbrella vimDnsCiscoUmbrella InternalIp_s Client
Corelight Zeek vimDnsCorelightZeek id.orig_h (connection originator) Client
GCP DNS vimDnsGcp payload_sourceIP_s Client
Infoblox NIOS vimDnsInfobloxNIOS parsed client <ip> token from the BIND named log Client
Vectra AI vimDnsVectraAI id_orig_h_s (originator) Client
Zscaler Internet Access vimDnsZscalerZIA SourceIP Client

Note the syslog-based sources especially (e.g., Infoblox NIOS / BIND named): even though they parse raw syslog, they deliberately extract the client <ip> token — which BIND populates with the originating client, not the packet source — into SrcIpAddr. So even in a resolver-style logging setup, a compliant parser yields SrcIpAddr = client.

4. The stored table confirms it too

The materialized normalized table ASimDnsActivityLogs documents the same semantics at the storage level:

  • SrcIpAddr — "The IP address of the client sending the DNS request. For a recursive DNS request, this value would typically be the reporting device, and in most cases, set to 127.0.0.1."
  • DstIpAddr — "The IP address of the server receiving the DNS request. For a regular DNS request, this value would typically be the reporting device, and in most cases set to 127.0.0.1."

This is why changing the rule to DstIpAddr would be actively wrong: on compliant data, DstIpAddr is the DNS server and is frequently 127.0.0.1 — grouping on it would not track individual clients at all.

So three independent layers agree:

  1. ASIM DNS schema reference (schema level)
  2. The vimDns* parser code (implementation level)
  3. ASimDnsActivityLogs column reference (stored-table level)

5. Scenario where you observe ~very few hosts on SrcIpAddr and ~high host count on DstIpAddr

That pattern means, in your environment, the parser feeding your data is putting the resolver into SrcIpAddr and the client into DstIpAddr — i.e., the raw response fields are being passed through without the request/response normalization that ASIM requires. In other words, the source parser is not fully ASIM-compliant for your data.

This typically happens when:

  • A custom or community parser maps the packet source field directly instead of extracting the client field, or
  • The parser normalizing your source maps the emitting device / packet source (the resolver) into SrcIpAddr instead of the client identifier carried inside the record. This can happen with a custom or non‑ASIM‑compliant parser. For example, syslog-based DNS sources (such as ISC BIND) have no dedicated built‑in parser, so they're often onboarded via a custom parser or the Infoblox NIOS parser — and a custom parser may incorrectly use the syslog host rather than the client <ip> token embedded in the named log line.

6. The correct fix

The fix belongs in the parser, not the rule:

  1. Identify which parser normalizes your DNS source (_Im_Dns is a union — check which vimDns<Source> matches your data).
  2. Ensure that for response records it maps the client IP into SrcIpAddr (mirroring how vimDnsInfobloxNIOS extracts the client <ip> token), rather than the packet/response source.
  3. Once the parser is ASIM-compliant, the existing rule works exactly as intended with no change.

A quick way to confirm the problem in your workspace:

_Im_Dns(responsecodename='NXDOMAIN')
| summarize dcount(SrcIpAddr), dcount(DstIpAddr)

If dcount(SrcIpAddr) is tiny (≈ number of resolvers) while dcount(DstIpAddr) is large (≈ number of clients), your parser is mis-normalizing and should be corrected at the parser layer.


Summary: The rule is correct; SrcIpAddr is defined (at schema, parser, and table levels) as the querying client. If you are seeing the symptom mentioned in point 6, it indicates that a non‑ASIM‑compliant parser/source in your environment, which is where the fix belongs. If you can share which DNS product/parser you're ingesting from, we can pinpoint the exact vimDns<Source> parser and validate its SrcIpAddr mapping.

I look forward to hearing your feedback on the analysis shared above. Thank you once again!

v-utpalkumar avatar Aug 04 '26 14:08 v-utpalkumar

Hello @migrande,

I hope you’ve had a chance to review the analysis shared above. Please share your feedback, if any. Otherwise, we will proceed with closing this GitHub issue.

Thank you!

v-utpalkumar avatar Aug 10 '26 07:08 v-utpalkumar

Hello @migrande, we are proceeding with closing this GitHub issue for now. If you feel further discussion is needed, please feel free to reopen the issue at any time.

Thank you for your cooperation and support!

v-utpalkumar avatar Aug 12 '26 19:08 v-utpalkumar