Gallery › Monitoring › Azure Landing Zones Library
DenyAction implementation on Activity Logs
Converted Policy DenyAction Mode All Version 1.0.1
This is a DenyAction implementation policy on Activity Logs.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDenyAction-ActivityLogs.alz_policy_definition.json · 36 lines
{
"name": "DenyAction-ActivityLogs",
"properties": {
"description": "This is a DenyAction implementation policy on Activity Logs.",
"displayName": "DenyAction implementation on Activity Logs",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
],
"category": "Monitoring",
"deprecated": false,
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.0.1"
},
"mode": "All",
"parameters": {},
"policyRule": {
"if": {
"equals": "Microsoft.Resources/subscriptions/providers/diagnosticSettings",
"field": "type"
},
"then": {
"details": {
"actionNames": [
"delete"
]
},
"effect": "denyAction"
}
},
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policyDefinitions"
}BylawDenyAction-ActivityLogs.bylaw.ps1 · 17 lines
# Converted from DenyAction-ActivityLogs.alz_policy_definition.json by ConvertTo-Bylaw.
Policy 'DenyAction-ActivityLogs' {
Properties @{
DisplayName = 'DenyAction implementation on Activity Logs'
Description = 'This is a DenyAction implementation policy on Activity Logs.'
Category = 'Monitoring'
Deprecated = $false
Version = '1.0.1'
Mode = 'All'
Metadata = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureChinaCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
}
Resource 'Microsoft.Resources/subscriptions/providers/diagnosticSettings'
DenyAction Delete
}Source: policy_definitions/DenyAction-ActivityLogs.alz_policy_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw