Detection rules › Kusto

VMware ESXi - Multiple VMs stopped

Status
available
Severity
medium
Time window
5m
Group by
SrcUsername
Source
github.com/Azure/Azure-Sentinel

'Detects when multiple VMs ware stopped by user.'

MITRE ATT&CK coverage

TacticTechniques
ImpactT1529 System Shutdown/Reboot

Rule body kusto

id: 5fe1af14-cd40-48ff-b581-3a12a1f90785
name: VMware ESXi - Multiple VMs stopped
description: |
  'Detects when multiple VMs ware stopped by user.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SyslogAma
    datatypes:
      - Syslog
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Impact
relevantTechniques:
  - T1529
query: |
  let threshold = 5;
  VMwareESXi
  | where SyslogMessage has ('VmPoweredOffEvent')
  | extend SrcUsername = extract(@'\[info\]\s+\[(.*?)\]', 1, SyslogMessage)
  | extend DstHostname = extract(@'\[\d+\]\s+\[(.*?)\s+on', 1, SyslogMessage)
  | summarize st_vm = make_set(DstHostname,200) by SrcUsername, bin(TimeGenerated, 5m)
  | where array_length(st_vm) > threshold
  | extend hostname = iff(array_length(st_vm) > 0, st_vm[0], "")
  | extend NTDomain = tostring(split(hostname, '\\', 0)[0]), Name = tostring(split(SrcUsername, '\\', 1)[0]), HostName = tostring(split(hostname, '.', 0)[0]), DnsDomain = tostring(split(SrcUsername, '\\', 1)[0])
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: Name
      - identifier: DnsDomain
        columnName: DnsDomain
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: HostName
      - identifier: NTDomain
        columnName: NTDomain
version: 1.0.3
kind: Scheduled

Stages and Predicates

Parameters

let threshold = 5;

Stage 1: source

VMwareESXi

Stage 2: where

| where SyslogMessage has ('VmPoweredOffEvent')

Stage 3: extend

| extend SrcUsername = extract(@'\[info\]\s+\[(.*?)\]', 1, SyslogMessage)

Stage 4: extend

| extend DstHostname = extract(@'\[\d+\]\s+\[(.*?)\s+on', 1, SyslogMessage)

Stage 5: summarize

| summarize st_vm = make_set(DstHostname,200) by SrcUsername, bin(TimeGenerated, 5m)
Threshold
gt 5

Stage 6: where

| where array_length(st_vm) > threshold

Stage 7: extend

| extend hostname = iff(array_length(st_vm) > 0, st_vm[0], "")
hostname =
ifst_vm > 0st_vm[0]
else""

Stage 8: extend

| extend NTDomain = tostring(split(hostname, '\\', 0)[0]), Name = tostring(split(SrcUsername, '\\', 1)[0]), HostName = tostring(split(hostname, '.', 0)[0]), DnsDomain = tostring(split(SrcUsername, '\\', 1)[0])

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
SyslogMessagematch
  • VmPoweredOffEvent transforms: term
st_vmgt
  • 5 transforms: array_length

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
SrcUsernamesummarize
st_vmsummarize
hostnameextend
DnsDomainextend
HostNameextend
NTDomainextend
Nameextend