The Simplest Way to Make Azure Cosmosdb and Fortigate Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running azure cosmosdb and fortigate together protects cloud data with strict perimeter firewall rules. Your firewall filters traffic by IP, while the database handles user identity and permissions. This setup keeps public networks away from your cloud database endpoints. Teams can run apps in hybrid clouds and control every network packet. Yet network rules alone do not control what a user reads or writes inside the database. How azure cosmosdb and fortigate handle logins and data flow Your

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Running azure cosmosdb and fortigate together protects cloud data with strict perimeter firewall rules. Your firewall filters traffic by IP, while the database handles user identity and permissions.

This setup keeps public networks away from your cloud database endpoints. Teams can run apps in hybrid clouds and control every network packet. Yet network rules alone do not control what a user reads or writes inside the database.

How azure cosmosdb and fortigate handle logins and data flow

Your firewall sits at the edge of your virtual network or branch office. It checks source IP addresses, ports, and network zones before packets move forward. Only approved subnets can send traffic toward the cloud database endpoint.

Teams often join the firewall to a virtual network using private links. This keeps database traffic off the public web during transit. The firewall logs every packet that crosses between your local network and the cloud.

Once traffic passes the firewall, the cloud database checks the caller identity. Apps and users log in with role-based permissions or master keys. The database then checks if that role can read or write specific items.

These two tools work at different layers of your stack. The firewall guards the network path and blocks unknown hosts. The database guards the data containers and checks identity tokens on each request.

Common failure modes and how to scope network paths

Many teams rely too much on firewall rules for database safety. They open a network path from an app subnet and share one master key. Every person and app on that subnet then gets full database control.

Shared keys make it hard to track who ran a bad query. Your firewall log shows the network packet, not the database query text. Your database log shows the shared key, not the human user behind it.

Broad IP rules also create risk when cloud endpoints change IP addresses. If admins open wide CIDR blocks to fix broken traffic, bad actors gain room to move. Static firewall rules can drift out of sync with cloud network changes.

Azure RBAC + CosmosDB RBAC: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, lock down both the network path and the identity role. Use private endpoints so traffic stays inside your private cloud backbone. Set the firewall to allow only specific app hosts to reach that private IP.

Next, stop using shared master keys for human users and support teams. Give each app and user a narrow role in your cloud directory. Scope permissions down to the exact database container they need to read.

Auditing queries and protecting sensitive fields

Even with strict firewall rules, engineers still need to check production data. They run queries to fix bugs or check account states. Network firewalls cannot inspect the body of encrypted database queries.

If a query pulls customer records, raw data flows right back to the user laptop. These records often hold emails, phone numbers, card numbers, or national IDs. A network log will never show which records left the database.

Teams need a way to tie every database action to a single user identity. You should log the exact query text alongside the person who ran it. Data masking can also rewrite matched fields like card numbers or emails in query results.

Combining strict firewall paths with granular query controls gives you full visibility. The firewall stops outside network attacks at the edge. User-level auditing and field masking keep the data safe during daily work.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Fortigate inspect queries sent to Azure Cosmos DB?

No, the firewall checks network packets, IP addresses, and TLS handshakes. It does not parse database query syntax or map queries to specific database containers.

How should we route traffic between Fortigate and Azure Cosmos DB?

Use private endpoints inside your virtual network instead of public IP ranges. Route traffic through your firewall interface to the private endpoint IP for clean network control.

Why are firewall rules not enough to secure Azure Cosmos DB?

Firewall rules only check where traffic comes from on the network. If two users share a subnet or key, the firewall cannot tell them apart or limit their queries.

The query runs. The emails stay hidden.