Use the Knowledge Base AI to help improve your Cloud Posture

Enterprise Redis Cache Clusters Encrypted with Customer-Managed Keys

Trend Vision One™ provides continuous assurance that gives peace of mind for your cloud infrastructure, delivering over 1100 automated best practice checks.

Risk Level: High (not acceptable risk)

Ensure that your Enterprise Redis cache clusters are encrypted using Customer-Managed Keys (CMKs) instead of Microsoft-managed keys (i.e. default keys used by Microsoft Azure for encryption at rest) in order to have a more granular control over your clusters encryption and decryption process.

Security

Azure Cache for Redis automatically encrypts Enterprise Redis cache cluster data at rest. The encryption protects your data and assists in fulfilling your organization's security and compliance requirements. By default, the encryption process uses Microsoft-managed keys, also known as service-managed keys. However, you can bring your own keys (i.e. Customer-Managed Keys) to fully control who can use the encryption keys and access the encrypted data. Using Customer-Managed Keys (CMKs) also allows you to automatically update the key version used for storage encryption whenever a new version is available.


Audit

To determine if your Enterprise Redis cache clusters are encrypted using Customer-Managed Keys (CMKs), perform the following operations:

Using Azure Portal

01 Sign in to the Microsoft Azure Portal.

02 Navigate to All resources blade available at https://portal.azure.com/#browse/all to access all your Microsoft Azure cloud resources.

03 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.

04 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Redis Enterprise cluster for Value, then choose Apply to list the Enterprise Redis cache clusters available in the selected subscription.

05 Click on the name (link) of the Redis cache cluster that you want to examine.

06 In the navigation panel, under Settings, select Encryption to access the encryption configuration settings available for the selected cache cluster.

07 Under Customer-managed key encryption at rest, check the Customer-managed key attribute value to determine the key type used for encryption. If Customer-managed key is set to None, encryption at rest using Customer-Managed Keys (CMKs) is not enabled for the selected Enterprise Redis cache cluster.

08 Repeat steps no. 5 - 7 for each Enterprise Redis cache cluster available within the selected subscription.

09 Repeat steps no. 3 – 8 for each Azure subscription created in your Microsoft Azure cloud account.

Using Azure CLI

01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:

az account list
	--query '[*].id'

02 The command output should return the requested subscription identifiers (IDs):

[
	"abcdabcd-1234-abcd-1234-abcdabcdabcd",
	"abcd1234-abcd-1234-abcd-abcd1234abcd"
]

03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):

az account set
	--subscription abcdabcd-1234-abcd-1234-abcdabcdabcd

04 Run redisenterprise list command (Windows/macOS/Linux) with custom output filters to list the identifier (ID) of each Enterprise Redis cache cluster available in the selected Azure subscription:

az redisenterprise list
	--query '[*].id'

05 The command output should return the requested cache cluster IDs:

[
	"/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Cache/redisEnterprise/cc-project5-redis-enterprise",
	"/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Cache/redisEnterprise/cc-redis-cluster-enterprise"
]

06 Run redisenterprise show command (Windows/macOS/Linux) with the ID of the Enterprise Redis cache cluster that you want to examine as the identifier parameter and custom output filters to determine if encryption at rest using Customer-Managed Keys is enabled for the selected cache cluster:

az redisenterprise show
	--ids "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Cache/redisEnterprise/cc-project5-redis-enterprise"
	--query '{encryptionKey:encryption.customerManagedKeyEncryption.keyEncryptionKeyUrl}'

07 The command output should return the URL of the Customer-Managed Key (CMK) used for cluster data encryption:

{
	"encryptionKey": null
}

If the redisenterprise show command output returns null for the "encryptionKey" attribute value, as shown in the example above, encryption at rest using Customer-Managed Keys (CMKs) is not enabled for the selected Enterprise Redis cache cluster.

08 Repeat step no. 6 and 7 for each Enterprise Redis cache cluster available in the selected Azure subscription.

09 Repeat steps no. 3 – 8 for each Azure subscription created in your Microsoft Azure cloud account.

Remediation / Resolution

To enable encryption at rest for your Enterprise Redis cache clusters using Customer-Managed Keys (CMKs), perform the following operations:

Using Azure Portal

01 Sign in to the Microsoft Azure Portal.

02 Navigate to Managed Identities blade available at https://portal.azure.com/#browse/Microsoft.ManagedIdentity%2FuserAssignedIdentities.

03 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.

04 Choose Create and perform the following actions to create a new user-assigned managed identity:

  1. For Basics, choose the correct subscription and resource group, provide a unique name for the new managed identity, then select the Azure region where your cloud resources are deployed. Choose Next to continue the setup process.
  2. For Tags, use the Name and Value fields to create tags that will help organize the identity of the identity. Choose Review + create to validate the identity setup.
  3. For Review + create, review the resource configuration details, then choose Create to create your new user-assigned managed identity.

05 Navigate to Key vaults blade available at https://portal.azure.com/#browse/Microsoft.KeyVault%2Fvaults.

06 Choose Create and perform the following actions to create the Azure key vault that will store your new Customer-Managed Key (CMK):

  1. For Basics, choose the correct Azure subscription and resource group, provide a unique name for the new key vault, then select the Azure cloud region where the vault will be deployed and the appropriate pricing tier. Configure the vault retention period and enable purge protection. Both soft delete and purge protection must be enabled on the key vault. Choose Next to continue the setup process.
  2. For Access configuration, select Vault access policy for Permission model, choose Create under Access policies, and follow the setup wizard to create the policy that allows Azure Kubernetes Service to create, get, recover, wrap, and unwrap encryption keys from the new vault. For the policy principal, choose the user-assigned managed identity created at step no. 4. Once the access policy is configured, choose Create to create and attach it to the key vault. Configure the Azure resource access under Resource access. Choose Next to continue the setup.
  3. For Networking, configure the network access control for the new key vault. You can connect to your new key vault either publicly, via public IP addresses or service endpoints, or privately, using a private endpoint. Choose Next to continue.
  4. For Tags, use the Name and Value fields to create tags that will help organize the identity of the key vault. Choose Review + create to validate the key vault setup.
  5. For Review + create, review the resource configuration details, then choose Create to create your new Azure key vault.

07 Once the deployment is complete, choose Go to resource to access your new Microsoft Azure key vault.

08 In the resource navigation panel, under Objets, select Keys, then choose Generate/Import to create the Customer-Managed Key required for AKS cluster disks encryption.

09 On the Create a key setup page, provide a unique name for the encryption key in the Name box, set Key type to RSA, RSA key size to 2048, choose an activation and/or expiration date, set the Enabled flag to Yes, then choose Create to generate your new Customer-Managed Key (CMK).

10 Once your new Customer-Managed Key is available, navigate to Azure Cache for Redis blade at https://portal.azure.com/#browse/Microsoft.Cache%2FRedis.

11 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.

12 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Redis Enterprise cluster for Value, then choose Apply to list the Enterprise Redis cache clusters available in the selected subscription.

13 Click on the name (link) of the Redis cache cluster that you want to configure.

14 In the navigation panel, under Settings, select Encryption to access the encryption configuration settings available for the selected cache cluster.

15 Choose Change encryption settings, check the Use a customer-managed key setting checkbox, and perform the following actions to enable CMK-based encryption for the selected Enterprise Redis cache cluster:

  1. For User assigned managed identity, choose + Add and select the user-assigned managed identity created in step no. 4. Choose Add for selection confirmation.
  2. For Select user assigned managed identity, select the user-assigned identity with permission to access the chosen key, created in step no. 4.
  3. For Key input method, choose Select Azure key vault and key.
  4. For Subscription, choose the correct Azure subscription.
  5. For Key vault, select the Azure Key Vault created in step no. 6.
  6. For Customer-managed key (RSA), choose the Customer-Managed Key (CMK) created in step no. 9.
  7. For Version, select the latest key version.
  8. Choose Save to apply the configuration changes.

16 Repeat steps no. 13 - 15 for each Enterprise Redis cache cluster that you want to encrypt with a Customer-Managed Key (CMK), available in the selected subscription.

17 Repeat steps no. 2 – 16 for each Azure subscription created in your Microsoft Azure cloud account.

Using Azure CLI

01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:

az account list
	--query '[*].id'

02 The command output should return the requested subscription identifiers (IDs):

[
	"abcdabcd-1234-abcd-1234-abcdabcdabcd",
	"abcd1234-abcd-1234-abcd-abcd1234abcd"
]

03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):

az account set
	--subscription abcdabcd-1234-abcd-1234-abcdabcdabcd

04 Run identity create command (OSX/Linux/UNIX) to create a new user-assigned managed identity for your cache cluster, required to access the Azure key vault:

az identity create
	--name cc-project5-user-identity
	--resource-group cloud-shell-storage-westeurope
	--location westeurope
	--query '{id:id,principalId:principalId}'

05 The command output should return the resource ID and the principal ID of the new user-assigned managed identity:

{
	"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/cloud-shell-storage-westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cc-project5-user-identity",
	"principalId": "abcdabcd-abcd-abcd-abcd-abcdabcdabcd"
}

06 Run keyvault create command (Windows/macOS/Linux) to create the Microsoft Azure key vault where the required Customer-Managed Key (CMK) will be placed. Both soft delete and purge protection must be enabled on the new key vault:

az keyvault create
	--name tm-project5-key-vault
	--resource-group cloud-shell-storage-westeurope
	--location westeurope
	--enable-rbac-authorization false
	--enabled-for-deployment true
	--enabled-for-template-deployment true
	--enable-purge-protection true

07 The command output should return the configuration information available for the new Azure key vault:

{
	"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.KeyVault/vaults/tm-project5-vault",
	"location": "westeurope",
	"name": "tm-project5-vault",
	"properties": {
		"accessPolicies": [
			{
			"applicationId": null,
			"objectId": "abcdabcd-abcd-abcd-abcd-abcdabcdabcd",
			"permissions": {
				"certificates": [
				"all"
				],
				"keys": [
				"all"
				],
				"secrets": [
				"all"
				],
				"storage": [
				"all"
				]
			},
			"tenantId": "abcdabcd-1234-abcd-1234-abcdabcdabcd"
			}
		],
		"createMode": null,
		"enablePurgeProtection": true,
		"enableRbacAuthorization": false,
		"enableSoftDelete": true,
		"enabledForDeployment": true,
		"enabledForDiskEncryption": null,
		"enabledForTemplateDeployment": true,
		"hsmPoolResourceId": null,
		"networkAcls": null,
		"privateEndpointConnections": null,
		"provisioningState": "Succeeded",
		"publicNetworkAccess": "Enabled",
		"sku": {
			"family": "A",
			"name": "standard"
		},
		"softDeleteRetentionInDays": 30,
		"tenantId": "abcdabcd-1234-abcd-1234-abcdabcdabcd",
		"vaultUri": "https://tm-project5-vault.vault.azure.net/"
	},
	"resourceGroup": "cloud-shell-storage-westeurope",
	"systemData": {
		"createdAt": "2024-10-10T17:04:00.983000+00:00",
		"createdBy": "",
		"createdByType": "User",
		"lastModifiedAt": "2024-10-10T17:04:00.983000+00:00",
		"lastModifiedBy": "",
		"lastModifiedByType": "User"
	},
	"tags": {},
	"type": "Microsoft.KeyVault/vaults"
}

08 Run keyvault set-policy command (Windows/macOS/Linux) to assign the right permissions to your new Azure key vault. For the --object-id parameter, use "principalId" value returned at step no. 5:

az keyvault set-policy
	--name tm-project5-key-vault
	--object-id abcdabcd-abcd-abcd-abcd-abcdabcdabcd
	--key-permissions create get recover unwrapKey wrapKey
	--query 'properties.accessPolicies'

09 The command output should return the modified key vault configuration information:

[
	{
		"applicationId": null,
		"objectId": "abcdabcd-abcd-abcd-abcd-abcdabcdabcd",
		"permissions": {
		"certificates": [
			"all"
		],
		"keys": [
			"recover",
			"unwrapKey",
			"get",
			"create",
			"wrapKey"
		],
		"secrets": [
			"all"
		],
		"storage": [
			"all"
		]
		},
		"tenantId": "abcd1234-abcd-1234-abcd-1234abcd1234"
	}
]

10 Run keyvault key create command (Windows/macOS/Linux) to create the Customer-Managed Key (CMK) necessary to encrypt data for your Enterprise Redis cache cluster:

az keyvault key create
	--name tm-project5-redis-key
	--vault-name tm-project5-key-vault
	--kty RSA
	--size 2048
	--ops decrypt encrypt sign unwrapKey verify wrapKey
	--protection software
	--disabled false
	--query 'key.kid'

11 The command output should return the URL of the new Customer-Managed Key:

"https://tm-project5-key-vault.vault.azure.net/keys/tm-project5-redis-key/abcd1234abcd1234abcd1234abcd1234"

12 Run redisenterprise update command (OSX/Linux/UNIX) to enable CMK-based encryption for your Enterprise Redis cache cluster:

az redisenterprise update
	--ids "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Cache/redisEnterprise/cc-project5-redis-enterprise"
	--key-encryption-identity-type "userAssignedIdentity"
	--user-assigned-identity-resource-id "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/cloud-shell-storage-westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cc-project5-user-identity"
	--key-encryption-key-url "https://tm-project5-key-vault.vault.azure.net/keys/tm-project5-redis-key/abcd1234abcd1234abcd1234abcd1234"
	--query '{encryptionKey:encryption.customerManagedKeyEncryption.keyEncryptionKeyUrl}'

13 The command output should return the URL of the Customer-Managed Key (CMK) configured for the selected Redis cache cluster:

{
	"encryptionKey": "https://tm-project5-key-vault.vault.azure.net/keys/tm-project5-redis-key/abcd1234abcd1234abcd1234abcd1234"
}

14 Repeat steps no. 12 and 13 for each Enterprise Redis cache cluster that you want to encrypt with a Customer-Managed Key (CMK), available in the selected subscription.

15 Repeat steps no. 3 – 14 for each Azure subscription created in your Microsoft Azure cloud account.

References

Publication date May 12, 2025