How to Integrate Metabase and Spanner Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Integrating metabase and spanner lets teams build charts directly on distributed cloud databases. This setup turns raw transactional rows into clear dashboards for daily reporting. Many teams struggle to link these two systems without opening broad security holes. A safe link needs tight identity rules, clean network paths, and clear audit trails. How data and identity flow between metabase and spanner The analytics app acts as a client that sends queries to the database. It uses a cloud ser

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.

Integrating metabase and spanner lets teams build charts directly on distributed cloud databases. This setup turns raw transactional rows into clear dashboards for daily reporting.

Many teams struggle to link these two systems without opening broad security holes. A safe link needs tight identity rules, clean network paths, and clear audit trails.

How data and identity flow between metabase and spanner

The analytics app acts as a client that sends queries to the database. It uses a cloud service account or role to log in and read tables.

First, an admin sets up a dedicated cloud account for the reporting tool. Next, the admin grants that account read permissions on specific database tables. The reporting app stores the login key and opens a pool of sessions.

When a user loads a dashboard, the app builds a SQL query. It sends that query over an encrypted network link to the cloud database. The database runs the query and sends the result rows back to the app. Finally, the app turns those rows into charts and tables in the browser.

By default, every dashboard user shares that single database login account. The database sees the app account rather than the human user behind the screen.

Common risks when linking analytics tools to cloud databases

Sharing one service account across an entire company creates huge blind spots. If a bad query slows down the database, teams cannot see who ran it. Cloud logs only show the shared app account name for every single read.

Overly broad permissions create another major risk for production data. Admins often give the reporting app full read rights across the entire database. This means any chart builder might query sensitive tables by mistake.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static service account keys also bring high security risks to your team. Keys stored in app settings can leak through backups or admin screens. If an attacker steals that key, they can read your core database from anywhere.

Sensitive fields like emails, phone numbers, and card numbers need extra care. Standard database roles grant table access all at once. If a table holds national IDs, every chart user might see those raw values. Masking rules that rewrite matched fields in results help reduce this exposure.

Scoping roles and network paths for safer reporting

You can fix many risks by tightening how the two tools talk. Start by removing broad admin or owner roles from the reporting service account. Create a custom role that only reads the exact tables needed for charts.

If your database supports fine-grained access control, lock down specific sensitive columns. Keep raw payment records and national IDs out of the reporting role completely. You can also build safe views that leave out emails and phone numbers.

Next, lock down the network path between the analytics host and the cloud. Run the reporting app inside a private network with strict firewall rules. Block public traffic and use private cloud routes to reach the database API.

Rotate your login keys on a strict schedule or use workload identity features. Short-lived credentials limit the damage if a key ever leaks from the app. Finally, turn on database audit logs to track query volume and catch spikes early.

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 Metabase write data back to a Spanner database?

Yes, the app can run write queries if you enable actions and give permissions. For safety, always give the reporting service account read-only database roles in production.

How do we protect emails and card numbers in dashboards?

You can restrict column permissions in the cloud role or use data masking. Masking rewrites matched fields like emails and card numbers in query results before rendering.

Why do database logs show one user for all dashboard queries?

The reporting tool pools connections using a single cloud service account. Without user-level tracking, the database only records the shared app account for every query.

The query runs. The emails stay hidden.