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

NGINX - Request to sensitive files

Back
Id2141ef6c-d158-4d44-b739-b145a4c21947
RulenameNGINX - Request to sensitive files
DescriptionDetects request to sensitive files.
SeverityMedium
TacticsInitialAccess
TechniquesT1189
Required data connectorsNGINXHTTPServer
KindScheduled
Query frequency1h
Query period1h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXRequestToSensitiveFiles.yaml
Version1.0.0
Arm template2141ef6c-d158-4d44-b739-b145a4c21947.json
Deploy To Azure
let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);
NGINXHTTPServer
| extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))
| where File in (forbidden_files)
| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal
status: Available
id: 2141ef6c-d158-4d44-b739-b145a4c21947
name: NGINX - Request to sensitive files
requiredDataConnectors:
- connectorId: NGINXHTTPServer
  dataTypes:
  - NGINXHTTPServer
severity: Medium
triggerThreshold: 0
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXRequestToSensitiveFiles.yaml
kind: Scheduled
description: |
    'Detects request to sensitive files.'
relevantTechniques:
- T1189
queryPeriod: 1h
triggerOperator: gt
queryFrequency: 1h
query: |
  let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);
  NGINXHTTPServer
  | extend File = extract(@"(.*\/)?(.*)", 2, tostring(UrlOriginal))
  | where File in (forbidden_files)
  | extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal  
version: 1.0.0
tactics:
- InitialAccess
entityMappings:
- fieldMappings:
  - identifier: Name
    columnName: FileCustomEntity
  entityType: File
- fieldMappings:
  - identifier: Url
    columnName: UrlCustomEntity
  entityType: URL
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2023-02-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/2141ef6c-d158-4d44-b739-b145a4c21947')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/2141ef6c-d158-4d44-b739-b145a4c21947')]",
      "properties": {
        "alertRuleTemplateName": "2141ef6c-d158-4d44-b739-b145a4c21947",
        "customDetails": null,
        "description": "'Detects request to sensitive files.'\n",
        "displayName": "NGINX - Request to sensitive files",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "File",
            "fieldMappings": [
              {
                "columnName": "FileCustomEntity",
                "identifier": "Name"
              }
            ]
          },
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "UrlCustomEntity",
                "identifier": "Url"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXRequestToSensitiveFiles.yaml",
        "query": "let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);\nNGINXHTTPServer\n| extend File = extract(@\"(.*\\/)?(.*)\", 2, tostring(UrlOriginal))\n| where File in (forbidden_files)\n| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1189"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}