Top Microsoft Teams Senders Removed by Zero-Hour Auto Purge
Description
This query ranks Microsoft Teams senders by how many of their messages were removed after delivery by zero-hour auto purge, split by malware and phish.
Query · kql
//This query ranks Microsoft Teams senders by messages removed after delivery by zero-hour auto purge over the last
//30 days, with malware and phish removals split out.
//Each removal is a message that passed initial filtering and reached a mailbox before being retracted, so a sender
//appearing repeatedly is consistently getting through the first line of defence. Aggregating by sender surfaces
//that pattern, which per-message ZAP queries cannot show.
MessagePostDeliveryEvents
| where Timestamp > ago(30d)
| where isnotempty(SenderEmailAddress)
| summarize ZapActions = count(),
MalwareZAP = countif(ActionType == "Malware ZAP"),
PhishZAP = countif(ActionType == "Phish ZAP"),
FirstRemoval = min(Timestamp),
LastRemoval = max(Timestamp)
by SenderEmailAddress
| top 20 by ZapActions
| project ['Teams Sender']=SenderEmailAddress, ['Messages Removed by ZAP']=ZapActions,
['Malware ZAP']=MalwareZAP, ['Phish ZAP']=PhishZAP,
['First Removal']=FirstRemoval, ['Last Removal']=LastRemoval