Data encryption at rest in Azure HorizonDB

Azure HorizonDB always encrypts all data it manages at rest. This data includes all system and user databases, cluster logs, write-ahead log segments, and backups.

Encryption at rest with service-managed keys (SMK) or customer-managed keys (CMK)

Azure HorizonDB supports two modes of data encryption at rest: service-managed keys (SMK) and customer-managed keys (CMK) (preview). Data encryption with service-managed keys is the default mode for Azure HorizonDB. In this mode, the service automatically manages the encryption keys used to encrypt your data. You don't need to take any action to enable or manage encryption in this mode. To encrypt your data, Azure HorizonDB uses Azure Storage encryption for data at rest.

In the customer-managed keys mode, you use a key that you own and manage. This mode gives you more control over the encryption process, but it also requires you to manage the encryption keys yourself. You must deploy your own Azure Key Vault and configure it to store the encryption keys used by your Azure HorizonDB cluster. To encrypt your data, Azure HorizonDB uses storage-layer encryption for WAL and page-level encryption for page servers.

Select the encryption mode when you create the cluster. You can't change it later.

Note

Data encryption at rest with customer-managed keys (CMK) is currently in preview. Preview features are released with limited capabilities, but Microsoft makes them available on a preview basis so customers can get early access and provide feedback. Preview features are subject to separate supplemental preview terms, and aren't subject to SLAs. Support is provided as best effort in certain cases. However, Microsoft Support is eager to get your feedback on the preview functionality, and might provide best effort support in certain cases. Preview features might have limited or restricted functionality, and might be available only in selected geographic areas.

Benefits provided by each mode (SMK or CMK)

Data encryption by using service-managed keys for Azure HorizonDB provides the following benefits:

  • The service automatically and fully controls your key's life cycle, including rotation of the key.
  • You don't need to worry about managing data encryption keys.
  • It simplifies the management of encryption keys (including their regular rotation) and the management of the identities used to access those keys.

Data encryption with customer-managed keys for Azure HorizonDB provides the following benefits:

  • You fully control a key's life cycle, including rotation of the key, to align with corporate policies.
  • You can centrally manage and organize all your encryption keys in your own instances of Azure Key Vault.
  • You can revoke the cluster's access to the key, which makes encrypted data inaccessible.
  • You can implement separation of duties between security officers, database administrators, and system administrators.

Customer-managed key requirements

When you use a customer-managed key, you're responsible for deploying the Azure Key Vault, creating or importing the key, granting the required permissions, configuring network access, auditing key access, and rotating the key.

Azure Key Vault is a cloud-based, external key management system. It's highly available and provides scalable, secure storage for RSA cryptographic keys, optionally backed by FIPS 140 validated hardware security modules (HSMs). It doesn't allow direct access to a stored key, but provides encryption and decryption services to authorized entities. Key Vault can generate the key, import it, or receive it transferred from an on-premises HSM device.

The following list describes the requirements to configure data encryption for Azure HorizonDB:

  • For single-tenant CMK configurations, Key Vault and your Azure HorizonDB cluster must belong to the same Microsoft Entra tenant.
  • Set the Days to retain deleted vaults configuration for Key Vault to 90 days. If you configured an existing Key Vault instance with a lower number, it remains valid. However, if you wish to modify this setting and increase the value, you must create a new Key Vault instance. Once an instance is created, you can't modify this setting.
  • Enable soft-delete in Key Vault to help protect against data loss if a key or vault is accidentally deleted. Key Vault retains soft-deleted resources for 90 days unless you recover or purge them in the meantime. The recover and purge actions have their own permissions associated with a Key Vault RBAC role or an access policy permission. The soft-delete feature is on by default. An older vault might have soft-delete disabled. In that case, you can turn it on by using Azure CLI.
  • Enable purge protection to enforce a mandatory retention period for deleted vaults and vault objects.
  • Grant the Azure HorizonDB cluster's user-assigned managed identity access to the key by using the applicable permission model:
    • Key Vault RBAC permission model, recommended: Configure Azure Key Vault with RBAC permission model and assign the managed identity the Key Vault Crypto Service Encryption User role.
    • Key Vault Access policy permission model, legacy: If Azure Key Vault is configured with Access policy permission model, grant the following permissions to the managed identity:
      • get: To retrieve the properties and the public part of the key in Key Vault.
      • list: To list and iterate through the keys stored in Key Vault.
      • wrapKey: To encrypt the data encryption key.
      • unwrapKey: To decrypt the data encryption key.
  • The key used for encrypting the data encryption key must be an asymmetric 4,096-bit RSA or RSA-HSM key.
  • The date and time for key activation (if set) must be in the past. The date and time for expiration (if set) must be in the future.
  • The key must be in Enabled state.
  • If you're importing an existing key into Key Vault, provide it in the supported file formats (.pfx, .byok, or .backup).

Rotate customer-managed keys

Azure HorizonDB supports manual and automatic key rotation through versionless key URIs. Versioned key URIs aren't supported. When Azure Key Vault creates a new key version, Azure HorizonDB detects and uses that version automatically.

For more information, see Configure data encryption in Azure HorizonDB.

Manual key rotation and updates

You can manually rotate the CMK by configuring a new key and replacing the existing CMK assigned to the Azure HorizonDB cluster. After the new key configuration is validated and committed, Azure HorizonDB starts the key rotation process and re-encrypts the data encryption key used to protect data pages, WAL logs, and backups.

Important

The previous and new CMKs, or the previous and new versions of one key, must remain available throughout the rotation so that Azure HorizonDB can continue reading content protected by the old key while transitioning protection to the new key. Don't disable, delete, or revoke permissions for the previous key until the rotation completes successfully. Wait at least two hours before disabling access to the old key version.

Automatic key version updates

To enable automatic key version updates, use a versionless key URI such as https://<keyvault-name>.vault.azure.net/keys/<key-name>. Omit the version GUID from the URI. This approach eliminates the need to update the CMK's version property in your Azure HorizonDB cluster after a key rotation. Azure HorizonDB automatically picks up the new key version within one hour and re-encrypts the data encryption key. This approach significantly simplifies your key lifecycle management, especially when combined with Key Vault autorotation.

Inaccessible clusters

When you configure data encryption with a customer-managed key stored in Azure Key Vault, Azure HorizonDB requires continuous access to this key to stay online.

Someone might accidentally disable cluster access to the key by:

  • Unassigning the RBAC role Key Vault Crypto Service Encryption User or revoking the permissions from the identity that's used to retrieve the key in Key Vault.
  • Deleting the key.
  • Deleting the Azure Key Vault instance.
  • Changing the Azure Key Vault firewall rules.
  • Deleting the managed identity of the cluster in Microsoft Entra ID.

When a key is disabled, deleted, expired, or not reachable, the Azure HorizonDB cluster enters the Inaccessible state and begins denying all connections. The Azure HorizonDB cluster state doesn't change to Ready again until it can revalidate the encryption keys. Generally, an Azure HorizonDB cluster becomes Inaccessible within 60 minutes after a key is disabled, deleted, expired, or unreachable. After the key becomes available, the Azure HorizonDB cluster might take up to 60 minutes to become Ready again. After you restore access to the key, cluster recovery occurs automatically and doesn't require further intervention.

Restore a CMK-enabled cluster

When you update the CMK protecting an Azure HorizonDB cluster, historical backups are reencrypted with the latest CMK. A point-in-time restore therefore requires only the current key and the user-assigned managed identity. Previous keys and key versions aren't required. The restored Azure HorizonDB cluster can use the same encryption configuration or a different key and managed identity. If the restore uses a different user-assigned managed identity, that identity must have the required permissions on the applicable Azure Key Vault key or keys. In preview, restoring from a CMK-enabled Azure HorizonDB cluster to another CMK-enabled Azure HorizonDB cluster is allowed. Restoring from an SMK-enabled Azure HorizonDB cluster to a CMK-enabled Azure HorizonDB cluster and vice versa isn't supported.

Source Restore target Supported
CMK-enabled CMK-enabled Yes
CMK-enabled SMK-enabled No
SMK-enabled CMK-enabled No

Limitations of customer-managed keys

Review the current preview limitations before you decide between service-managed keys and customer-managed keys.

  • You can configure customer-managed key encryption only when you create an Azure HorizonDB cluster. You can't add it as an update to an existing Azure HorizonDB cluster.
  • You can't change from customer-managed keys to service-managed keys after you create the Azure HorizonDB cluster.
  • The key vault must be in the same region and the same tenant as the Azure HorizonDB cluster.
  • Azure Key Vault Managed Hardware Security Module (HSM) isn't supported.
  • Only 4,096-bit RSA and RSA-HSM keys are supported. AES keys aren't supported.
  • Versioned key URIs aren't supported; use versionless URIs.
  • Geo-redundant backups with CMK aren't supported.
  • Point-in-time restore from an SMK-enabled Azure HorizonDB cluster to a CMK-enabled Azure HorizonDB cluster and vice versa isn't supported.
  • CMK is configured at the Azure HorizonDB cluster level, not per database.
  • Cross-tenant customer-managed keys aren't supported.