Query Details
//Exposure Management + Defender for Office 365 //https://www.linkedin.com/posts/activity-7178261918795649024-cah8/ //Custom DefenderXDR detection rule for critical identities marked by exposure management clicking on malicious email link. This would triggered the isolation of the user account and devices impacted to minimize lateral movement. //KQL Detection Code: let CriticalIdentities = ExposureGraphNodes | where set_has_element(Categories, "identity") | where isnotnull(NodeProperties.rawData.criticalityLevel) and NodeProperties.rawData.criticalityLevel.criticalityLevel < 4 | extend AccountUPN = tostring(NodeProperties.rawData.accountUpn) | distinct AccountUPN; AlertInfo | where Title == "A potentially malicious URL click was detected" | join AlertEvidence on AlertId | join EmailEvents on NetworkMessageId | where RecipientEmailAddress has_any (CriticalIdentities)
This KQL query is designed to detect when critical identities, as marked by an exposure management system, click on a malicious email link. Here's a simplified breakdown:
Identify Critical Identities:
ExposureGraphNodes table.Detect Malicious URL Clicks:
AlertInfo table where the title indicates a potentially malicious URL click.AlertEvidence table and email events from the EmailEvents table.In essence, this query helps in isolating user accounts and devices of critical identities that have clicked on malicious email links to minimize the risk of lateral movement within the network.

Steven Lim
Released: August 5, 2024
Tables
Keywords
Operators