More Info:
Encrypt Kubernetes secrets at rest using a customer-managed key in Azure Key Vault (KMS) so sensitive data is protected beyond the default platform encryption.Risk Level
HighAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify the AKS cluster and resource group
- On any machine with Azure CLI access:
- Note the
nameandresourceGroupof the target cluster.
- On any machine with Azure CLI access:
-
Check if a customer-managed key (CMK) is configured for secrets encryption
- On any machine with Azure CLI access:
- Review the output:
enabled: should betrue.keyVaultKeyUri: should point to your Azure Key Vault key.
- If
enabledisnull/falseorkeyVaultKeyUriis empty, the cluster is not using Key Vault CMK for secrets encryption.
- On any machine with Azure CLI access:
-
Review the Key Vault key used (if any)
- On any machine with Azure CLI access, if
keyVaultKeyUriwas set: - Verify:
- The key is in a production Key Vault (correct subscription, resource group, region).
- The key is in an appropriate state (e.g., not expired, not disabled).
- The key rotation policy meets your org’s requirements.
- On any machine with Azure CLI access, if
-
Decide on desired state: enable or update CMK-based encryption
- If CMK-based secrets encryption is not enabled and your policy requires it, plan to enable it with a suitable Key Vault and key.
- If enabled but using an incorrect Key Vault or key, plan to update to the correct
keyVaultKeyUri. - Ensure the AKS-managed identity (system-assigned or user-assigned) has
get,wrapKey, andunwrapKeypermissions on the Key Vault key.
-
Configure or update CMK secrets encryption (if change is required)
- On any machine with Azure CLI access, first ensure the AKS identity has the needed Key Vault access:
- In Azure Portal or via
az keyvault set-policy, grant that identityget,wrapKey,unwrapKeyon the target key. - Then enable or update secrets encryption with your Key Vault key:
- On any machine with Azure CLI access, first ensure the AKS identity has the needed Key Vault access:
-
Verify configuration after changes
- On any machine with Azure CLI access:
- Confirm
enabledistrueandkeyVaultKeyUrimatches the intended Azure Key Vault CMK.
- On any machine with Azure CLI access:
Using kubectl
Using kubectl
kubectl cannot configure encryption at rest for Kubernetes Secrets in AKS; this must be set on the managed control plane via the Azure portal, Azure CLI, or your IaC (ARM/Bicep/Terraform) targeting AKS and Azure Key Vault. Refer to the Manual Steps section for how to review and configure customer-managed key encryption for Secrets.
Automation
Automation
-
Azure Key Vault KMS enabled : true
and
STATUS: USING CUSTOMER-MANAGED KEY→ This is the desired state: Kubernetes secrets are configured to use a customer-managed key in Azure Key Vault (subject to your own risk review of the key and access model). -
Azure Key Vault KMS enabled : false
and
STATUS: NOT USING CUSTOMER-MANAGED KEY→ Problem / needs review for this control: the cluster is not using a customer-managed key for secret encryption; it relies only on default platform encryption. -
Azure Key Vault KMS enabled : true
butkeyIdisnullor empty and
STATUS: MISCONFIGURED - KMS enabled but keyId is not set→ Problem / needs review: KMS is nominally enabled but lacks a valid CMK. Verify cluster configuration in the Azure portal/CLI/IaC and correct or disable as appropriate.

