let sql_patterns = dynamic([@"1/*'*/", @"1'||'asd'||'", @"'1'='1", @"1' or '1'='1", @"1 or 1=1", @"1=1", @"1/*!1111'*/", @"'or''='"]);
NGINXHTTPServer
| where UrlOriginal has_any (sql_patterns)
| extend IPCustomEntity = SrcIpAddr, UrlCustomEntity = UrlOriginal
severity: High
queryFrequency: 10m
relevantTechniques:
- T1190
tactics:
- InitialAccess
kind: Scheduled
query: |
let sql_patterns = dynamic([@"1/*'*/", @"1'||'asd'||'", @"'1'='1", @"1' or '1'='1", @"1 or 1=1", @"1=1", @"1/*!1111'*/", @"'or''='"]);
NGINXHTTPServer
| where UrlOriginal has_any (sql_patterns)
| extend IPCustomEntity = SrcIpAddr, UrlCustomEntity = UrlOriginal
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXSqlPattern.yaml
queryPeriod: 10m
status: Available
version: 1.0.1
name: NGINX - Sql injection patterns
requiredDataConnectors:
- dataTypes:
- NGINXHTTPServer
connectorId: NGINXHTTPServer
triggerOperator: gt
entityMappings:
- entityType: IP
fieldMappings:
- identifier: Address
columnName: IPCustomEntity
- entityType: URL
fieldMappings:
- identifier: Url
columnName: UrlCustomEntity
id: 3bac451d-f919-4c92-9be7-694990e0ca4b
description: |
'Detects possible sql injection patterns'
triggerThreshold: 0
{
"$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/3bac451d-f919-4c92-9be7-694990e0ca4b')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/3bac451d-f919-4c92-9be7-694990e0ca4b')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01-preview",
"properties": {
"displayName": "NGINX - Sql injection patterns",
"description": "'Detects possible sql injection patterns'\n",
"severity": "High",
"enabled": true,
"query": "let sql_patterns = dynamic([@\"1/*'*/\", @\"1'||'asd'||'\", @\"'1'='1\", @\"1' or '1'='1\", @\"1 or 1=1\", @\"1=1\", @\"1/*!1111'*/\", @\"'or''='\"]);\nNGINXHTTPServer\n| where UrlOriginal has_any (sql_patterns)\n| extend IPCustomEntity = SrcIpAddr, UrlCustomEntity = UrlOriginal\n",
"queryFrequency": "PT10M",
"queryPeriod": "PT10M",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1190"
],
"alertRuleTemplateName": "3bac451d-f919-4c92-9be7-694990e0ca4b",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"columnName": "IPCustomEntity",
"identifier": "Address"
}
],
"entityType": "IP"
},
{
"fieldMappings": [
{
"columnName": "UrlCustomEntity",
"identifier": "Url"
}
],
"entityType": "URL"
}
],
"templateVersion": "1.0.1",
"status": "Available",
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXSqlPattern.yaml"
}
}
]
}