Detection rules › Kusto

OracleDBAudit - Unusual user activity on multiple tables

Status
available
Severity
medium
Time window
5m
Group by
DstUserName, bucket
Source
github.com/Azure/Azure-Sentinel

'Detects when user queries many tables in short period of time.'

MITRE ATT&CK coverage

TacticTechniques
Collection

Rule body

id: 75024e1c-26e7-4e73-821d-95e5decdd8db
name: OracleDBAudit - Unusual user activity on multiple tables 
description: |
  'Detects when user queries many tables in short period of time.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SyslogAma
    datatypes:
      - Syslog
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Collection
relevantTechniques:
  - T1119
query: |
  let tbl_threshold = 10;
  OracleDatabaseAuditEvent
  | where isnotempty(DstUserName)
  | where DbAction =~ 'SELECT'
  | extend TableName = replace(@'[,\(\)]', '', extract(@'(?i)SELECT(.*?)FROM\s(.*?)\s', 2, Action))
  | where isnotempty(TableName)
  | where TableName !~ 'SELECT'
  | summarize tbl_count = dcount(TableName) by DstUserName, bucket = bin(TimeGenerated, 5m)
  | where tbl_count > tbl_threshold
  | extend AccountCustomEntity = DstUserName
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: AccountCustomEntity
version: 1.0.2
kind: Scheduled

Stages and Predicates

Parameters

let tbl_threshold = 10;

Stage 1: source

OracleDatabaseAuditEvent

Stage 2: where

| where isnotempty(DstUserName)

Stage 3: where

| where DbAction =~ 'SELECT'

Stage 4: extend

| extend TableName = replace(@'[,\(\)]', '', extract(@'(?i)SELECT(.*?)FROM\s(.*?)\s', 2, Action))

Stage 5: where

| where isnotempty(TableName)

Stage 6: where

| where TableName !~ 'SELECT'

Stage 7: summarize

| summarize tbl_count = dcount(TableName) by DstUserName, bucket = bin(TimeGenerated, 5m)

Stage 8: where

| where tbl_count > tbl_threshold

Stage 9: extend

| extend AccountCustomEntity = DstUserName

Indicators

These rows show field, operator, and value matches.

Output fields

These fields are emitted when the rule matches.

FieldSource
DstUserNamesummarize
bucketsummarize
tbl_countsummarize
AccountCustomEntityextend