Check ID:
Provider: Azure
Service:
Severity: MEDIUM
Categories:
Resource type:
cosmosdb_account_firewall_use_selected_networksProvider: Azure
Service:
cosmosdbSeverity: MEDIUM
Categories:
internet-exposed, trust-boundariesResource type:
microsoft.documentdb/databaseaccountsWhat this check verifies
Azure Cosmos DB accounts limit connectivity to selected networks using virtual network rules and/or IP allowlists rather than permitting access from all networks. The evaluation determines whether the account’s network firewall enforces this restriction.Risk
Access from all networks enlarges the attack surface. If keys or tokens are exposed or privileges are misconfigured, attackers anywhere can read or modify data, harming confidentiality and integrity. Weak segmentation also enables SSRF/pivot paths from Azure services and can impact availability through abuse.Recommendation
Set network access toSelected networks with least privilege:
- Prefer private endpoints or VNet service endpoints with subnet ACLs
- Keep IP allowlists minimal; avoid
0.0.0.0 - When feasible, set
publicNetworkAccess=Disabledwith Private Link - Apply defense in depth and monitor access and firewall changes
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
az cosmosdb network-rule add -g <RESOURCE_GROUP> -n <ACCOUNT_NAME> —subnet <example_resource_id>
References
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-vnet-service-endpoint
- https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall
- https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security?tabs=azure-portal
Where this check fires
This check runs on every scheduled scan against your Azure account. Findings appear at Cloud Security → Findings filterable byCheck ID = cosmosdb_account_firewall_use_selected_networks. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Azure checks