Detection rules › Kusto

OracleDBAudit - User connected to database from new IP

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

'Detects when a user connects to database from new IP address.'

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1078 Valid Accounts

Rule body kusto

id: 39a0995e-f4a9-4869-a0ae-36d6d9049bfd
name: OracleDBAudit - User connected to database from new IP
description: |
  'Detects when a user connects to database from new IP address.'
severity: Low
status: Available
requiredDataConnectors:
  - connectorId: SyslogAma
    datatypes:
      - Syslog
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
relevantTechniques:
  - T1078
query: |
  let lbtime_d = 14d;
  let lbtime_24h = 24h;
  OracleDatabaseAuditEvent
  | where TimeGenerated between (ago(lbtime_d) .. ago(lbtime_24h))
  | where isnotempty(SrcIpAddr)
  | where isnotempty(DstUserName)
  | summarize knownIPs = make_set(SrcIpAddr) by DstUserName
  | join (OracleDatabaseAuditEvent
        | where isnotempty(SrcIpAddr)
        | where isnotempty(DstUserName)
        | where DbAction =~ 'connect'
        ) on DstUserName
  | where knownIPs !contains SrcIpAddr
  | project DstUserName, SrcIpAddr
  | 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 lbtime_d = 14d;
let lbtime_24h = 24h;

Stage 1: source

OracleDatabaseAuditEvent

Stage 2: where

| where TimeGenerated between (ago(lbtime_d) .. ago(lbtime_24h))

Stage 3: where

| where isnotempty(SrcIpAddr)

Stage 4: where

| where isnotempty(DstUserName)

Stage 5: summarize

| summarize knownIPs = make_set(SrcIpAddr) by DstUserName

Stage 6: join

| join (OracleDatabaseAuditEvent
      | where isnotempty(SrcIpAddr)
      | where isnotempty(DstUserName)
      | where DbAction =~ 'connect'
      ) on DstUserName

Stage 7: where

| where knownIPs !contains SrcIpAddr

Stage 8: project

| project DstUserName, SrcIpAddr

Stage 9: extend

| extend AccountCustomEntity = DstUserName

Stage 10: extend

| extend IPCustomEntity = SrcIpAddr

Exclusions

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

FieldKindExcluded values
knownIPscontainsSrcIpAddr

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
DbActioneq
  • connect
DstUserNameis_not_null
  • (no value, null check)
SrcIpAddris_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
DstUserNameproject
SrcIpAddrproject
AccountCustomEntityextend
IPCustomEntityextend