M2131_LogRetentionLessThan1Year
Id | 8178a514-1270-4e31-a1d9-aaafeb40122f |
Rulename | M2131_LogRetentionLessThan1Year |
Description | This alert is designed to monitor log retention within the Maturity Model for Event Log Management (M-21-31) standard. The alert triggers when a log analytics workspace in active storage is configured for less than 1 year. |
Severity | Medium |
Tactics | Discovery |
Techniques | T1082 |
Kind | Scheduled |
Query frequency | 1d |
Query period | 14d |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/MaturityModelForEventLogManagementM2131/Analytic Rules/M2131LogRetentionLessThan1Year.yaml |
Version | 1.0.0 |
Arm template | 8178a514-1270-4e31-a1d9-aaafeb40122f.json |
SecurityRecommendation
| summarize arg_max(TimeGenerated, *) by RecommendationDisplayName, AssessedResourceId
| where RecommendationDisplayName == "Activity log should be retained for at least one year"
| summarize Failed = countif(RecommendationState == "Unhealthy"), Passed = countif(RecommendationState == "Healthy"), Total = countif(RecommendationState == "Healthy" or RecommendationState == "Unhealthy") by RecommendationDisplayName, AssessedResourceId
| extend PassedControls = (Passed/todouble(Total))*100
| extend RemediationLink = strcat('https://portal.azure.com/#blade/Microsoft_Azure_Security/SecurityMenuBlade/22')
| project RecommendationDisplayName, AssessedResourceId, Total, PassedControls, Passed, Failed, RemediationLink, LastObserved=now()
| where Failed > 0
| sort by Failed desc
| extend URLCustomEntity = RemediationLink, ResourceId = AssessedResourceId
relevantTechniques:
- T1082
name: M2131_LogRetentionLessThan1Year
requiredDataConnectors: []
entityMappings:
- fieldMappings:
- identifier: Url
columnName: URLCustomEntity
entityType: URL
- fieldMappings:
- identifier: ResourceId
columnName: AssessedResourceId
entityType: AzureResource
triggerThreshold: 0
id: 8178a514-1270-4e31-a1d9-aaafeb40122f
tactics:
- Discovery
version: 1.0.0
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/MaturityModelForEventLogManagementM2131/Analytic Rules/M2131LogRetentionLessThan1Year.yaml
queryPeriod: 14d
kind: Scheduled
queryFrequency: 1d
severity: Medium
status: Available
description: |
'This alert is designed to monitor log retention within the Maturity Model for Event Log Management (M-21-31) standard. The alert triggers when a log analytics workspace in active storage is configured for less than 1 year.'
query: |
SecurityRecommendation
| summarize arg_max(TimeGenerated, *) by RecommendationDisplayName, AssessedResourceId
| where RecommendationDisplayName == "Activity log should be retained for at least one year"
| summarize Failed = countif(RecommendationState == "Unhealthy"), Passed = countif(RecommendationState == "Healthy"), Total = countif(RecommendationState == "Healthy" or RecommendationState == "Unhealthy") by RecommendationDisplayName, AssessedResourceId
| extend PassedControls = (Passed/todouble(Total))*100
| extend RemediationLink = strcat('https://portal.azure.com/#blade/Microsoft_Azure_Security/SecurityMenuBlade/22')
| project RecommendationDisplayName, AssessedResourceId, Total, PassedControls, Passed, Failed, RemediationLink, LastObserved=now()
| where Failed > 0
| sort by Failed desc
| extend URLCustomEntity = RemediationLink, ResourceId = AssessedResourceId
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/8178a514-1270-4e31-a1d9-aaafeb40122f')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/8178a514-1270-4e31-a1d9-aaafeb40122f')]",
"properties": {
"alertRuleTemplateName": "8178a514-1270-4e31-a1d9-aaafeb40122f",
"customDetails": null,
"description": "'This alert is designed to monitor log retention within the Maturity Model for Event Log Management (M-21-31) standard. The alert triggers when a log analytics workspace in active storage is configured for less than 1 year.'\n",
"displayName": "M2131_LogRetentionLessThan1Year",
"enabled": true,
"entityMappings": [
{
"entityType": "URL",
"fieldMappings": [
{
"columnName": "URLCustomEntity",
"identifier": "Url"
}
]
},
{
"entityType": "AzureResource",
"fieldMappings": [
{
"columnName": "AssessedResourceId",
"identifier": "ResourceId"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/MaturityModelForEventLogManagementM2131/Analytic Rules/M2131LogRetentionLessThan1Year.yaml",
"query": "SecurityRecommendation\n| summarize arg_max(TimeGenerated, *) by RecommendationDisplayName, AssessedResourceId\n| where RecommendationDisplayName == \"Activity log should be retained for at least one year\"\n| summarize Failed = countif(RecommendationState == \"Unhealthy\"), Passed = countif(RecommendationState == \"Healthy\"), Total = countif(RecommendationState == \"Healthy\" or RecommendationState == \"Unhealthy\") by RecommendationDisplayName, AssessedResourceId\n| extend PassedControls = (Passed/todouble(Total))*100\n| extend RemediationLink = strcat('https://portal.azure.com/#blade/Microsoft_Azure_Security/SecurityMenuBlade/22')\n| project RecommendationDisplayName, AssessedResourceId, Total, PassedControls, Passed, Failed, RemediationLink, LastObserved=now()\n| where Failed > 0\n| sort by Failed desc\n| extend URLCustomEntity = RemediationLink, ResourceId = AssessedResourceId\n",
"queryFrequency": "P1D",
"queryPeriod": "P14D",
"severity": "Medium",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Discovery"
],
"techniques": [
"T1082"
],
"templateVersion": "1.0.0",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}