The Simplest Way to Make BigQuery and Harness Work Like They Should
Teams use bigquery and harness together to run data jobs and check release metrics. Harness triggers pipeline steps, while BigQuery stores and queries the data for those checks. This setup lets engineers automate schema changes, run analytics tests, and gate deployments. A pipeline can read table metrics before rolling out new app code. It can also write build logs to a central warehouse for reporting. How bigquery and harness share keys and data To link these two systems, engineers set up a
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 use bigquery and harness together to run data jobs and check release metrics. Harness triggers pipeline steps, while BigQuery stores and queries the data for those checks.
This setup lets engineers automate schema changes, run analytics tests, and gate deployments. A pipeline can read table metrics before rolling out new app code. It can also write build logs to a central warehouse for reporting.
How bigquery and harness share keys and data
To link these two systems, engineers set up a Google Cloud service account. Harness uses a secret manager or cloud connector to hold that account identity. When a pipeline runs, the runner sends queries to the BigQuery API.
Workload identity federation is a safer way to log in than static keys. With federation, Harness trades a short-lived pipeline token for a cloud access token. This removes the need to store static JSON key files in pipeline settings.
Once logged in, the runner sends SQL jobs to the target dataset. BigQuery runs the query and returns the job status and result rows. Harness reads those results to decide if a deployment stage should pass or fail.
Common risks with shared keys and broad roles
Many teams start by sharing one service account across all pipelines. This choice creates big blind spots in cloud audit logs. When a bad query runs, logs only show the shared account name. You cannot tell which engineer or pipeline triggered the change.
Broad cloud roles make this problem much worse. If a pipeline gets project-wide edit rights, any user who edits the pipeline gains those rights. A flawed script could drop tables or read private customer records.
BigQuery IAM + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged ad-hoc queries also hurt security during build fixing. Engineers often copy service keys to local laptops to test failing pipeline queries. Once a key leaves the CI runner, you lose control over who uses it.
How to scope roles and network paths
Start by creating separate service accounts for each project and stage. Development pipelines should never hold keys that can read production datasets. Grant permissions at the dataset or table level instead of the project level.
Next, separate read tasks from write tasks. A pipeline step that checks deployment metrics only needs permission to run read queries. Only schema migration steps should hold rights to alter tables or insert data.
Lock down network paths between your build runners and Google Cloud. Run self-hosted delegates inside a private cloud network when possible. Use private cloud routing so query traffic never crosses the public internet. Set up cloud firewall rules to allow traffic only from known runner IP addresses.
Finally, protect sensitive columns in your tables. If a table holds emails, phone numbers, card numbers, or national IDs, restrict column rights. Data masking rewrites matched fields in results before the pipeline runner processes them. This keeps raw personal data out of build logs and test outputs.
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 should Harness authenticate to BigQuery in production?
Use workload identity federation instead of static JSON service account keys. Federation lets the pipeline runner request temporary tokens for each job run. This stops long-lived keys from leaking in build logs or secret stores.
How do we limit what a pipeline can read in BigQuery?
Assign roles at the individual dataset or table level rather than the whole project. Create distinct service accounts for build tests, metric checks, and production schema changes. Apply column-level security or data masking on fields like emails and phone numbers.
Why do our BigQuery audit logs show the same user for every pipeline?
This happens when multiple pipelines share a single Google Cloud service account. BigQuery logs the service account identity rather than the person who started the build. Give each pipeline its own identity or attach user metadata to every query job.
Related guides
In this post