{
    "properties": {
        "policyType": "BuiltIn",
        "displayName": "Both operating systems and data disks in Azure Kubernetes Service clusters should be encrypted by customer-managed keys",
        "description": "Encrypting OS and data disks using customer-managed keys provides more control and greater flexibility in key management. This is a common requirement in many regulatory and industry compliance standards.",
        "metadata": {
            "version": "1.0.0",
            "category": "Kubernetes"
        },
        "mode": "Indexed",
        "parameters": {
            "effect": {
                "type": "String",
                "defaultValue": "Audit",
                "allowedValues": [
                    "Audit",
                    "Deny",
                    "Disabled"
                ],
                "metadata": {
                    "displayName": "Effect",
                    "description": "'Audit' allows a non-compliant resource to be created or updated, but flags it as non-compliant. 'Deny' blocks the non-compliant resource creation or update. 'Disabled' turns off the policy."
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.ContainerService/managedClusters"
                    },
                    {
                        "anyOf": [
                            {
                                "field": "Microsoft.ContainerService/managedClusters/diskEncryptionSetID",
                                "exists": "False"
                            },
                            {
                                "field": "Microsoft.ContainerService/managedClusters/diskEncryptionSetID",
                                "equals": ""
                            }
                        ]
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]"
            }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/7d7be79c-23ba-4033-84dd-45e2a5ccdd67",
    "name": "7d7be79c-23ba-4033-84dd-45e2a5ccdd67"
}