Detection rules › Kusto

Ubiquiti - Unusual DNS connection

Status
available
Severity
medium
Time window
1h
Group by
DstIpAddr, SrcIpAddr
Source
github.com/Azure/Azure-Sentinel

'Detects unusual remote to local (R2L) DNS connections.'

MITRE ATT&CK coverage

TacticTechniques
Command & Control

Rule body

id: 14a23ded-7fb9-48ee-ba39-859517a49b51
name: Ubiquiti - Unusual DNS connection
description: |
  'Detects unusual remote to local (R2L) DNS connections.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: CustomLogsAma
    dataTypes:
      - Ubiquiti_CL
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - CommandAndControl
relevantTechniques:
  - T1090
  - T1572
query: |
  let threshold = 50;
  UbiquitiAuditEvent
  | where EventCategory =~ 'firewall'
  | where ipv4_is_private(SrcIpAddr) == 'False'
  | where ipv4_is_private(DstIpAddr)
  | where DstPortNumber == '53'
  | summarize count() by SrcIpAddr, DstIpAddr
  | where count_ > threshold
  | extend IPCustomEntity = DstIpAddr
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPCustomEntity
version: 1.0.2
kind: Scheduled

Stages and Predicates

Parameters

let threshold = 50;

Stage 1: source

UbiquitiAuditEvent

Stage 2: where

| where EventCategory =~ 'firewall'

Stage 3: where

| where ipv4_is_private(SrcIpAddr) == 'False'

Stage 4: where

| where ipv4_is_private(DstIpAddr)

Stage 5: where

| where DstPortNumber == '53'

Stage 6: summarize

| summarize count() by SrcIpAddr, DstIpAddr

Stage 7: where

| where count_ > threshold

Stage 8: extend

| extend IPCustomEntity = DstIpAddr

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
SrcIpAddrcidr_match10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8excludes:SrcIpAddr

Indicators

These rows show field, operator, and value matches.

Output fields

These fields are emitted when the rule matches.

FieldSource
DstIpAddrsummarize
SrcIpAddrsummarize
IPCustomEntityextend