Malware Detection IP and Geo Position
Description
This query summarises inbound email malware detections by sender IP address with geographic coordinates for mapping.
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) | summarize count() by SenderIPv4 | extend GeoInfo = geo_info_from_ip_address(SenderIPv4) | extend Latitude = tostring(GeoInfo.latitude), Longitude = tostring(GeoInfo.longitude) | project SenderIPv4, Latitude, Longitude, ['Malware Emails'] = count_