Detection rules › Kusto

OracleDBAudit - Connection to database from unknown IP

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

'Detects when user connects to a database from IP address which is not present in AllowList.'

MITRE ATT&CK coverage

TacticTechniques
Initial Access

Rule body

id: 80b1dd6d-1aea-471e-be7a-a4a0afdeec80
name: OracleDBAudit - Connection to database from unknown IP
description: |
  'Detects when user connects to a database from IP address which is not present in AllowList.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SyslogAma
    datatypes:
      - Syslog
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1078
query: |
  let ip_allowlist = dynamic(['127.0.0.2']);
  OracleDatabaseAuditEvent
  | where isnotempty(SrcIpAddr)
  | where DbAction =~ 'CONNECT'
  | where SrcIpAddr !in (ip_allowlist)
  | project SrcIpAddr, DstUserName
  | extend AccountCustomEntity = DstUserName
  | extend IPCustomEntity = SrcIpAddr
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: AccountCustomEntity
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPCustomEntity
version: 1.0.2
kind: Scheduled

Stages and Predicates

Parameters

let ip_allowlist = dynamic(['127.0.0.2']);

Stage 1: source

OracleDatabaseAuditEvent

Stage 2: where

| where isnotempty(SrcIpAddr)

Stage 3: where

| where DbAction =~ 'CONNECT'

Stage 4: where

| where SrcIpAddr !in (ip_allowlist)

Stage 5: project

| project SrcIpAddr, DstUserName

Stage 6: extend

| extend AccountCustomEntity = DstUserName

Stage 7: extend

| extend IPCustomEntity = SrcIpAddr

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
SrcIpAddreqip_allowlistexcludes:SrcIpAddr field:"SrcIpAddr" value:"ip_allowlist"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
DbActioneq
  • CONNECT
field:"DbAction" kind:eq value:"CONNECT"
SrcIpAddris_not_null
  • (no value, null check)
field:"src_ip" kind:is_not_null

Output fields

These fields are emitted when the rule matches.

FieldSource
DstUserNameproject
SrcIpAddrproject
AccountCustomEntityextend
IPCustomEntityextend