NGINX - Request to sensitive files
Id | 2141ef6c-d158-4d44-b739-b145a4c21947 |
Rulename | NGINX - Request to sensitive files |
Description | Detects request to sensitive files. |
Severity | Medium |
Tactics | InitialAccess |
Techniques | T1189 |
Required data connectors | CustomLogsAma NGINXHTTPServer |
Kind | Scheduled |
Query frequency | 1h |
Query period | 1h |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXRequestToSensitiveFiles.yaml |
Version | 1.0.1 |
Arm template | 2141ef6c-d158-4d44-b739-b145a4c21947.json |
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
queryFrequency: 1h
description: |
'Detects request to sensitive files.'
severity: Medium
version: 1.0.1
relevantTechniques:
- T1189
name: NGINX - Request to sensitive files
triggerThreshold: 0
kind: Scheduled
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
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/NGINX HTTP Server/Analytic Rules/NGINXRequestToSensitiveFiles.yaml
requiredDataConnectors:
- connectorId: NGINXHTTPServer
dataTypes:
- NGINXHTTPServer
- connectorId: CustomLogsAma
dataTypes:
- NGINX_CL
tactics:
- InitialAccess
id: 2141ef6c-d158-4d44-b739-b145a4c21947
queryPeriod: 1h
entityMappings:
- fieldMappings:
- columnName: FileCustomEntity
identifier: Name
entityType: File
- fieldMappings:
- columnName: UrlCustomEntity
identifier: Url
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": "2024-01-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",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1189"
],
"templateVersion": "1.0.1",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}