This hypothesis targets potential phishing or spearphishing campaigns (T1566) where attackers craft convincing messages that bypass initial automated filters, leading to a high rate of user-initiated releases from quarantine. Proactively hunting for this anomaly in Azure Sentinel helps identify targeted attacks or compromised user judgment that standard threshold alerts might miss, ensuring timely investigation of suspicious email traffic.
let Quarantine_Releases = toscalar(EmailPostDeliveryEvents
| where Timestamp > ago(30d)
| where Action == "Quarantine release"
| distinct NetworkMessageId, RecipientEmailAddress
| count);
let Quarantined_Mailflow = toscalar(EmailEvents
| where Timestamp > ago(30d)
| where DeliveryLocation == "Quarantine"
| distinct NetworkMessageId, RecipientEmailAddress
| count);
print
Quarantine_Releases = toreal(Quarantine_Releases),
Quarantined_Mailflow = toreal(Quarantined_Mailflow),
Release_Percentage = iff(Quarantined_Mailflow == 0, 0.0, round((toreal(Quarantine_Releases) / toreal(Quarantined_Mailflow)) * 100, 2))
id: 5fb333a4-39bb-474b-ab37-9efdca8e9182
name: Quarantine Release Percentage
description: |
This query calculates the percentage of quarantined emails that were subsequently released, out of the total quarantined.
description-detailed: |
This query calculates the percentage of quarantined emails in Microsoft Defender for Office 365 that were subsequently released (EmailPostDeliveryEvents Action == "Quarantine release") out of the total quarantined (EmailEvents DeliveryLocation == "Quarantine"). The percentage is guarded against a zero denominator.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
dataTypes:
- EmailEvents
- EmailPostDeliveryEvents
tactics:
- InitialAccess
relevantTechniques:
- T1566
query: |
let Quarantine_Releases = toscalar(EmailPostDeliveryEvents
| where Timestamp > ago(30d)
| where Action == "Quarantine release"
| distinct NetworkMessageId, RecipientEmailAddress
| count);
let Quarantined_Mailflow = toscalar(EmailEvents
| where Timestamp > ago(30d)
| where DeliveryLocation == "Quarantine"
| distinct NetworkMessageId, RecipientEmailAddress
| count);
print
Quarantine_Releases = toreal(Quarantine_Releases),
Quarantined_Mailflow = toreal(Quarantined_Mailflow),
Release_Percentage = iff(Quarantined_Mailflow == 0, 0.0, round((toreal(Quarantine_Releases) / toreal(Quarantined_Mailflow)) * 100, 2))
version: 1.0.0
| Sentinel Table | Notes |
|---|---|
EmailEvents | Ensure this data connector is enabled |
Bulk Release by Exchange Online Admins via PowerShell
New-QuarantineRelease or Release-QuarantinedMessage) to batch-release legitimate newsletters or internal announcements that were incorrectly flagged by the anti-phishing policy. This creates a high volume of releases in a short window, skewing the percentage.Operation is “Release” and the UserAgent or ClientIP matches known admin service accounts (e.g., svc-exchange-admin, admin@domain.com) or specific PowerShell script names (e.g., DailyQuarantineCleanup.ps1).User Self-Service Release via Outlook Web App (OWA) or Outlook Client
Source is “User” or “OWA” and the MessageCount per user in the aggregation window is below a defined threshold (e.g., < 5 messages per user per hour).Conditional Access or DLP Policy Exemptions