3.2 Ensure that Cosmos DB uses Private Endpoints where possible (Automated)
Profile Applicability
- Level 2
Description
Private endpoints limit network traffic to approved sources.
Rationale
For sensitive data, private endpoints allow granular control of which services can communicate with Cosmos DB and ensure that this network traffic is private. This can be set this up on a case by case basis for each service to be connected.
Impact
Only whitelisted services will have access to communicate with the Cosmos DB.
Audit Procedure
Audit From Azure Portal
- Open the portal menu.
- Select the Azure Cosmos DB blade.
- Select the Azure Cosmos DB account.
- Select Networking.
- Ensure
Public network accessis set toSelected networks. - Ensure the listed networks are set appropriately.
- Select Private access.
- Ensure a private endpoint exists and
Connection stateis Approved.
Audit From Azure Policy
- Policy ID:
58440f8a-10c5-4151-bdce-dfbaad4a20b7- Name: 'CosmosDB accounts should use private link'
Expected Result
A private endpoint should exist with Connection state set to Approved, and Public network access should be set to Selected networks.
Remediation
Remediate From Azure Portal
- Open the portal menu.
- Select the Azure Cosmos DB blade.
- Select the Azure Cosmos DB account.
- Select Networking.
- Select Private access.
- Click
+ Private Endpoint. - Provide a Name.
- Click Next.
- From the Resource type drop down, select
Microsoft.AzureCosmosDB/databaseAccounts. - From the Resource drop down, select the Cosmos DB account.
- Click Next.
- Provide appropriate Virtual Network details.
- Click Next.
- Provide appropriate DNS details.
- Click Next.
- Optionally provide Tags.
- Click
Next : Review + create. - Click Create.
Default Value
By default Cosmos DB does not have private endpoints enabled and its traffic is public to the network.
References
- https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints
- https://docs.microsoft.com/en-us/azure/private-link/tutorial-private-endpoint-cosmosdb-portal
- https://docs.microsoft.com/en-us/cli/azure/cosmosdb/private-endpoint-connection?view=azure-cli-latest
- https://docs.microsoft.com/en-us/cli/azure/network/private-endpoint?view=azure-cli-latest#az-network-private-endpoint-create
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-network-security#ns-2-secure-cloud-native-services-with-network-controls
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 12.2 Establish and Maintain a Secure Network Architecture | X | X | |
| v7 | 14.1 Segment the Network Based on Sensitivity | X | X |