← Back to SOC feed Coverage →

First-Contact External Email Senders

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

Hunt Hypothesis

This hypothesis targets initial access attempts via phishing (T1566), where adversaries establish new external email relationships to deliver malicious payloads or harvest credentials. Proactively hunting for these first-contact senders allows the SOC to identify and validate suspicious external actors before they progress to subsequent stages of the kill chain, such as credential theft or lateral movement.

KQL Query

// TIP: to hide your own accepted domains, uncomment the ExcludeDomains line and the matching where-clause.
// let ExcludeDomains = dynamic(["contoso.com", "fabrikam.com"]);
EmailEvents
| where Timestamp > ago(30d)
| where EmailDirection == "Inbound" and isnotempty(SenderFromAddress)
| extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
| summarize arg_max(Timestamp, *) by Key
| extend SenderDomain = tostring(split(SenderFromAddress, '@')[1])
// | where SenderDomain !in~ (ExcludeDomains)
| summarize FirstSeen = min(Timestamp), Messages = count(), ThreatMessages = countif(isnotempty(ThreatTypes)) by SenderFromAddress, SenderDomain
| top 20 by FirstSeen desc
| project Sender = SenderFromAddress, SenderDomain, FirstSeen, Messages, ThreatMessages

Analytic Rule Definition

id: a7373b95-2471-4169-9bca-412d6c41334d
name: First-Contact External Email Senders
description: |
  This query lists external email senders seen for the first time in the period (most recent first), surfacing new first-contact relationships, using the EmailEvents table.
description-detailed: |
  New or first-contact sender relationships, especially ones already carrying threats, are a common precursor to phishing, business email compromise (BEC) and supply-chain attacks. This query lists inbound external senders ordered by when they were first seen in the period, with their message and threat counts. In tenants with longer history this highlights genuinely new relationships worth reviewing.
  This query is part of the Microsoft Defender for Office 365 Detections and Insights workbook in Microsoft Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-3-build-custom-email-security-reports-with-power-bi-and-workbooks-in-micros/4490127
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  // TIP: to hide your own accepted domains, uncomment the ExcludeDomains line and the matching where-clause.
  // let ExcludeDomains = dynamic(["contoso.com", "fabrikam.com"]);
  EmailEvents
  | where Timestamp > ago(30d)
  | where EmailDirection == "Inbound" and isnotempty(SenderFromAddress)
  | extend Key = strcat(NetworkMessageId, '-', RecipientEmailAddress)
  | summarize arg_max(Timestamp, *) by Key
  | extend SenderDomain = tostring(split(SenderFromAddress, '@')[1])
  // | where SenderDomain !in~ (ExcludeDomains)
  | summarize FirstSeen = min(Timestamp), Messages = count(), ThreatMessages = countif(isnotempty(ThreatTypes)) by SenderFromAddress, SenderDomain
  | top 20 by FirstSeen desc
  | project Sender = SenderFromAddress, SenderDomain, FirstSeen, Messages, ThreatMessages
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/Mailflow/First-Contact External Email Senders.yaml