How to Integrate Looker and CockroachDB Safely
Teams pair looker and cockroachdb to run live business reports on distributed SQL data. Looker sends SQL queries to CockroachDB nodes and turns the results into charts. This setup lets analysts explore fresh operational data without building slow data pipelines. Still, direct database links can expose private records and hurt cluster speed. You need strict role rules, safe network paths, and query limits before going live. How looker and cockroachdb share data and permissions CockroachDB spe
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 looker and cockroachdb to run live business reports on distributed SQL data. Looker sends SQL queries to CockroachDB nodes and turns the results into charts.
This setup lets analysts explore fresh operational data without building slow data pipelines. Still, direct database links can expose private records and hurt cluster speed. You need strict role rules, safe network paths, and query limits before going live.
How looker and cockroachdb share data and permissions
CockroachDB speaks the standard PostgreSQL wire protocol for client traffic. Looker uses a PostgreSQL driver to log in and run analytical queries. When a user opens a dashboard, Looker builds a SQL query from its data model. It sends that query over an encrypted link to a CockroachDB node.
To log in, Looker needs a database user account with a password or client certificate. CockroachDB checks these credentials and loads the roles linked to that account. The database then checks if those roles have permission to read the target tables. Once verified, the node gathers rows from across the cluster and sends them back.
Looker can also write temp tables back to the database for complex data joins. If you use this feature, the database account needs write permissions on a dedicated schema. Without a dedicated scratch schema, you risk mixing temp report data with live app tables.
Common security risks in direct analytics setups
Many teams use one shared admin account to link their reporting tool to the database. This choice creates a huge security risk for the whole company. If that single account has write rights, a bad query could alter live data. Even read rights on all tables let analysts see private system tables and user secrets.
Shared accounts also ruin your database audit logs. Every query from every analyst shows up under the same database username. When a slow query locks up a node, you cannot tell who ran it. When someone exports a sensitive table, you cannot trace the action to a real person.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Exposed sensitive data is another major problem in reporting tools. Live operational tables often store emails, phone numbers, card numbers, and national IDs. If you grant broad table access, any report builder can query those raw columns. You might want data masking that rewrites matched fields in results before users see them.
Scoping database roles and network paths
Start by creating a dedicated read-only role in CockroachDB just for reporting. Grant this role select privileges only on the specific schemas and tables needed for charts. Never grant access to tables that store password hashes or app keys. If Looker needs temp tables, create a separate scratch schema and grant write rights only there.
Next, lock down the network path between the two systems. Require TLS encryption for all traffic between the analytics app and your database nodes. Use IP allowlists or private network links so only known app servers can reach the cluster. Turn off public internet access to your database ports whenever possible.
Finally, protect your live app traffic from heavy report queries. Route analytical queries to follower reads or dedicated read nodes if your setup supports them. Set statement timeouts on the reporting role so runaway queries stop before they crash a node. Good role limits keep both your data safe and your app fast.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
How does Looker talk to a CockroachDB cluster?
CockroachDB uses the standard PostgreSQL wire protocol for client connections. You set up the analytics tool using its built-in PostgreSQL driver and require TLS encryption.
Should the reporting tool use a database admin account?
No, never use an admin account for analytics. Create a dedicated database role with read-only access to the specific tables needed for reports.
How can we stop heavy reports from hurting live app writes?
Set query timeout limits on the database role used for reporting. You can also route analytics traffic to specific nodes to keep app writes fast.
Related guides
In this post