Back to controls

Ensure 'Firewalls & Networks' Is Limited to Use Selected Networks Instead of All Networks for Cosmos DB

Limiting your Cosmos DB to only communicate on whitelisted networks lowers its attack footprint.

Category

Controls

Medium

Applies to

Microsoft Azure

Coverage

1 queries

Asset types

1 covered

Overview

Limiting your Cosmos DB to only communicate on whitelisted networks lowers its attack footprint.

Rationale

Selecting certain networks for your Cosmos DB to communicate restricts the number of networks, including the internet, that can interact with what is stored within the database.

Impact

WARNING: Failure to whitelist the correct networks will result in a connection loss.

WARNING: Changes to Cosmos DB firewalls may take up to 15 minutes to apply. To avoid disruption, ensure that sufficient time is planned for remediation or changes.

Default Value

By default, Cosmos DBs allow access from all networks.

Remediation guidance

Remediate from Azure Portal

  1. Open the Cosmos DB account using the Open in Azure button
  2. Select Networking.
  3. Under Public network access, select Selected networks.
  4. Under Virtual networks, select + Add existing virtual network or + Add a new virtual network.
  5. For existing networks, select subscription, virtual network, subnet and click Add. For new networks, provide a name, update the default values if required, and click Create.
  6. Click Save.

Service-wide remediation

Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.

Azure

Use management group or subscription Azure Policy assignments, remediation tasks where supported, landing-zone standards, and IaC modules so drift is prevented at scale.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

Azure Cosmos DB Accounts Allowing All Networks

Connectors

Microsoft Azure

Covered asset types

CosmosDBAccount

Expected check: eq []

{
  cosmosDbAccounts(where: { isVirtualNetworkFilterEnabled: false }) {
    ...AssetFragment
  }
}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon