How to Configure BigQuery Rotate Password

Published
Length
3 min read

Luis Felipe Dias

All posts

To run a bigquery rotate password workflow, replace static service account keys or update identity passwords. BigQuery does not use native database passwords, so teams rotate cloud keys and OAuth tokens instead. Most data teams share one long-lived service account key across many tools and scripts. When that shared role has broad permissions, anyone with the key can read or delete tables. How a bigquery rotate password workflow works in practice BigQuery relies on cloud identity and service 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.

To run a bigquery rotate password workflow, replace static service account keys or update identity passwords. BigQuery does not use native database passwords, so teams rotate cloud keys and OAuth tokens instead. Most data teams share one long-lived service account key across many tools and scripts. When that shared role has broad permissions, anyone with the key can read or delete tables.

How a bigquery rotate password workflow works in practice

BigQuery relies on cloud identity and service accounts instead of local database user accounts. Human users log in with their workspace email, password, and multi-factor checks. Automated apps and scripts use service account keys or short-lived tokens to run queries. When teams plan a password rotation, they must handle both human logins and machine keys.

For human users, admins set password expiration rules in the main cloud identity directory. The directory forces users to pick a new password on a fixed schedule. When a user changes their password, active web sessions and local tokens expire right away. The user must log in again before they can run new queries in the console.

For apps and scripts, teams rotate service account keys using a two-key overlap method. First, an admin or secret tool creates a second key for the same service account. Next, the team updates every app and worker node to use the new key file. After logs confirm the old key is idle, the admin deletes the old key.

Planning key updates without breaking data pipelines

Rotating keys across dozens of scheduled jobs can break production pipelines if done too fast. A single missed script with an old key will fail as soon as that key dies. Teams should map every app that uses a service account before starting a rotation. Giving each app its own service account makes rotation much safer and easier to track.

Secret stores can automate the creation and storage of new service account keys on a schedule. Still, the app still needs to reload the secret from storage without needing a full restart. Many teams move away from exported key files and use workload identity federation instead. This method issues short-lived tokens by default so teams do not have to rotate static files.

Application-to-Application Password Management + BigQuery IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native credential rotation solves and what it misses

Rotating passwords and service account keys reduces the risk of old, leaked credentials. If a key sits in an old code repo, deleting that key stops outside attackers. Regular rotation also forces teams to clean up unused service accounts and forgotten automation scripts. It proves that the team knows where credentials live and how to update them.

Still, key rotation only controls who can log in at the start of a session. Once an engineer or app logs in with a fresh key, cloud roles take over. Coarse roles cannot stop a valid user from running a massive table scan or drop command. Native rotation also cannot mask sensitive fields like emails, phone numbers, or card numbers in results.

To control what happens after login, teams need checks on each query in flight. Granular controls let teams approve risky statements and rewrite sensitive columns in query results.

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 inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

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 approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Does BigQuery have a built-in database user password?

No, BigQuery uses cloud identity accounts and service accounts instead of local database passwords. You rotate human user passwords in your identity provider and rotate keys for service accounts.

How do you rotate service account keys with zero downtime?

Create a new key first while keeping the old key active in the cloud console. Move all apps to the new key, check the logs, and then delete the old key.

Does rotating a key protect sensitive data inside tables?

No, a fresh key still gets the full permissions attached to its cloud role. Protecting emails or card numbers inside tables requires runtime query rules and data masking.

The query runs. The emails stay hidden.