Detection rules › Kusto

Box - Forbidden file type downloaded

Status
available
Severity
medium
Time window
1h
Source
github.com/Azure/Azure-Sentinel

'Detects when new user downloads forbidden file types.'

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1189 Drive-by Compromise

Rule body kusto

id: 8889e69c-2161-412a-94a6-76c1b2d9daa7
name: Box - Forbidden file type downloaded
description: |
  'Detects when new user downloads forbidden file types.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: BoxDataConnector
    dataTypes:
      - BoxEvents_CL
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1189
query: |
  let forbidden_files = dynamic(['ps1', 'bat', 'scr', 'sh']);
  BoxEvents
  | where EventType =~ 'DOWNLOAD'
  | extend file_type = extract(@'\.(\w+)$', 1, SourceItemName)
  | where file_type in (forbidden_files)
  | extend AccountCustomEntity = SrcUserName
  | extend IPCustomEntity = SrcIpAddr
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: AccountCustomEntity
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPCustomEntity
version: 1.0.0
kind: Scheduled

Stages and Predicates

Parameters

let forbidden_files = dynamic(['ps1', 'bat', 'scr', 'sh']);

Stage 1: source

BoxEvents

Stage 2: where

| where EventType =~ 'DOWNLOAD'

Stage 3: extend

| extend file_type = extract(@'\.(\w+)$', 1, SourceItemName)

Stage 4: where

| where file_type in (forbidden_files)

Stage 5: extend

| extend AccountCustomEntity = SrcUserName

Stage 6: extend

| extend IPCustomEntity = SrcIpAddr

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
EventTypeeq
  • DOWNLOAD
file_typein
  • bat transforms: cased
  • ps1 transforms: cased
  • scr transforms: cased
  • sh transforms: cased

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
file_typeextend
AccountCustomEntityextend
IPCustomEntityextend