Detection rules › Kusto

KnowBe4 Defend - Dangerous Attachment Detected

Status
available
Severity
medium
Time window
30m
Group by
Account_0_FullName, From, SenderIP, Subject, TimeGenerated, timesClicked
Source
github.com/Azure/Azure-Sentinel

'Defend has detected a user has a suspicious file type from a suspicious sender in their mailbox.'

MITRE ATT&CK coverage

Rule body kusto

id: b75a4a7a-dedb-47be-b7e6-344f4d50af19
name: KnowBe4 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: KnowBe4Defend
    datatypes:
      - KnowBe4Defend_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

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ThreatLeveleq
  • dangerous transforms: cased
  • suspicious transforms: cased
nameregex_match
  • (?i)^.*.(doc|docx|docm|pdf|xls|xlsx|xlsm|html|zip)$(?-i)

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
Account_0_FullNamesummarize
Fromsummarize
SenderIPsummarize
Subjectsummarize
TimeGeneratedsummarize
attachmentCountsummarize
timesClickedsummarize