Malware Detections by Sender Country
Description
This query summarises inbound email malware detections by the sender IP address country, derived from the sender IPv4 address.
Query · kql
EmailEvents | where Timestamp > ago(30d) | where OrgLevelPolicy != "Phishing simulation" and OrgLevelPolicy != "SecOps Mailbox" | extend Key = strcat(NetworkMessageId, "-", RecipientEmailAddress) | summarize arg_max(Timestamp, *) by Key | where ThreatTypes has "Malware" and isnotempty(SenderIPv4) | extend GeoInfo = geo_info_from_ip_address(SenderIPv4) | extend Country = tostring(GeoInfo.country) | summarize count() by Country | project Country, ['Malware Emails'] = count_ | sort by ['Malware Emails'] desc