How to Integrate Sigma and Cloud SQL Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

You link sigma and cloud sql by giving your analytics tool a restricted database user. This setup lets your team build live dashboards from production tables safely. Sigma sends SQL queries straight to your Google Cloud database over the network. You do not need to copy tables into a separate warehouse first. That direct path saves time, yet it creates real risk for production data. A bad query or broad role can expose customer details to the whole company. You need tight roles, clean network r

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.

You link sigma and cloud sql by giving your analytics tool a restricted database user. This setup lets your team build live dashboards from production tables safely.

Sigma sends SQL queries straight to your Google Cloud database over the network. You do not need to copy tables into a separate warehouse first. That direct path saves time, yet it creates real risk for production data. A bad query or broad role can expose customer details to the whole company. You need tight roles, clean network rules, and clear logs before you go live.

How sigma and cloud sql share data and permissions

Sigma connects to your database like any standard PostgreSQL client. Your admin enters the database host, port, user name, and password into the tool. When an analyst opens a workbook, the tool writes a SQL query. It sends that query over TLS to your Cloud SQL instance. The database runs the query and sends the rows back to the browser.

Your database user role controls what the analytics app can read or change. Cloud SQL for PostgreSQL is a managed service with its own role model. Customers cannot create or use database accounts with true superuser attributes. Google reserves the actual superuser role for a managed system account named cloudsqladmin. You cannot edit or remove that system user.

When you create an instance, you get a default admin user named postgres. This account starts without a password, so you must set one before logging in. It belongs to the cloudsqlsuperuser group and can create roles and databases. Still, it still lacks true superuser and replication attributes. You should never give this default admin account to your analytics platform.

Common failure modes and how to scope roles

Many teams use one shared admin account for all their reporting dashboards. This mistake gives every workbook the power to read sensitive tables or drop schemas. If that password leaks, an attacker gains wide control over your database. Shared accounts also ruin your database logs. Every query in the log shows the same user name, hiding who ran it.

To fix this, use the default admin account to build a dedicated read-only role. Grant this new role permission to connect and read only specific reporting schemas. Never add it to the cloudsqlsuperuser group. That group can create event triggers, replication users, and privileged extensions. Your reporting tool does not need any of those powers.

End-to-End Encryption + SQL Query Filtering: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You also need to lock down the network path between the two systems. Do not open your database to all public internet traffic. Allow traffic only from the known IP addresses that your analytics tool uses. Require SSL encryption so data stays private while moving across the network.

Protecting sensitive columns and tracking queries

Even with a read-only role, production tables often hold sensitive customer fields. Analysts building charts rarely need raw emails, phone numbers, card numbers, or national IDs. If you expose whole tables, those fields show up in charts and exports. You can build database views that leave out sensitive columns, though views take work to maintain.

Data masking offers a cleaner way to protect sensitive fields during queries. Masking rewrites matched fields in results before they reach the user screen. Analysts still run aggregates and joins, while sensitive strings stay masked. You should also track which person runs each query for security reviews.

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

Should I connect Sigma using the default postgres user?

No, the default postgres user belongs to the cloudsqlsuperuser role and can create roles and databases. Always create a separate user with read-only permissions on specific schemas for reporting tools.

Can I create a true PostgreSQL superuser in Cloud SQL for analytics setup?

No, Google Cloud does not let customers create or use accounts with true superuser attributes. The highest customer role is cloudsqlsuperuser, which lets you manage extensions and replication.

How do I handle emails and card numbers in Cloud SQL reports?

Grant your reporting user read permissions only on safe tables or filtered database views. You can also use dynamic data masking, which rewrites matched fields in results like emails and card numbers.

The query runs. The emails stay hidden.