Search code examples
google-bigqueryaccess-controlgoogle-iam

BigQuery dataset level access control via IAM


Issue: In GCP IAM I have >30 users assigned the pre-defined roles BigQuery Data Viewer and BigQuery Data Editor, and now when I create a new dataset, it's automatically accessible to these 30+ users because of "policy inheritance".

Question: As BQ project admin, I want a newly created dataset only accessible to certain users (a small subset of the 30+ users). What's the best approach to do this? Thanks!


Solution

  • You cannot override the permissions granted at higher leves. So, if you want to restrict access at dataset level, the best approach would be to:

    1) Remove the current permissions BigQuery Data Viewerand BigQuery Data Editor from project level.

    2) Grant the permissions again, but only at dataset level

    This also complies with the recommended best practice of least privilege. Also, if possible, use groups to grant the permissions, as it will be easier to manage.

    In addition to this, you could use another project to create the dataset and allow access to the desired subset of users; however, I wouldn't recommend this approach as it only makes more difficult to handle the data and the users with access to them.