Detection rules › Kusto

Ping Federate - Unusual mail domain.

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

'Detects unusual mail domain in authentication requests.'

MITRE ATT&CK coverage

TacticTechniques
Initial Access

Rule body

id: dc79de7d-2590-4852-95fb-f8e02b34f4da
name: Ping Federate - Unusual mail domain.
description: |
  'Detects unusual mail domain in authentication requests.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CefAma
    dataTypes:
      - CommonSecurityLog
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1078
query: |
  let known_domains = 
  PingFederateEvent
  | where TimeGenerated between (ago(14d) .. (1d))
  | extend email = extract(@'email=(.*?),.*', 1, AdditionalExtensions)
  | extend m_domain = extract(@'@(.*)', 1, email)
  | where isnotempty(m_domain)
  | summarize makeset(m_domain);
  PingFederateEvent
  | extend email = extract(@'email=(.*?),.*', 1, AdditionalExtensions)
  | extend m_domain = extract(@'@(.*)', 1, email)
  | where isnotempty(m_domain)
  | where m_domain !in (known_domains)
  | 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_domains used in Stage 5

let known_domains = PingFederateEvent
| where TimeGenerated between (ago(14d) .. (1d))
| extend email = extract(@'email=(.*?),.*', 1, AdditionalExtensions)
| extend m_domain = extract(@'@(.*)', 1, email)
| where isnotempty(m_domain)
| summarize makeset(m_domain);

Stage 1: source

PingFederateEvent

Stage 2: extend

| extend email = extract(@'email=(.*?),.*', 1, AdditionalExtensions)

Stage 3: extend

| extend m_domain = extract(@'@(.*)', 1, email)

Stage 4: where

| where isnotempty(m_domain)

Stage 5: where

| where m_domain !in (known_domains)

Stage 6: extend

| extend AccountCustomEntity = DstUserName

Stage 7: extend

| extend IpCustomEntity = SrcIpAddr

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
m_domaineqknown_domainsexcludes:m_domain field:"m_domain" value:"known_domains"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
m_domainis_not_null
  • (no value, null check)
field:"m_domain" kind:is_not_null

Output fields

These fields are emitted when the rule matches.

FieldSource
emailextend
m_domainextend
AccountCustomEntityextend
IpCustomEntityextend