Information
The diagnostic setting should be configured to log the appropriate activities from the control/management plane.
Rationale:
A diagnostic setting controls how the diagnostic log is exported. Capturing the diagnostic setting categories for appropriate control/management plane activities allows proper alerting.
NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.
Solution
From Azure Console
Go to Azure Monitor
Click Activity log
Click on Diagnostic settings
Click on Edit Settings for the diagnostic settings entry
Ensure that the following categories are checked: Administrative, Alert, Policy, and Security
Using ARM Template via AZ PowerShell cmdlets
Create a file to hold the JSON
{
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#',
'contentVersion': '1.0.0.0',
'parameters': {
'settingName': {
'type': 'String'
},
'workspaceId': {
'type': 'String'
}
},
'resources': [
{
'type': 'Microsoft.Insights/diagnosticSettings',
'apiVersion': '2017-05-01-preview',
'name': '[parameters('settingName')]',
'dependsOn': [],
'properties': {
'workspaceId': '[parameters('workspaceId')]',
'logs': [
{
'category': 'Administrative',
'enabled': true
},
{
'category': 'Alert',
'enabled': true
},
{
'category': 'Autoscale',
'enabled': false
},
{
'category': 'Policy',
'enabled': true
},
{
'category': 'Recommendation',
'enabled': false
},
{
'category': 'ResourceHealth',
'enabled': false
},
{
'category': 'Security',
'enabled': true
},
{
'category': 'ServiceHealth',
'enabled': false
}
]
}
}
]
}
Reference the JSON in the New-AzSubscriptionDeployment call
$OMSWorkspace = Get-AzResource -ResourceType 'Microsoft.OperationalInsights/workspaces' -Name <Workspace Name>
New-AzSubscriptionDeployment -Name CreateDiagnosticSetting -location eastus -TemplateFile CreateDiagnosticSetting.jsonc -settingName 'Send Activity log to workspace' -workspaceId $OMSWorkspace.ResourceId
Default Value:
When the diagnostic setting is created using Azure Portal, by default no categories are selected.