let commands = dynamic(["1/*'*/", "1'||'asd'||'", "'1'='1", "1' or '1'='1", "1 or 1=1", "1=1", "1/*!1111'*/", "'or''='"]);
TomcatEvent
| where UrlOriginal has_any (commands)
| extend UrlCustomEntity = UrlOriginal
queryPeriod: 1h
entityMappings:
- fieldMappings:
- columnName: UrlCustomEntity
identifier: Url
entityType: URL
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tomcat/Analytic Rules/TomcatSQLiPattern.yaml
tactics:
- InitialAccess
query: |
let commands = dynamic(["1/*'*/", "1'||'asd'||'", "'1'='1", "1' or '1'='1", "1 or 1=1", "1=1", "1/*!1111'*/", "'or''='"]);
TomcatEvent
| where UrlOriginal has_any (commands)
| extend UrlCustomEntity = UrlOriginal
description: |
'Detects possible sql injection patterns'
queryFrequency: 1h
id: ce84741e-4875-11ec-81d3-0242ac130003
status: Available
relevantTechniques:
- T1190
severity: High
version: 1.0.0
triggerThreshold: 0
kind: Scheduled
requiredDataConnectors:
- connectorId: ApacheTomcat
dataTypes:
- TomcatEvent
name: Tomcat - Sql injection patterns
{
"$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/ce84741e-4875-11ec-81d3-0242ac130003')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/ce84741e-4875-11ec-81d3-0242ac130003')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01-preview",
"properties": {
"displayName": "Tomcat - Sql injection patterns",
"description": "'Detects possible sql injection patterns'\n",
"severity": "High",
"enabled": true,
"query": "let commands = dynamic([\"1/*'*/\", \"1'||'asd'||'\", \"'1'='1\", \"1' or '1'='1\", \"1 or 1=1\", \"1=1\", \"1/*!1111'*/\", \"'or''='\"]);\nTomcatEvent\n| where UrlOriginal has_any (commands)\n| extend UrlCustomEntity = UrlOriginal\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1190"
],
"alertRuleTemplateName": "ce84741e-4875-11ec-81d3-0242ac130003",
"customDetails": null,
"entityMappings": [
{
"entityType": "URL",
"fieldMappings": [
{
"identifier": "Url",
"columnName": "UrlCustomEntity"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Tomcat/Analytic Rules/TomcatSQLiPattern.yaml",
"templateVersion": "1.0.0",
"status": "Available"
}
}
]
}