output/20260723_081532/govviz/ALZ_20260723_081601/Enterprise-Scale/eslzArm/managementGroupTemplates/policyAssignments/DENY-AksPrivEscalationPolicyAssignment.json

{
    "$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "enforcementMode": {
            "type": "string",
            "allowedValues": [
                "Default",
                "DoNotEnforce"
            ],
            "defaultValue": "Default"
        }
    },
    "variables": {
        "policyDefinitions": {
            "denyAksNoPrivEsc": "/providers/Microsoft.Authorization/policyDefinitions/1c6e92c9-99f0-4e55-9cf2-0c234dc48f99",
            "policyVersion": "7.*.*"
        },
        "policyAssignmentNames": {
            "denyAksNoPrivEsc": "Deny-Priv-Esc-AKS",
            "description": "Do not allow containers to run with privilege escalation to root in a Kubernetes cluster. This recommendation is part of CIS 5.2.5 which is intended to improve the security of your Kubernetes environments. This policy is generally available for Kubernetes Service (AKS), and preview for AKS Engine and Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
            "displayName": "Kubernetes clusters should not allow container privilege escalation"
        }
    },
    "resources": [
        {
            "type": "Microsoft.Authorization/policyAssignments",
            "apiVersion": "2024-04-01",
            "name": "[variables('policyAssignmentNames').denyAksNoPrivEsc]",
            "properties": {
                "description": "[variables('policyAssignmentNames').description]",
                "displayName": "[variables('policyAssignmentNames').displayName]",
                "policyDefinitionId": "[variables('policyDefinitions').denyAksNoPrivEsc]",
                "definitionVersion": "[variables('policyDefinitions').policyVersion]",
                "enforcementMode": "[parameters('enforcementMode')]",
                "parameters": {
                    "effect": {
                        "value": "Deny"
                    }
                }
            }
        }
    ],
    "outputs": {}
}