Kusto Query LanguageMicrosoft Defender for EndpointMicrosoft SentinelSECURE

List Triggered Safe Links Email URL Block

Description

This KQL query lists the emails that have triggered a URL block by safelinks. This is done by collecting the safelinks logs where the action is ClickBlocked and then joining the email events to collect the information about the mail that was send. The URL click of the user will also generate a incident itself, this enriches the information required to investigate this incident.

Note: This query will only give results if safe links is enabled in your environment.

Risk

A phishing campaign has started and a user has clicked the URL, the URL is blocked so the risk is limited.

Query

Microsoft Defender For Endpoint
Kusto
UrlClickEvents
| where ActionType == 'ClickBlocked'
// Only filter on Safe Links actions from mail
| where Workload == 'Email'
// join the email events
| join kind=leftouter (EmailEvents | project NetworkMessageId, Subject, SenderFromAddress) on NetworkMessageId
| project Timestamp, AccountUpn, Product = Workload, Url, ThreatTypes, Subject, SenderFromAddress, UrlChain

Microsoft Sentinel
Kusto
UrlClickEvents
| where ActionType == 'ClickBlocked'
// Only filter on Safe Links actions from mail
| where Workload == 'Email'
// join the email events
| join kind=leftouter (EmailEvents | project NetworkMessageId, Subject, SenderFromAddress) on NetworkMessageId
| project TimeGenerated, AccountUpn, Product = Workload, Url, ThreatTypes, Subject, SenderFromAddress, UrlChain

Leave a Reply

Your email address will not be published. Required fields are marked *