How to Integrate Mode and BigQuery Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Integrating mode and bigquery lets analysts run SQL queries and build live charts on cloud data. The two tools work together by linking a reporting workspace to a cloud project. Data teams use this pair to share dashboards with business users. Analysts write SQL in the browser and turn results into visual reports. They can also use notebooks to explore trends with Python or R. Meanwhile, the cloud warehouse stores the raw tables and runs the heavy compute jobs. When you set up the link well, te

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 mode and bigquery lets analysts run SQL queries and build live charts on cloud data. The two tools work together by linking a reporting workspace to a cloud project.

Data teams use this pair to share dashboards with business users. Analysts write SQL in the browser and turn results into visual reports. They can also use notebooks to explore trends with Python or R. Meanwhile, the cloud warehouse stores the raw tables and runs the heavy compute jobs. When you set up the link well, teams get fast answers without risking data leaks.

How mode and bigquery handle logins and data flow

To link mode and bigquery, you usually create a cloud service account or use user logins. The reporting tool uses this account key or token to talk to the warehouse. When an analyst runs a report, the app sends the SQL query to the cloud API. The warehouse checks if the account has the right role to run jobs and read tables. If the check passes, the warehouse runs the query and sends the rows back.

The reporting app then caches the results so charts load fast for viewers. You can set schedules to refresh these reports at set times during the day. Each refresh runs a new query in the cloud project using the stored credentials. Because of this flow, the permissions on that cloud role matter a great deal. Whatever tables that role can read, the reporting workspace can also read and store.

Common risks with shared keys and broad roles

Many teams take shortcuts when they first link their chart tools to their data warehouse. They often create one service account with broad project owner or editor roles. Then they share that single connection across every analyst and report viewer in the company. This setup creates two big problems for security and data governance teams.

First, the shared key has too much power over your cloud tables. Anyone who can write SQL in that workspace can query every dataset in the project. They might pull sensitive rows like emails, phone numbers, card numbers, or national IDs. If the role has write access, a bad query could even drop or change production tables.

Second, shared accounts hide who actually ran a specific query in your cloud logs. When you look at the warehouse job history, every query shows the same service account name. You cannot tell which analyst ran an expensive query or pulled private customer records. During a security audit, this blind spot makes it hard to prove who accessed what data.

BigQuery IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to scope roles and network paths

You can fix these risks by tightening both identity rules and dataset permissions. Start by creating a dedicated service account just for one specific reporting group. Never give this account project-wide admin or editor rights in your cloud console. Instead, grant a role that only allows running jobs at the project level.

Next, grant read access only on the specific datasets that the team needs for charts. Keep raw tables with sensitive fields in separate datasets where the reporting role has no access. Build clean views that strip out or mask private fields before analysts query them. Data masking rewrites matched fields like emails or phone numbers in the query results.

You should also rotate service account keys on a regular schedule to limit exposure. If your setup supports individual user logins, turn that on for ad-hoc query work. User logins pass the analyst's own identity to the warehouse for every single query. You can also restrict network paths by allowing traffic only from known reporting IP addresses.

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

Should we use a shared service account or individual user logins?

Use individual logins when you need clear audit logs for each analyst. Use a scoped service account only for scheduled background report refreshes.

How do we stop analysts from querying raw private tables?

Put raw tables in a restricted dataset and grant the reporting role access only to clean views. You can also apply masking rules to rewrite emails, phone numbers, or card numbers in results.

Why do all warehouse logs show the same user name for every report?

This happens when your workspace uses one shared service account to run all queries. Switch to individual user tokens or add query labels to track who started each job.

The query runs. The emails stay hidden.