← Back to SOC feed Coverage →

Safe Attachments detections

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-09T23:00:01Z · Confidence: medium

Hunt Hypothesis

Adversaries may use Safe Attachments to bypass email security controls and exfiltrate data, leveraging this technique to evade detection. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential data exfiltration attempts and mitigate advanced persistent threats.

KQL Query

EmailEvents
| where DetectionMethods != "" 
| extend detection= tostring(parse_json(DetectionMethods).Phish) 
| where detection has "File detonation reputation" or detection has "File detonation"
| summarize total=count() by bin(Timestamp, 1d) 
| order by Timestamp asc

Analytic Rule Definition

id: 16eda414-1550-4cdc-8512-0769901d3f05
name: Safe Attachments detections
description: |
  This query provides insights on the detections done by Safe Attachment detections
description-detailed: |
  This query provides insights on the detections done by Safe Attachment detections.
  Reference - https://learn.microsoft.com/en-us/defender-office-365/safe-attachments-about
requiredDataConnectors:
  - connectorId: MicrosoftThreatProtection
    dataTypes:
      - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  EmailEvents
  | where DetectionMethods != "" 
  | extend detection= tostring(parse_json(DetectionMethods).Phish) 
  | where detection has "File detonation reputation" or detection has "File detonation"
  | summarize total=count() by bin(Timestamp, 1d) 
  | order by Timestamp asc
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/Attachment/Safe attachment detection.yaml