{
    "properties": {
        "displayName": "Azure Policy Add-on for Kubernetes service (AKS) should be installed and enabled on your clusters",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "description": "Azure Policy Add-on for Kubernetes service (AKS) extends Gatekeeper v3, an admission controller webhook for Open Policy Agent (OPA), to apply at-scale enforcements and safeguards on your clusters in a centralized, consistent manner.",
        "metadata": {
            "version": "1.0.2",
            "category": "Kubernetes"
        },
        "parameters": {
            "effect": {
                "type": "String",
                "defaultValue": "Audit",
                "allowedValues": [
                    "Audit",
                    "Disabled"
                ],
                "metadata": {
                    "displayName": "Effect",
                    "description": "Enable or disable the execution of the policy"
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.ContainerService/managedClusters"
                    },
                    {
                        "anyOf": [
                            {
                                "field": "Microsoft.ContainerService/managedClusters/addonProfiles.azurePolicy.enabled",
                                "exists": "false"
                            },
                            {
                                "field": "Microsoft.ContainerService/managedClusters/addonProfiles.azurePolicy.enabled",
                                "equals": "false"
                            }
                        ]
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]"
            }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/0a15ec92-a229-4763-bb14-0ea34a568f8d",
    "name": "0a15ec92-a229-4763-bb14-0ea34a568f8d"
}