Check ID: cosmosdb_account_firewall_use_selected_networks
Provider: Azure
Service: cosmosdb
Severity: MEDIUM
Categories: internet-exposed, trust-boundaries
Resource type: microsoft.documentdb/databaseaccounts

What 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 to Selected 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=Disabled with Private Link
  • Apply defense in depth and monitor access and firewall changes

Remediation

az cosmosdb network-rule add -g <RESOURCE_GROUP> -n <ACCOUNT_NAME> —subnet <example_resource_id>

References

Where this check fires

This check runs on every scheduled scan against your Azure account. Findings appear at Cloud Security → Findings filterable by Check 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