Detection rules › Kusto
OracleDBAudit - User connected to database from new IP
'Detects when a user connects to database from new IP address.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | T1078 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.
| Field | Kind | Excluded values |
|---|---|---|
knownIPs | contains | SrcIpAddr |
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.
| Field | Kind | Values |
|---|---|---|
DbAction | eq |
|
DstUserName | is_not_null | |
SrcIpAddr | is_not_null |
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.
| Field | Source |
|---|---|
DstUserName | project |
SrcIpAddr | project |
AccountCustomEntity | extend |
IPCustomEntity | extend |