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 json

Bicep

param keyVaultUri string
param keyName string

resource batch 'Microsoft.Batch/batchAccounts@2024-02-01' existing = {{
  name: '{name}'
}}
// TODO: Configure encryption with Key Vault key

Terraform

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

Vendor documentation

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.