Detection rules › Kusto
Egress Defend - Dangerous Attachment Detected
'Defend has detected a user has a suspicious file type from a suspicious sender in their mailbox.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Execution | |
| Persistence | |
| Privilege Escalation | |
| Execution |
Rule body
id: a0e55dd4-8454-4396-91e6-f28fec3d2cab
name: Egress Defend - Dangerous Attachment Detected
description: |
'Defend has detected a user has a suspicious file type from a suspicious sender in their mailbox.'
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: EgressDefend
dataTypes:
- EgressDefend_CL
queryFrequency: 30m
queryPeriod: 30m
triggerOperator: gt
triggerThreshold: 0
tactics:
- Execution
- InitialAccess
- Persistence
- PrivilegeEscalation
relevantTechniques:
- T1204
- T0853
- T0863
- T1566
- T1546
- T1546
tags:
- Defend
query: |
DefendAuditData
| where ThreatLevel == "suspicious" or ThreatLevel == "dangerous"
| mv-expand todynamic(Attachments)
| where Attachments.name matches regex @"(?i)^.*\.(doc|docx|docm|pdf|xls|xlsx|xlsm|html|zip)$(?-i)"
| summarize attachmentCount=count() by TimeGenerated, tostring(Attachments.name), Subject, From, Account_0_FullName = trim(@"[^@.\w]+",Recipients), timesClicked = LinksClicked, SenderIP
entityMappings:
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: Account_0_FullName
- entityType: File
fieldMappings:
- identifier: Name
columnName: Attachments_name
- entityType: Mailbox
fieldMappings:
- identifier: MailboxPrimaryAddress
columnName: Account_0_FullName
- entityType: IP
fieldMappings:
- identifier: Address
columnName: SenderIP
alertDetailsOverride:
alertDisplayNameFormat: Alert - {{Account_0_FullName}} has suspicious attachment.
version: 1.0.0
kind: Scheduled
Stages and Predicates
Stage 1: source
DefendAuditData
Stage 2: where
| where ThreatLevel == "suspicious" or ThreatLevel == "dangerous"
Stage 3: mv-expand
| mv-expand todynamic(Attachments)
Stage 4: where
| where Attachments.name matches regex @"(?i)^.*\.(doc|docx|docm|pdf|xls|xlsx|xlsm|html|zip)$(?-i)"
Stage 5: summarize
| summarize attachmentCount=count() by TimeGenerated, tostring(Attachments.name), Subject, From, Account_0_FullName = trim(@"[^@.\w]+",Recipients), timesClicked = LinksClicked, SenderIP
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
ThreatLevel | eq |
| field:"ThreatLevel" kind:eq |
name | regex_match |
| field:"name" kind:regex_match value:"(?i)^.*.(doc|docx|docm|pdf|xls|xlsx|xlsm|html|zip)$(?-i)" |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Account_0_FullName | summarize |
From | summarize |
SenderIP | summarize |
Subject | summarize |
TimeGenerated | summarize |
attachmentCount | summarize |
timesClicked | summarize |