π‘οΈ Azure Cosmos DB Entra ID Client Authentication is not usedπ’βͺ
- Contextual name: π‘οΈ Entra ID Client Authentication is not usedπ’βͺ
- ID:
/ce/ca/azure/cosmos-db/entra-id-client-authentication - Tags:
- βͺ Impossible policy
- π’ Policy with categories
- π’ Policy with type
- Policy Type:
BEST_PRACTICE - Policy Categories:
SECURITY
Similar Policiesβ
- Internal:
dec-x-b4d3d9dc
Similar Internal Rulesβ
| Rule | Policies | Flags |
|---|---|---|
| βοΈ dec-x-b4d3d9dc | 2 |
Descriptionβ
Descriptionβ
Cosmos DB can use tokens or Entra ID for client authentication, which in turn uses Azure RBAC for authorization. Using Entra ID is significantly more secure because Entra ID handles credentials, enables MFA and centralized management, and Azure RBAC is better integrated with the rest of Azure.
Rationaleβ
Entra ID client authentication is considerably more secure than token-based authentication because tokens must be stored on the client. Entra ID does not require this.
Auditβ
From PowerShellβ
$cosmosDbName = "{{cosmos-db-account-name}}"
$resourceGroup = "{{resource-group-name}}"
az cosmosdb show --name $cosmosDbName --resource-group $resourceGroup | ConvertFrom-JsonIn the resulting output,
disableLocalAuthshould betrue.Default Valueβ
The default is to use tokens/keys for client authentication.
Referencesβ
Remediationβ
Remediationβ
Map all resources that currently access the Azure Cosmos DB account using keys or access tokens.
Create an Entra ID identity for each of these resources:
- For Azure resources, you can create a managed identity. You may choose between system-assigned and user-assigned managed identities.
- For non-Azure resources, create an Entra ID identity. Grant each Entra ID identity the minimum permission it requires. When possible, we recommend you use one of the 2 built-in role definitions: Cosmos DB Built-in Data Reader or Cosmos DB Built-in Data Contributor. Validate that the new resource is functioning correctly. After new permissions are granted to identities, it may take a few hours until they propagate. When all resources are working correctly with the new identities, continue to the next step.
From PowerShellβ
$cosmosDbName = "{{cosmos-db-account-name}}"
$resourceGroup = "{{resource-group-name}}"
$cosmosDb = az cosmosdb show --name $cosmosDbName --resource-group $resourceGroup | ConvertFrom-Json
az resource update --ids $cosmosDb.id --set properties.disableLocalAuth=true --latest-include-preview
... [see more](remediation.md)