Ensure that key-based authentication is disabled for your Azure Cosmos DB accounts. This security best practice enforces the use of Microsoft Entra authentication, enhancing access security.
Using access keys for authentication can create significant security vulnerabilities because of the potential leakage of secrets to source control systems and their exposure to the public. To achieve optimal security, it is recommended to disable key-based authentication for your Azure Cosmos DB accounts, enforcing your applications to use Microsoft Entra authentication instead. This method provides superior security and ease of use compared to shared access key authentication and allows secure connections via a user, service principal, or managed identity.
Audit
To determine if your Azure Cosmos DB accounts are using local authentication methods such as access keys for authentication, perform the following operations:
Getting the authentication configuration for Azure Cosmos DB accounts using Microsoft Azure Portal is not currently supported.Remediation / Resolution
To disable local (key-based) authentication for your Azure Cosmos DB accounts so that clients or applications are required to use Microsoft Entra authentication, perform the following operations:
Disabling local authentication methods for Azure Cosmos DB accounts using Microsoft Azure Portal is not currently supported.References
- Azure Official Documentation
- Disable key-based authentication with Azure Cosmos DB for NoSQL
- Security in Azure Cosmos DB
- Azure Command Line Interface (CLI) Documentation
- az account list
- az account set
- az cosmosdb list
- az cosmosdb show
- az resource update