let threshold = 5;
OCILogs
| where EventType contains 'vcn.flowlogs'
| where data_action_s =~ 'REJECT'
| where ipv4_is_private(DstIpAddr)
| where ipv4_is_private(SrcIpAddr) == False
| where DstPortNumber == 22
| summarize p_count = dcount(DstIpAddr) by SrcIpAddr, bin(TimeGenerated, 5m)
| where p_count > threshold
| extend IPCustomEntity = SrcIpAddr
severity: High
triggerThreshold: 0
query: |
let threshold = 5;
OCILogs
| where EventType contains 'vcn.flowlogs'
| where data_action_s =~ 'REJECT'
| where ipv4_is_private(DstIpAddr)
| where ipv4_is_private(SrcIpAddr) == False
| where DstPortNumber == 22
| summarize p_count = dcount(DstIpAddr) by SrcIpAddr, bin(TimeGenerated, 5m)
| where p_count > threshold
| extend IPCustomEntity = SrcIpAddr
queryFrequency: 1h
requiredDataConnectors:
- connectorId: OracleCloudInfrastructureLogsConnector
dataTypes:
- OCILogs
id: e087d4fb-af0b-4e08-a067-b9ba9e5f8840
version: 1.0.1
name: OCI - SSH scanner
kind: Scheduled
status: Available
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Oracle Cloud Infrastructure/Analytic Rules/OCISSHScan.yaml
queryPeriod: 1h
relevantTechniques:
- T1595
triggerOperator: gt
tactics:
- Reconnaissance
description: |
'Detects possible SSH scanning activity.'
entityMappings:
- entityType: IP
fieldMappings:
- identifier: Address
columnName: IPCustomEntity
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/e087d4fb-af0b-4e08-a067-b9ba9e5f8840')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/e087d4fb-af0b-4e08-a067-b9ba9e5f8840')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "OCI - SSH scanner",
"description": "'Detects possible SSH scanning activity.'\n",
"severity": "High",
"enabled": true,
"query": "let threshold = 5;\nOCILogs\n| where EventType contains 'vcn.flowlogs'\n| where data_action_s =~ 'REJECT'\n| where ipv4_is_private(DstIpAddr)\n| where ipv4_is_private(SrcIpAddr) == False\n| where DstPortNumber == 22\n| summarize p_count = dcount(DstIpAddr) by SrcIpAddr, bin(TimeGenerated, 5m)\n| where p_count > threshold\n| extend IPCustomEntity = SrcIpAddr\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Reconnaissance"
],
"techniques": [
"T1595"
],
"alertRuleTemplateName": "e087d4fb-af0b-4e08-a067-b9ba9e5f8840",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"columnName": "IPCustomEntity",
"identifier": "Address"
}
],
"entityType": "IP"
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Oracle Cloud Infrastructure/Analytic Rules/OCISSHScan.yaml",
"templateVersion": "1.0.1",
"status": "Available"
}
}
]
}