Which fields do I need to look for in api, to determine a bq dataset is publicly accessible?

Viewed 59

I want to generate a list of bigquery datasets that are publicly accessible. From the documentation I got to know if a role is associated with "allUsers" or "allauthenticatedUsers", we say it as publicly accessible. I was using a get-api to pull the data, not sure which field do I need to look for to grab allUsers and allauthenticatedUsers, is it "specialgroup" field ??

1 Answers

Yes it is under the specialGroup field since the values here are the Groups that are pre-created by GCP and BigQuery.

eg.

  • projectOwners --> All owners of the Project
  • projectWriters --> All Editors of the Project
  • projectReaders --> All viewers of the Project
  • allUsers --> All users who is on the internet, including authenticated and unauthenticated users
  • allAuthenticatedUsers --> All service accounts and all users on the internet who have authenticated with a Google Account

For more information, you may refer to this BigQuery Primitive Roles and GCP IAM Documentation.

In addition, the access of a dataset can also be validated by running the below command in Cloud Shell to get dataset information:

bq show --format=prettyjson project_id:dataset

Output: enter image description here

For more information, you may refer to this Getting dataset information documentation. It also has the snippets of code to retrieve dataset information using Client Libraries (ie. Python, Java, etc.)

Related