How to Configure BigQuery Encryption at REST

Published
Length
3 min read

Luis Felipe Dias

All posts

Google turns on bigquery encryption at rest by default for every table and dataset. You can also set up your own keys in Cloud KMS for tighter control. Most teams start with the default cloud setup and add custom keys later. They grant broad cloud roles so engineers and apps can read the tables. When those roles are too wide, any logged-in user can pull clear text rows. How bigquery encryption at rest works in Google Cloud The platform scrambles your data before it writes anything to a disk.

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.

Google turns on bigquery encryption at rest by default for every table and dataset. You can also set up your own keys in Cloud KMS for tighter control. Most teams start with the default cloud setup and add custom keys later. They grant broad cloud roles so engineers and apps can read the tables. When those roles are too wide, any logged-in user can pull clear text rows.

How bigquery encryption at rest works in Google Cloud

The platform scrambles your data before it writes anything to a disk. It breaks each file into smaller chunks and locks each chunk with a data key. A master key then wraps those data keys to keep them safe. In the default setup, Google holds and rotates the master keys for your team. You do not need to touch a single setting to get this baseline safety.

Some teams need to own the master key for strict rules or audits. For this, you set up a key ring inside the cloud key service. You then grant the data warehouse service account permission to use that key. Next, you link the custom key to your datasets or individual tables. You can also set a default key at the project level for new tables.

Managing key rotation and cloud roles

Key rotation is a big part of keeping stored data safe over time. When you rotate a key, the system makes a new version for new data. Old table chunks stay locked with the old key version until you rewrite them. If you revoke a key version, nobody can read the tables tied to it. All queries against those tables will fail right away.

Teams must also watch who gets permission to manage keys and read datasets. A user with both data reader roles and key roles can read everything. Many teams hand out project-wide editor roles to speed up daily work. This common shortcut gives way too many people the power to run broad queries.

What storage keys solve and the runtime gap they leave open

Storage keys protect your files if someone steals a physical drive from a data center. They also give you a fast kill switch if you revoke the master key. That is where disk protection ends.

Encryption at Rest + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Once a user or app logs in with a valid role, the database unlocks the data. The system decrypts the blocks in memory and returns clear text results to the caller. Storage keys decide how data sits on disk, not what queries do in flight. They do not stop an engineer from running a broad select on a sensitive table. They do not rewrite emails, phone numbers, card numbers, or national IDs in query results. A leaked service account key still lets an attacker pull the whole table in clear text.

To stay safe during daily work, you need controls at the query level. You must check individual statements before they run and mask sensitive fields in 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 encrypt data on disk without extra setup?

Yes, the platform locks all stored table data by default using Google-managed keys. You do not need to change any settings to turn on this base layer.

When should a team use customer-managed keys instead of default keys?

Use custom keys when audit rules say you must control key rotation and revocation. This lets you cut off table reads by disabling the key yourself.

Does disk encryption hide sensitive columns from logged-in analysts?

No, the database unlocks the data for any user with valid read roles. You need runtime data masking to rewrite emails, phone numbers, or card numbers in results.

The query runs. The emails stay hidden.