Detection rules › Kusto

Ping Federate - Unexpected country for user

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

'Detects requests from different countries for user in shotr term.'

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1078 Valid Accounts

Rule body kusto

id: 64e65105-c4fc-4c28-a4e9-bb1a3ce7652d
name: Ping Federate - Unexpected country for user
description: |
  'Detects requests from different countries for user in shotr term.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CefAma
    dataTypes:
      - CommonSecurityLog
queryFrequency: 1h
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1078
query: |
  let known_countries = 
  PingFederateEvent
  | where TimeGenerated between (ago(1d) .. (1h))
  | where isnotempty(DstGeoCountry)
  | summarize makeset(DstGeoCountry);
  PingFederateEvent
  | where isnotempty(DstGeoCountry)
  | where DstGeoCountry !in (known_countries)
  | extend AccountCustomEntity = DstUserName
  | extend IpCustomEntity = SrcIpAddr
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: AccountCustomEntity
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IpCustomEntity
version: 1.0.3
kind: Scheduled

Stages and Predicates

Let binding: known_countries

let known_countries = PingFederateEvent
| where TimeGenerated between (ago(1d) .. (1h))
| where isnotempty(DstGeoCountry)
| summarize makeset(DstGeoCountry);

Stage 1: source

PingFederateEvent

Stage 2: where

| where isnotempty(DstGeoCountry)

Stage 3: where

| where DstGeoCountry !in (known_countries)

References known_countries (defined above).

Stage 4: extend

| extend AccountCustomEntity = DstUserName

Stage 5: extend

| extend IpCustomEntity = SrcIpAddr

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
DstGeoCountryeqknown_countries

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
DstGeoCountryis_not_null
  • (no value, null check)

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
AccountCustomEntityextend
IpCustomEntityextend