RBAC in BigQuery lets you control who can query, update, or administer datasets, tables, and routines by granting predefined or custom roles at the project, dataset, or object level.
Role-Based Access Control (RBAC) in BigQuery is Google Cloud IAM applied to datasets, tables, and routines. You grant roles—collections of permissions—to principals (users, groups, or service accounts) to control read, write, and admin actions.
BigQuery offers predefined roles such as roles/bigquery.dataViewer
, roles/bigquery.dataEditor
, and roles/bigquery.admin
. You can also create custom roles that bundle only the permissions you need.
Use bq update --dataset_access
or the Cloud Console to add a { "userByEmail": "dev@acme.com", "role": "roles/bigquery.dataEditor" }
entry to the dataset’s ACL. This lets a developer edit tables but not manage the project.
Yes. Authorized views or column-level security policies can restrict access per table or even per column, while keeping dataset-wide roles broader.
Enable Cloud Audit Logs for BigQuery. Each SetIamPolicy
call records the actor, timestamp, and new bindings—crucial for security reviews.
First, list current bindings with gcloud projects get-iam-policy
. Remove only the specific member/role pair, then test affected workloads in staging before production rollout.
Create custom roles when predefined roles are too broad. For example, a role that allows bigquery.jobs.create
and bigquery.tables.get
, but not bigquery.tables.update
, fits read-only analytics services.
Run gcloud projects get-iam-policy PROJECT_ID
or view the IAM page in Cloud Console. For datasets, use bq show --format=json --dataset_id
.
BigQuery IAM does not natively support TTLs. Use automation (Cloud Scheduler + Cloud Functions) to revoke roles after a set period.
roles/viewer
is a project-wide read-only role across all services, while roles/bigquery.dataViewer
is scoped to BigQuery data resources only.