Add hunting query: Potential Rootkit Network Activity via Firewall/EDR telemetry delta#14337
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Microsoft Sentinel hunting query template intended to detect potential kernel-level EDR network telemetry bypass by comparing perimeter “network truth” (ASimNetworkSessionLogs) vs MDE “host truth” (DeviceNetworkEvents/DeviceNetworkInfo).
Changes:
- Introduces a new hunting query YAML with MITRE mappings, data connectors, query logic, and entity mappings.
- Implements a left-anti join delta approach (firewall sessions present, MDE sessions absent) with pre-filtering to reduce compute.
- Adds alert customization fields (custom details / title+description override) alongside the hunting query.
|
Hi @YounesA343 Thanks! |
|
Hi @v-maheshbh Thanks for the syntax feedback, I've updated the PR to use an explicit extend prior to the mv-expand to ensure it parses safely! Note that we couldn't expand the column directly as suggested, because the IPAddresses column in DeviceNetworkInfo is natively typed as a string (JSON array) rather than dynamic, so todynamic() is strictly required to unpack the array. Updated and validated! |
Summary
This PR adds a highly resilient, compute-optimized analytic rule targeting advanced adversaries operating in Ring-0 (kernel space) that blind endpoint telemetry to exfiltrate data or communicate with C2 infrastructure.
Adversaries increasingly rely on Bring Your Own Vulnerable Driver (BYOVD) techniques to achieve kernel-level execution. A primary objective of this access is to unlink Windows Filtering Platform (WFP) callouts or inject raw frames directly into NDIS. This effectively blinds EDR sensors (like Microsoft Defender for Endpoint) to outbound network telemetry, allowing malware to beacon while the host otherwise appears completely healthy.
This query relies on the paradox created by this evasion: it compares "Network Truth" (out-of-band physical/virtual firewall appliance logs via
ASimNetworkSessionLogs) against "Host Truth" (EDR telemetry viaDeviceNetworkEvents). By shifting the detection to the network boundary, the endpoint-level ETW/WFP patch is rendered irrelevant.Compute Optimizations Included:
activeMdeNodes): Before executing the expensive anti-join, the query identifies IPs actively reporting to MDE. This filters out IoT, BYOD, and unmanaged devices from the massive Firewall dataset, preventingO(N*M)compute explosions and false positives.DeviceNetworkEventstable to resolve Hostnames and Domains, the query leverages the lightweightDeviceNetworkInfostate table. It unpacks the JSON array to grab the exact DHCP/Hostname mapping witharg_max, saving massive cluster compute.summarizeand explicitly time-bounded before acting as the left table in theleftantijoin against the distinct MDE connection pairs.Triage Readiness:
The query output is highly engineered for Tier 1 SOC analysts. It utilizes
alertDetailsOverrideto inject the compromised host and destination IP directly into the incident title, usescustomDetailsto pin exfiltrated byte counts to the overview blade, and strictly casts schema types to ensureentityMappingstrigger the Sentinel Investigation Graph without errors.Change(s):
PotentialRootkitTrafficMissingFromMDE.yamlto theHunting Queries/Microsoft 365 Defender/ Defense Evasiondirectory.Reason for Change(s):
Version Updated:
Testing Completed:
ASimNetworkSessionLogs,DeviceNetworkEvents, andDeviceNetworkInfoschemas.tostring()) forentityMappingsstrictly follows the V3 entity guidelines.Checked that the validations are passing and have addressed any issues that are present:
.script/tests/DetectionTemplateSchemaValidation/dotnet testlocal validation to ensure YAML structure, metadata (Tactics/Techniques), and KQL syntax are perfectly compliant with the repo's guidelines. Validated for non-ASCII characters.