Detection rules › Kusto

Zscaler - ZPA connections from new country

Status
available
Severity
medium
Time window
14d
Group by
DstUserName, SrcGeoCountry
Source
github.com/Azure/Azure-Sentinel

'Detects ZPA connections from new country.'

MITRE ATT&CK coverage

Rule body

id: c4902121-7a7e-44d1-810b-88d26db622ff
name: Zscaler - ZPA connections from new country
description: |
  'Detects ZPA connections from new country.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CustomLogsAma
    datatypes:
      - ZPA_CL
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1190
  - T1133
query: |
  let listCountries =
  ZPAEvent 
  | where TimeGenerated > ago(14d)
  | where DvcAction == 'open'
  | summarize ListofCountries = make_set(SrcGeoCountry) by DstUserName
  | project ListofCountries;
  ZPAEvent
  | where isnotempty(SrcGeoCountry)
  | where SrcGeoCountry !in (listCountries)
  | summarize EventCount = count() by DstUserName, SrcGeoCountry
  | project-away EventCount
  | extend AccountCustomEntity = DstUserName
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: AccountCustomEntity
version: 1.0.2
kind: Scheduled

Stages and Predicates

Let binding: listCountries used in Stage 3

let listCountries = ZPAEvent 
| where TimeGenerated > ago(14d)
| where DvcAction == 'open'
| summarize ListofCountries = make_set(SrcGeoCountry) by DstUserName
| project ListofCountries;

Stage 1: source

ZPAEvent

Stage 2: where

| where isnotempty(SrcGeoCountry)

Stage 3: where

| where SrcGeoCountry !in (listCountries)

Stage 4: summarize

| summarize EventCount = count() by DstUserName, SrcGeoCountry

Stage 5: project-away

| project-away EventCount

Stage 6: extend

| extend AccountCustomEntity = DstUserName

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
SrcGeoCountryeqlistCountriesexcludes:SrcGeoCountry field:"SrcGeoCountry" value:"listCountries"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
SrcGeoCountryis_not_null
  • (no value, null check)
field:"SrcGeoCountry" kind:is_not_null

Output fields

These fields are emitted when the rule matches.

FieldSource
DstUserNamesummarize
SrcGeoCountrysummarize
AccountCustomEntityextend