Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

NGINX - Sql injection patterns

Back
Id3bac451d-f919-4c92-9be7-694990e0ca4b
RulenameNGINX - Sql injection patterns
DescriptionDetects possible sql injection patterns
SeverityHigh
TacticsInitialAccess
TechniquesT1190
Required data connectorsCustomLogsAma
NGINXHTTPServer
KindScheduled
Query frequency10m
Query period10m
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXSqlPattern.yaml
Version1.0.2
Arm template3bac451d-f919-4c92-9be7-694990e0ca4b.json
Deploy To Azure
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
relevantTechniques:
- T1190
name: NGINX - Sql injection patterns
requiredDataConnectors:
- dataTypes:
  - NGINXHTTPServer
  connectorId: NGINXHTTPServer
- dataTypes:
  - NGINX_CL
  connectorId: CustomLogsAma
entityMappings:
- fieldMappings:
  - identifier: Address
    columnName: IPCustomEntity
  entityType: IP
- fieldMappings:
  - identifier: Url
    columnName: UrlCustomEntity
  entityType: URL
triggerThreshold: 0
id: 3bac451d-f919-4c92-9be7-694990e0ca4b
tactics:
- InitialAccess
version: 1.0.2
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXSqlPattern.yaml
queryPeriod: 10m
kind: Scheduled
queryFrequency: 10m
severity: High
status: Available
description: |
    'Detects possible sql injection patterns'
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  
triggerOperator: gt
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/3bac451d-f919-4c92-9be7-694990e0ca4b')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/3bac451d-f919-4c92-9be7-694990e0ca4b')]",
      "properties": {
        "alertRuleTemplateName": "3bac451d-f919-4c92-9be7-694990e0ca4b",
        "customDetails": null,
        "description": "'Detects possible sql injection patterns'\n",
        "displayName": "NGINX - Sql injection patterns",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "IPCustomEntity",
                "identifier": "Address"
              }
            ]
          },
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "UrlCustomEntity",
                "identifier": "Url"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXSqlPattern.yaml",
        "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",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1190"
        ],
        "templateVersion": "1.0.2",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}