Impersonation and Spoof Detections by Sender Country
Description
This query summarizes inbound impersonation and spoof (BEC) detections by the geographic country of the sending IP address, using the EmailEvents table.
Query · kql
// Inbound impersonation and spoof (BEC) detections by sender-IP country. Country is from IP geolocation and is approximate.
EmailEvents
| where Timestamp > ago(30d)
| where OrgLevelPolicy !in ("Phishing simulation", "SecOps Mailbox")
| where (DetectionMethods has "Impersonation" or DetectionMethods has "Spoof") and isnotempty(SenderIPv4)
| extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
| summarize arg_max(Timestamp, *) by Key
| extend Country = tostring(geo_info_from_ip_address(SenderIPv4).country)
| where isnotempty(Country)
| summarize ImpersonationEmails = countif(DetectionMethods has "Impersonation"), SpoofEmails = countif(DetectionMethods has "Spoof"), SenderIPs = dcount(SenderIPv4) by Country
| extend TotalBEC = ImpersonationEmails + SpoofEmails
| top 20 by TotalBEC
| project Country, ImpersonationEmails, SpoofEmails, SenderIPs, TotalBEC