LOW
Source
Trivy
ID
AVD-AZU-0066

Ensure AKS cluster has Azure Policy add-on enabled

Azure Kubernetes Service should enable Azure Policy Add-On to enforce compliance and governance policies on the cluster. The add-on extends Gatekeeper v3, an admission controller webhook for Open Policy Agent (OPA).

Impact

Follow the appropriate remediation steps below to resolve the issue.

Enable Azure Policy add-on on the AKS cluster to enforce governance policies.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
resource "azurerm_kubernetes_cluster" "good_example" {
  name                = "example-aks"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  dns_prefix          = "exampleaks"

  azure_policy_enabled = true

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }
}