URL Domains Triggering Microsoft Teams Safety Tips
Description
This query lists the URL domains appearing in Microsoft Teams messages that triggered a safety-tip warning, with each domain's warning rate.
Query · kql
//This query lists URL domains appearing in Microsoft Teams messages that triggered a safety-tip warning over the
//last 30 days, with each domain's total message appearances and warning rate.
//Domains are the actionable artefact: they can be blocked, pivoted on across email, and matched to threat
//intelligence, whereas a sender identity is disposable. A warning rate near 100% is rarely incidental.
//The safety tip is a message-level signal, so where a warned message carried several URLs the tip cannot be
//attributed to one domain. The rate below is the share of messages containing this domain that also carried a URL
//safety tip for any URL in that message.
let WarnedMessages = MessageEvents
| where Timestamp > ago(30d)
| where SafetyTip == "URLMessageWarning"
| distinct TeamsMessageId;
let DomainTotals = MessageUrlInfo
| where Timestamp > ago(30d)
| where isnotempty(UrlDomain)
| summarize TotalMessages = dcount(TeamsMessageId) by UrlDomain;
MessageUrlInfo
| where Timestamp > ago(30d)
| where isnotempty(UrlDomain)
| where TeamsMessageId in (WarnedMessages)
| summarize WarningMessages = dcount(TeamsMessageId), FirstSeen = min(Timestamp), LastSeen = max(Timestamp)
by UrlDomain
| join kind=leftouter (DomainTotals) on UrlDomain
| extend WarningPct = round(100.0 * WarningMessages / TotalMessages, 1)
| top 20 by WarningMessages desc
| project ['URL Domain']=UrlDomain, ['Messages With a URL Safety Tip']=WarningMessages,
['Total Teams Messages']=TotalMessages, ['Messages With a URL Safety Tip %']=WarningPct,
['First Seen']=FirstSeen, ['Last Seen']=LastSeen