let threshold = 10;
PaloAltoCDLEvent
| where EventResourceId =~ 'TRAFFIC'
| where isnotempty(DstPortNumber) and isnotempty(SrcIpAddr)
| summarize PortSet = make_set(DstPortNumber) by SrcIpAddr, bin(TimeGenerated, 5m)
| where array_length(PortSet) > threshold
| extend IPCustomEntity = SrcIpAddr
severity: High
triggerThreshold: 0
query: |
let threshold = 10;
PaloAltoCDLEvent
| where EventResourceId =~ 'TRAFFIC'
| where isnotempty(DstPortNumber) and isnotempty(SrcIpAddr)
| summarize PortSet = make_set(DstPortNumber) by SrcIpAddr, bin(TimeGenerated, 5m)
| where array_length(PortSet) > threshold
| extend IPCustomEntity = SrcIpAddr
queryFrequency: 1h
requiredDataConnectors:
- connectorId: PaloAltoCDL
dataTypes:
- PaloAltoCDLEvent
id: 3575a9c0-51c9-11ec-bf63-0242ac130002
version: 1.0.1
name: PaloAlto - Possible port scan
kind: Scheduled
status: Available
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/PaloAltoCDL/Analytic Rules/PaloAltoCDLPossiblePortScan.yaml
queryPeriod: 1h
relevantTechniques:
- T1595
triggerOperator: gt
tactics:
- Reconnaissance
description: |
'Detects possible port scan.'
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/3575a9c0-51c9-11ec-bf63-0242ac130002')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/3575a9c0-51c9-11ec-bf63-0242ac130002')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "PaloAlto - Possible port scan",
"description": "'Detects possible port scan.'\n",
"severity": "High",
"enabled": true,
"query": "let threshold = 10;\nPaloAltoCDLEvent\n| where EventResourceId =~ 'TRAFFIC'\n| where isnotempty(DstPortNumber) and isnotempty(SrcIpAddr)\n| summarize PortSet = make_set(DstPortNumber) by SrcIpAddr, bin(TimeGenerated, 5m)\n| where array_length(PortSet) > threshold\n| extend IPCustomEntity = SrcIpAddr\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Reconnaissance"
],
"techniques": [
"T1595"
],
"alertRuleTemplateName": "3575a9c0-51c9-11ec-bf63-0242ac130002",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"columnName": "IPCustomEntity",
"identifier": "Address"
}
],
"entityType": "IP"
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/PaloAltoCDL/Analytic Rules/PaloAltoCDLPossiblePortScan.yaml",
"templateVersion": "1.0.1",
"status": "Available"
}
}
]
}