How to Integrate Sigma and CockroachDB Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair sigma and cockroachdb to run live analytics on distributed SQL data. Sigma translates spreadsheet actions into SQL queries that run inside your CockroachDB cluster. This workflow lets business users explore live tables without moving data around. Still, direct database links bring new security risks for your data engineering team. You must control who runs queries and what fields they can read. How sigma and cockroachdb share queries and data Sigma connects to CockroachDB using th

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.

Teams pair sigma and cockroachdb to run live analytics on distributed SQL data. Sigma translates spreadsheet actions into SQL queries that run inside your CockroachDB cluster.

This workflow lets business users explore live tables without moving data around. Still, direct database links bring new security risks for your data engineering team. You must control who runs queries and what fields they can read.

How sigma and cockroachdb share queries and data

Sigma connects to CockroachDB using the standard Postgres wire protocol over TLS. An admin enters the cluster host name, port, and database login details. Once linked, Sigma reads the database schema to show tables and columns.

Analysts then build charts and tables inside the Sigma browser interface. Sigma turns each user click into a live SQL query right away. It sends that query to the CockroachDB cluster over the network.

CockroachDB runs the query across its nodes and returns the matching rows. Sigma displays the results to the analyst in a clean grid view. No full copies of your raw tables stay inside the analytics tool.

Permissions depend on the database role tied to the Sigma connection. If that role can read a table, Sigma can query it too. You can also set up team rules inside Sigma to limit views.

Common security risks and how to scope database roles

Many teams use one shared service account for all Sigma queries. This choice creates a big blind spot in your database audit logs. Every query in CockroachDB looks like it came from the same user.

When a slow query hurts cluster speed, you cannot find the person. Audits also fail when you cannot tie data views to specific people. Shared accounts often hold far too many rights across the whole cluster.

If an admin uses a root role, analysts might read secret tables. A bad query could even change or delete live production rows. You should create a dedicated read-only role just for Sigma users.

Grant this role select rights only on the schemas meant for analytics. Never give write, update, or drop rights to an analytics service account. Keep private tables in a separate schema that the role cannot touch.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You also need to protect private data inside your shared analytics tables. Customer tables often hold emails, phone numbers, card numbers, and national IDs. Database views or masking rules can rewrite matched fields in results.

Network security matters just as much as database role design. Do not open your CockroachDB cluster to the whole public internet. Limit incoming traffic to the known IP addresses that Sigma owns.

Require TLS encryption on every link between the two cloud systems. Check your CA certificates so neither tool talks to an untrusted host. Rotate your database passwords and client keys on a set schedule.

Managing query load and audit trails in production

Live analytics queries look very different from fast app transactions. A single chart refresh might scan millions of rows across several nodes. This heavy load can slow down the main app for your customers.

CockroachDB lets you control where and how these heavy queries run. You can route analytics traffic to specific nodes built for read workloads. This setup keeps your main transactional nodes fast and ready for writes.

You should also set a hard time limit on every analytics role. If a Sigma user builds a bad join, the database stops it. Stopping runaway queries early saves CPU power and keeps costs down.

Good logging helps you track both speed and security over time. Turn on SQL audit logging for the tables that hold sensitive data. Send those logs to a central tool where your security team checks them.

Review which tables get queried the most each week by your teams. Drop unused table grants so your read-only role stays small and safe. Regular checks keep your data pipeline fast, clean, and easy to manage.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How does Sigma talk to a CockroachDB cluster?

Sigma uses the standard Postgres wire protocol to talk to CockroachDB. It sends live SQL queries over an encrypted TLS network connection.

Should I give Sigma a read-write database role?

No, you should give Sigma a strict read-only database role at first. Only grant write access to a separate schema if you need materialization.

How do I protect private fields like emails and card numbers?

Use restricted views or dynamic data masking to protect sensitive columns. Masking rewrites matched fields like emails or card numbers in query results.

The query runs. The emails stay hidden.