Skip to main content

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

High

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify the AKS cluster and resource group
    • On any machine with Azure CLI access:
    • Note the name and resourceGroup of the target cluster.
  2. Check if a customer-managed key (CMK) is configured for secrets encryption
    • On any machine with Azure CLI access:
    • Review the output:
      • enabled: should be true.
      • keyVaultKeyUri: should point to your Azure Key Vault key.
    • If enabled is null/false or keyVaultKeyUri is empty, the cluster is not using Key Vault CMK for secrets encryption.
  3. Review the Key Vault key used (if any)
    • On any machine with Azure CLI access, if keyVaultKeyUri was 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.
  4. 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, and unwrapKey permissions on the Key Vault key.
  5. 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 identity get, wrapKey, unwrapKey on the target key.
    • Then enable or update secrets encryption with your Key Vault key:
  6. Verify configuration after changes
    • On any machine with Azure CLI access:
    • Confirm enabled is true and keyVaultKeyUri matches the intended Azure Key Vault CMK.
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.
How to run (any machine with Azure CLI and kubectl access):
Optional: restrict to certain subscriptions:
How to interpret the outputFor each AKS cluster, focus on:
  • 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
    but keyId is null or 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.
Because this check is MANUAL, you must decide, per cluster, whether “NOT USING CUSTOMER-MANAGED KEY” is acceptable given your policy, and then configure or re-create the cluster via Azure (portal/CLI/IaC) if you require CMK-backed encryption.