Email Top 15 Targeted Users (Spam) with Additional Details


Description

This query visualises top 15 users targeted with Spam with summarized spam detections.

Query · kql

//This query visualises total inbound emails with Spam detections summarizing the data by the top 15 recipient email address (RecipientEmailAddress).
EmailEvents
| where Timestamp > ago(30d)
| where OrgLevelPolicy != "Phishing simulation" and OrgLevelPolicy != "SecOps Mailbox"
| where EmailDirection == "Inbound"
| extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
| summarize arg_max(Timestamp, *) by Key
| summarize TotalEmailCount = count(), SpamEmailCount = countif(ThreatTypes has "Spam") by RecipientEmailAddress
| extend Bad_Traffic_Percentage_Inbound = round(100.0 * SpamEmailCount / TotalEmailCount, 2)
| where SpamEmailCount != 0
| top 15 by SpamEmailCount
| project RecipientEmailAddress, SpamEmailCount, TotalEmailCount, Bad_Traffic_Percentage_Inbound
Raw source Email Top 15 Targeted Users (Spam) with Additional Details · KQL
Esc
Published by Azure/Azure-Sentinel ↗, licensed under MIT ↗. Reproduced here unmodified.
id: 3e33ce02-b74e-49cc-899d-0a1eb3128ee3
name: Email Top 15 Targeted Users (Spam) with Additional Details
description: |
  This query visualises top 15 users targeted with Spam with summarized spam detections.
description-detailed: |
  This query visualises total inbound emails with Spam detections summarizing the data by the top 15 recipient email address (RecipientEmailAddress).
  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 inbound emails with Spam detections summarizing the data by the top 15 recipient email address (RecipientEmailAddress).
  EmailEvents
  | where Timestamp > ago(30d)
  | where OrgLevelPolicy != "Phishing simulation" and OrgLevelPolicy != "SecOps Mailbox"
  | where EmailDirection == "Inbound"
  | extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
  | summarize arg_max(Timestamp, *) by Key
  | summarize TotalEmailCount = count(), SpamEmailCount = countif(ThreatTypes has "Spam") by RecipientEmailAddress
  | extend Bad_Traffic_Percentage_Inbound = round(100.0 * SpamEmailCount / TotalEmailCount, 2)
  | where SpamEmailCount != 0
  | top 15 by SpamEmailCount
  | project RecipientEmailAddress, SpamEmailCount, TotalEmailCount, Bad_Traffic_Percentage_Inbound
version: 1.1.0

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.