Control: Azure Policy Add-on for Kubernetes service (AKS) should be installed and enabled on your clusters
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.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.kubernetes_cluster_add_on_azure_policy_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.kubernetes_cluster_add_on_azure_policy_enabled --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'addon_profile') is null then 'alarm' when (attributes_std -> 'addon_profile' -> 'azure_policy' ->>'enabled')::boolean then 'ok' else 'alarm' end status, split_part(address, '.', 2) || case when (attributes_std -> 'addon_profile') is null then ' ''addon_profile'' not defined' when (attributes_std -> 'addon_profile' -> 'azure_policy' ->>'enabled')::boolean then ' add on azure policy enabled' else ' add on azure policy disabled' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'azurerm_kubernetes_cluster';