← Back to SOC feed Coverage →

Quarantine releases by Detection Types

kql MEDIUM Azure-Sentinel
T1566
EmailEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-17T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use quarantine release actions to exfiltrate data or re-infect systems by reactivating malicious payloads that were previously isolated. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential data exfiltration or persistence tactics leveraging quarantine bypass techniques.

KQL Query

let totalQuery = EmailPostDeliveryEvents
| where Action == "Quarantine release"
| join kind=inner (EmailEvents | where DeliveryLocation == "Quarantine") on NetworkMessageId
| extend MDO_detection = parse_json(DetectionMethods1)
| extend FirstDetection = iif(isempty(MDO_detection), "Clean", tostring(bag_keys(MDO_detection)[0]))
| extend FirstSubcategory = iif(FirstDetection != "Clean" and array_length(MDO_detection[FirstDetection]) > 0, strcat(FirstDetection, ": ", tostring(MDO_detection[FirstDetection][0])), "No Detection (clean)")
| where FirstSubcategory contains "Malware" or FirstSubcategory contains "Phish" or FirstSubcategory contains "Spam"
| count;
EmailPostDeliveryEvents
| where Action == "Quarantine release"
| join kind=inner (EmailEvents | where DeliveryLocation == "Quarantine") on NetworkMessageId
| extend MDO_detection = parse_json(DetectionMethods1)
| extend FirstDetection = iif(isempty(MDO_detection), "Clean", tostring(bag_keys(MDO_detection)[0]))
| extend FirstSubcategory = iif(FirstDetection != "Clean" and array_length(MDO_detection[FirstDetection]) > 0, strcat(FirstDetection, ": ", tostring(MDO_detection[FirstDetection][0])), "No Detection (clean)")
| where FirstSubcategory contains "Malware" or FirstSubcategory contains "Phish" or FirstSubcategory contains "Spam"
| summarize count_messages = count() by FirstSubcategory
| project FirstSubcategory, count_messages
| order by count_messages desc
| render piechart

Analytic Rule Definition

id: 87754d3a-0077-4ff9-b46e-6336b8d02287
name: Quarantine releases by Detection Types
description: |
  This query visualises emails released from quarantine and summarizing the result by the original filter verdict
description-detailed: |
  This query visualises emails released from quarantine and summarizing the result by the original filter verdict
  Query is also included as part of the Defender for Office 365 solution in Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-2-build-custom-email-security-reports-and-dashboards-with-workbooks-in-micr/4411303
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailEvents
  - EmailPostDeliveryEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  let totalQuery = EmailPostDeliveryEvents
  | where Action == "Quarantine release"
  | join kind=inner (EmailEvents | where DeliveryLocation == "Quarantine") on NetworkMessageId
  | extend MDO_detection = parse_json(DetectionMethods1)
  | extend FirstDetection = iif(isempty(MDO_detection), "Clean", tostring(bag_keys(MDO_detection)[0]))
  | extend FirstSubcategory = iif(FirstDetection != "Clean" and array_length(MDO_detection[FirstDetection]) > 0, strcat(FirstDetection, ": ", tostring(MDO_detection[FirstDetection][0])), "No Detection (clean)")
  | where FirstSubcategory contains "Malware" or FirstSubcategory contains "Phish" or FirstSubcategory contains "Spam"
  | count;
  EmailPostDeliveryEvents
  | where Action == "Quarantine release"
  | join kind=inner (EmailEvents | where DeliveryLocation == "Quarantine") on NetworkMessageId
  | extend MDO_detection = parse_json(DetectionMethods1)
  | extend FirstDetection = iif(isempty(MDO_detection), "Clean", tostring(bag_keys(MDO_detection)[0]))
  | extend FirstSubcategory = iif(FirstDetection != "Clean" and array_length(MDO_detection[FirstDetection]) > 0, strcat(FirstDetection, ": ", tostring(MDO_detection[FirstDetection][0])), "No Detection (clean)")
  | where FirstSubcategory contains "Malware" or FirstSubcategory contains "Phish" or FirstSubcategory contains "Spam"
  | summarize count_messages = count() by FirstSubcategory
  | project FirstSubcategory, count_messages
  | order by count_messages desc
  | render piechart
version: 1.0.0

Required Data Sources

Sentinel TableNotes
EmailEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Email and Collaboration Queries/Quarantine/Quarantine releases by Detection types.yaml