Batch account should use customer-managed key encryption
Medium
Azure
General
batchaccounts-encryption
Applies to
Microsoft.Batch/batchAccounts
What CGPulse checks
A resource passes this rule when encryption.keySource must equal Microsoft.KeyVault. Anything else is reported as a finding with the evaluated property value attached as evidence.
How to fix it
Configure customer-managed keys via Key Vault for full control over encryption key lifecycle. In Azure Portal: Batch account > Encryption > select Customer-managed key. See: https://learn.microsoft.com/en-us/azure/batch/batch-customer-managed-key
CLI
az batch account show --ids "{id}" --query "encryption" -o jsonBicep
param keyVaultUri string
param keyName string
resource batch 'Microsoft.Batch/batchAccounts@2024-02-01' existing = {{
name: '{name}'
}}
// TODO: Configure encryption with Key Vault keyTerraform
resource "azurerm_batch_account" "{name}" {
name = "{name}"
resource_group_name = "{rg}"
location = var.location
encryption {
key_vault_key_id = "<key-vault-key-id>"
}
}
Compliance frameworks
Is your environment compliant with this rule?
CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.
Related Azure rules
- Action Group should be enabled
- Activity Log Alert should be enabled
- AKS cluster logs should be sent to Log Analytics
- AKS cluster must enable RBAC
- AKS cluster must enable RBAC
- AKS cluster should be a private cluster
- AKS cluster should disable local accounts
- AKS cluster should enable Azure RBAC for Kubernetes