← Back to SOC feed Coverage →

Automated Remediation Efficiency Over Time

kql MEDIUM Azure-Sentinel
T1566
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-09-03T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis targets adversaries who exploit the gap between initial email delivery and automated remediation to execute malicious payloads before Defender for Office 365 can isolate or delete the message. Proactively hunting for this behavior allows the SOC to identify persistent failure patterns or high-volume success rates that may indicate misconfigured policies, targeted evasion tactics, or compromised mailboxes that are slipping through automated defenses.

KQL Query

EmailPostDeliveryEvents
| where Timestamp > ago(30d)
| where ActionType == "Automated Remediation"
| extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
| summarize arg_max(Timestamp, *) by Key
| summarize Count = count() by bin(Timestamp, 1d), ActionResult
| render timechart

Analytic Rule Definition

id: e189343d-f3f1-4d2d-a82e-29b4619d9091
name: Automated Remediation Efficiency Over Time
description: |
  This query trends the outcome (success versus failure) of Microsoft Defender for Office 365 automated remediation actions over time, using the EmailPostDeliveryEvents table.
description-detailed: |
  Automated Investigation and Response (AIR) can remediate malicious mail after delivery. This query counts automated remediation events by result over time, deduplicated to the latest event per message and recipient, so SOC teams can see whether automated remediation is succeeding and spot spikes in failures that warrant attention.
  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:
  - EmailPostDeliveryEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  EmailPostDeliveryEvents
  | where Timestamp > ago(30d)
  | where ActionType == "Automated Remediation"
  | extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
  | summarize arg_max(Timestamp, *) by Key
  | summarize Count = count() by bin(Timestamp, 1d), ActionResult
  | render timechart
version: 1.0.0

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/Remediation/Automated Remediation Efficiency Over Time.yaml