The Simplest Way to Make CockroachDB and Zscaler Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing cockroachdb and zscaler lets teams route database traffic over private network paths. Zscaler checks user identity and device state, while CockroachDB runs distributed SQL queries. This setup keeps database ports off the public internet. Engineers reach internal nodes from remote laptops without traditional virtual private networks. Network rules bring the user to the cluster door, and database roles control table tasks. How cockroachdb and zscaler handle logins and data flow Zscaler

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.

Pairing cockroachdb and zscaler lets teams route database traffic over private network paths. Zscaler checks user identity and device state, while CockroachDB runs distributed SQL queries.

This setup keeps database ports off the public internet. Engineers reach internal nodes from remote laptops without traditional virtual private networks. Network rules bring the user to the cluster door, and database roles control table tasks.

How cockroachdb and zscaler handle logins and data flow

Zscaler routes traffic from a user laptop to a private connector near your database. It checks single sign-on tokens and device posture before it opens a network path. Once that check passes, the client app sends traffic to the CockroachDB node port.

Zscaler does not read SQL commands or manage database roles inside the cluster. CockroachDB still needs its own login check using client certificates, passwords, or identity tokens. After the database checks the user, it maps them to an internal SQL role.

That role decides which tables the person can read, update, or drop. Data then flows back through the encrypted tunnel to the local client tool. Both systems must agree on user identity to keep the audit trail clean.

Common failure modes and how to scope roles

A common failure happens when teams rely on Zscaler network rules alone for security. Once the tunnel opens, everyone shares one broad database user account with full rights. If an engineer runs a bad update query, the database log shows the shared account.

Auditors cannot tell which human ran the command from the network log alone. Another risk comes from wide network segments in the Zscaler admin portal. If a rule opens the whole subnet, a user can reach test and production clusters alike.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix network scope, map each CockroachDB cluster to its own specific host definition. Grant network paths only to the exact identity groups that need database query rights. On the database side, remove shared admin passwords from team password vaults right away.

Create narrow SQL roles that match real job tasks, such as read-only support roles. Split production write roles from day-to-day read roles so mistakes cannot wipe out live tables. Turn on query logging in CockroachDB so every statement links to a named user.

Protecting sensitive columns during live queries

Even with strict network paths and narrow roles, production tables hold private customer data. Support staff and developers often run read queries on tables that store personal fields. A standard read role returns every column in a table, including private numbers by default.

When a query runs, data masking rewrites matched fields like emails, phone numbers, and card numbers. The database returns valid row structures, so debugging queries still work as expected. Teams also add approval flows for write sessions to stop unreviewed schema changes.

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

Does Zscaler replace CockroachDB user roles and passwords?

No, Zscaler only controls the network path between the user device and the cluster host. You still must set up CockroachDB roles, certificates, or tokens to control table permissions.

How do we stop engineers from sharing one database login over Zscaler?

Remove static shared passwords and tie database logins to your single sign-on identity provider. Give each engineer a personal identity so every SQL query logs a real name.

Can we mask private fields in CockroachDB query results?

Yes, data masking rewrites fields like emails, card numbers, and national IDs in query results. Engineers still run normal SQL queries, while the output replaces sensitive strings with safe text.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

The query runs. The emails stay hidden.