Detection rules › Kusto
OracleDBAudit - Connection to database from external IP
'Detects when connection to database is from external IP source.'
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Collection | |
| Exfiltration |
Rule body
id: 54aa2c17-acfd-4e3a-a1c4-99c88cf34ebe
name: OracleDBAudit - Connection to database from external IP
description: |
'Detects when connection to database is from external IP source.'
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: SyslogAma
datatypes:
- Syslog
queryFrequency: 30m
queryPeriod: 30m
triggerOperator: gt
triggerThreshold: 0
tactics:
- InitialAccess
- Collection
- Exfiltration
relevantTechniques:
- T1190
- T1133
- T1078
- T1119
- T1029
query: |
OracleDatabaseAuditEvent
| where isnotempty(SrcIpAddr)
| where isnotempty(Action)
| where DbAction =~ 'connect'
| where ipv4_is_private(SrcIpAddr) == 'false'
| 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
Stage 1: source
OracleDatabaseAuditEvent
Stage 2: where
| where isnotempty(SrcIpAddr)
Stage 3: where
| where isnotempty(Action)
Stage 4: where
| where DbAction =~ 'connect'
Stage 5: where
| where ipv4_is_private(SrcIpAddr) == 'false'
Stage 6: extend
| extend AccountCustomEntity = DstUserName
Stage 7: extend
| extend IPCustomEntity = SrcIpAddr
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
SrcIpAddr | cidr_match | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 127.0.0.0/8 | excludes:SrcIpAddr |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Action | is_not_null | field:"Action" kind:is_not_null | |
DbAction | eq |
| field:"DbAction" kind:eq value:"connect" |
SrcIpAddr | is_not_null | field:"src_ip" kind:is_not_null |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
AccountCustomEntity | extend |
IPCustomEntity | extend |