let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);
ApacheHTTPServer
| where isnotempty(UrlOriginal)
| extend File = extract(@'(.*\/)?(.*)', 2, tostring(UrlOriginal))
| where File in~ (forbidden_files)
| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal
triggerOperator: gt
id: d1c52578-3afc-11ec-8d3d-0242ac130003
queryFrequency: 1h
entityMappings:
- entityType: File
fieldMappings:
- columnName: FileCustomEntity
identifier: Name
- entityType: URL
fieldMappings:
- columnName: UrlCustomEntity
identifier: Url
requiredDataConnectors:
- dataTypes:
- ApacheHTTPServer
connectorId: ApacheHTTPServer
severity: Medium
triggerThreshold: 0
kind: Scheduled
status: Available
queryPeriod: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/ApacheHTTPServer/Analytic Rules/ApacheRequestToSensitiveFiles.yaml
query: |
let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);
ApacheHTTPServer
| where isnotempty(UrlOriginal)
| extend File = extract(@'(.*\/)?(.*)', 2, tostring(UrlOriginal))
| where File in~ (forbidden_files)
| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal
description: |
'Detects request to sensitive files.'
name: Apache - Request to sensitive files
relevantTechniques:
- T1189
tactics:
- InitialAccess
version: 1.0.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/d1c52578-3afc-11ec-8d3d-0242ac130003')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/d1c52578-3afc-11ec-8d3d-0242ac130003')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "Apache - Request to sensitive files",
"description": "'Detects request to sensitive files.'\n",
"severity": "Medium",
"enabled": true,
"query": "let forbidden_files = dynamic(['shadow', 'passwd', 'id_rsa']);\nApacheHTTPServer\n| where isnotempty(UrlOriginal)\n| extend File = extract(@'(.*\\/)?(.*)', 2, tostring(UrlOriginal))\n| where File in~ (forbidden_files)\n| extend FileCustomEntity = File, UrlCustomEntity = UrlOriginal\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess"
],
"techniques": [
"T1189"
],
"alertRuleTemplateName": "d1c52578-3afc-11ec-8d3d-0242ac130003",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"identifier": "Name",
"columnName": "FileCustomEntity"
}
],
"entityType": "File"
},
{
"fieldMappings": [
{
"identifier": "Url",
"columnName": "UrlCustomEntity"
}
],
"entityType": "URL"
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/ApacheHTTPServer/Analytic Rules/ApacheRequestToSensitiveFiles.yaml",
"templateVersion": "1.0.0",
"status": "Available"
}
}
]
}