← Back to SOC feed Coverage →

Spam detection trend

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 be using spam campaigns to distribute malicious content, leveraging email as a vector for initial compromise. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential phishing or malware distribution efforts early.

KQL Query

//This query visualises total emails with Spam detections over time summarizing the data daily.
EmailEvents
| where ThreatTypes has "Spam"
| make-series Count = count() default = 0 on Timestamp step 1d
// | render timechart // Uncomment this line to render as a graph

Analytic Rule Definition

id: 2b373bca-b491-4b2f-906e-6f42eeab01a1
name: Spam detection trend
description: |
  This query visualises total emails with Spam detections over time summarizing the data daily
description-detailed: |
  This query visualises total emails with Spam detections over time summarizing the data daily in Microsoft Defender for Office 365. Visualize with chart type "Line".
  Taken from the the Microsoft Defender for Office 365 Detections and Insights - Microsoft Sentinel workbook.
  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
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  //This query visualises total emails with Spam detections over time summarizing the data daily.
  EmailEvents
  | where ThreatTypes has "Spam"
  | make-series Count = count() default = 0 on Timestamp step 1d
  // | render timechart // Uncomment this line to render as a graph
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/Spam/Spam Detection Trend.yaml