🚀 Submit a Challenge — SecDim AppSec Village CTF at DEF CON 34 and Win a ROG Xbox Ally

Missing Customer-Managed Key Encryption on Azure Cosmos DB

The Azure Cosmos DB account does not configure a customer-managed encryption key because key_vault_key_id is omitted from the azurerm_cosmosdb_account resource. As a result, data at rest is protected only by Microsoft-managed keys, reducing customer control over key rotation, revocation, separation of duties, and cryptographic governance. This may violate security or compliance requirements where sensitive data must be encrypted using keys controlled by the organisation.

Remediation

Configure Cosmos DB to use a customer-managed key stored in Azure Key Vault by setting key_vault_key_id. Ensure the Cosmos DB managed identity has the required permissions to access the key, and define a key rotation and revocation process aligned with organisational security requirements.

Metadata

  • Severity: medium
  • Slug: missing-customer-managed-key-encryption-on-azure-cosmos-db

Tags

  • Azure

CWEs

  • 922: Insecure Storage of Sensitive Information

OWASP

  • A02:2021: Cryptographic Failures

Available Labs

Open Azure labs in SecDim Play for this vulnerability.

Try it yourself

Find, Hack and Fix Your First Vulnerability

Reading about security bugs is one thing — fixing one is how the skill sticks. Play a free challenge from the wargame, no setup required.