This hypothesis targets adversaries leveraging phishing (T1566) to deliver malware, where the detection of quarantined emails indicates successful initial access attempts that were intercepted by email security controls. Proactively hunting for these patterns in Azure Sentinel allows the SOC to identify high-volume or targeted phishing campaigns and refine detection logic to catch threats that may bypass standard quarantine mechanisms.
EmailEvents
| where Timestamp > ago(30d)
| where EmailDirection == "Inbound" and DetectionMethods has 'Malware' and DeliveryLocation == "Quarantine"
| mv-expand Malware = parse_json(DetectionMethods).Malware to typeof(string)
| where isnotempty(Malware)
| summarize count() by Malware
| sort by count_ desc
| render piechart
id: 2d730733-6a56-470f-aa2c-f583611ffb50
name: Quarantine Malware Reason
description: |
This query visualises the total amount of malware emails that are quarantined, summarized by the detection method
description-detailed: |
This query visualises the total amount of malware emails that are quarantined, summarized by the detection method that caught them, using Advanced hunting in Microsoft Defender XDR. It completes the set alongside the equivalent phish and spam quarantine reason queries. Knowing which detection technology is filling quarantine with malware shows where protection is actually working, and a sudden shift in the mix is worth investigating: it usually means either a change in the attacks arriving or a change in which layer is catching them.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
dataTypes:
- EmailEvents
tactics:
- InitialAccess
relevantTechniques:
- T1566
query: |
EmailEvents
| where Timestamp > ago(30d)
| where EmailDirection == "Inbound" and DetectionMethods has 'Malware' and DeliveryLocation == "Quarantine"
| mv-expand Malware = parse_json(DetectionMethods).Malware to typeof(string)
| where isnotempty(Malware)
| summarize count() by Malware
| sort by count_ desc
| render piechart
version: 1.0.0
| Sentinel Table | Notes |
|---|---|
EmailEvents | Ensure this data connector is enabled |
Sandbox Egress Blocking (Cylance Protect / Zscaler)
DetectionSource is “LocalEndpoint” or where the QuarantineLocation is “Device” rather than “Cloud/Gateway”. Alternatively, filter out specific MalwareFamily names known to be false positives in your environment (e.g., GenericML, HeuristicML) if they are consistently benign.Legacy Application Compatibility Mode (Outlook Add-ins / Office 2016)
.tmp or .etl files generated during email rendering or attachment preview. These files are often misidentified as malware due to their unique hash or extension, leading to a quarantine event that is logged as an email-related malware detection.FileExtension is .tmp, .etl, or .log and the FilePath contains \AppData\Local\Temp\ or \Office\. Also, exclude specific MalwareName values like Win32/TempFile or Generic/Temp if they are consistently benign.**Scheduled Backup/Archive Jobs (Veeam / Comm