← Back to SOC feed Coverage →

Microsoft Teams External versus Internal Thread Exposure

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 rule identifies Microsoft Teams threads where internal conversations are exposed to external participants, a common vector for phishing or data exfiltration under MITRE technique T1566. Proactively hunting for these exposures allows the SOC to detect unauthorized sharing of sensitive internal communications before they lead to credential compromise or information leakage.

KQL Query

//This query shows de-duplicated Microsoft Teams messages split by whether the thread includes external participants.
MessageEvents
| where Timestamp > ago(30d)
| summarize arg_max(Timestamp, *) by TeamsMessageId
| extend Thread = iif(IsExternalThread == true, "External Thread", "Internal Thread")
| summarize Count = count() by Thread
| render piechart

Analytic Rule Definition

id: b26c8461-8c9e-47ff-8b61-fe0f1fb8eea4
name: Microsoft Teams External versus Internal Thread Exposure
description: |
  This query shows de-duplicated Microsoft Teams messages split by whether the thread includes external participants.
description-detailed: |
  This query shows de-duplicated Microsoft Teams messages split by whether the thread includes external participants, using Advanced hunting in Microsoft Defender XDR. External threads carry the higher risk of social-engineering and malicious content.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - MessageEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  //This query shows de-duplicated Microsoft Teams messages split by whether the thread includes external participants.
  MessageEvents
  | where Timestamp > ago(30d)
  | summarize arg_max(Timestamp, *) by TeamsMessageId
  | extend Thread = iif(IsExternalThread == true, "External Thread", "Internal Thread")
  | summarize Count = count() by Thread
  | render piechart
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/Microsoft Teams protection/Microsoft Teams External versus Internal Thread Exposure.yaml