Bylaw

Gallery › Monitoring › Azure Landing Zones Library

DenyAction Delete - Activity Log Settings and Diagnostic Settings

Converted Initiative Version 1.1.0

Enforces DenyAction - Delete on Activity Log Settings and Diagnostic Settings.

ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.

Azure Policy JSONDenyAction-DeleteProtection.alz_policy_set_definition.json · 36 lines
{
  "name": "DenyAction-DeleteProtection",
  "properties": {
    "description": "Enforces DenyAction - Delete on Activity Log Settings and Diagnostic Settings.",
    "displayName": "DenyAction Delete - Activity Log Settings and Diagnostic Settings",
    "metadata": {
      "alzCloudEnvironments": [
        "AzureCloud",
        "AzureChinaCloud",
        "AzureUSGovernment"
      ],
      "category": "Monitoring",
      "source": "https://github.com/Azure/Enterprise-Scale/",
      "version": "1.1.0"
    },
    "parameters": {},
    "policyDefinitions": [
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {},
        "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-DiagnosticLogs",
        "policyDefinitionReferenceId": "DenyActionDelete-DiagnosticSettings"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {},
        "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-ActivityLogs",
        "policyDefinitionReferenceId": "DenyActionDelete-ActivityLogSettings"
      }
    ],
    "policyType": "Custom"
  },
  "type": "Microsoft.Authorization/policySetDefinitions"
}
BylawDenyAction-DeleteProtection.bylaw.ps1 · 23 lines
# Converted from DenyAction-DeleteProtection.alz_policy_set_definition.json by ConvertTo-Bylaw.
Initiative 'DenyAction-DeleteProtection' {

    Properties @{
        DisplayName = 'DenyAction Delete - Activity Log Settings and Diagnostic Settings'
        Description = 'Enforces DenyAction - Delete on Activity Log Settings and Diagnostic Settings.'
        Category    = 'Monitoring'
        Version     = '1.1.0'
        Metadata    = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureChinaCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
    }

    PolicyDefinition @{
        Id          = '/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-DiagnosticLogs'
        ReferenceId = 'DenyActionDelete-DiagnosticSettings'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Authorization/policyDefinitions/DenyAction-ActivityLogs'
        ReferenceId = 'DenyActionDelete-ActivityLogSettings'
        Version     = '1.*.*'
    }
}

Members (2)

Source: policy_set_definitions/DenyAction-DeleteProtection.alz_policy_set_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.