Your organization needs to grant users access to query datasets in BigQuery but prevent them from accidentally deleting the datasets. You want a solution that follows Google-recommended practices. What should you do?
A.
Add users to roles/bigquery user role only, instead of roles/bigquery dataOwner.
B.
Add users to roles/bigquery dataEditor role only, instead of roles/bigquery dataOwner.
C.
Create a custom role by removing delete permissions, and add users to that role only.
D.
Create a custom role by removing delete permissions. Add users to the group, and then add the group to the custom role.
I believe the key part is the "following Google Best Practices" phrase.
A - Works, but doesn't follow GCP best practices
B - Doesn't work as the role grants permission to delete datasets
C - Works, but is more complicated than A and doesn't follow Google best practices
D - Correct, more complicated than A, but it follows Google Best Practices.
Read description carefully "prevent from accidentally deleting the datasets". Not tables, datasets! option B does not allow to delete datesets either.
Check dateset permissions in the roles/bigquery.dataEditor:
bigquery.datasets.create
bigquery.datasets.get
bigquery.datasets.getIamPolicy
bigquery.datasets.updateTag
You CANNOT delete dataset with option "B"
I think A is the Answer and it follow GCP best practices.
https://cloud.google.com/iam/docs/understanding-roles#bigquery-roles
We do have the role - BigQuery User which does the below permissions
When applied to a project, this role also provides the ability to run jobs, including queries, within the project.
bigquery.datasets.create
bigquery.datasets.get
bigquery.datasets.getIamPolicy
bigquery.datasets.create allows the creation of new datasets within the project; the creator is granted the BigQuery Data Owner role (roles/bigquery.dataOwner) on these new datasets so he can delete these created datasets
I don't think A works properly.
roles/bigquery.user has bigquery.datasets.create. And the documentation states:
> Additional, allows the creation of new datasets within the project; the creator is granted the BigQuery Data Owner role (roles/bigquery.dataOwner) on these new datasets.
If bigquery.user creates a new dataset, it's likely that bigquery.user will get permission to delete that dataset. This means that bigquery.user may have permission to delete data.
https://cloud.google.com/bigquery/docs/access-control
See the question carefully "accidentally deleting the datasets" it is saying not to delete "the" datasets which means original dataset which existed before his creation .So answer is A.
A bigquery.user will get a "data owner" role on the datasets he creates. That means he can delete those data sets he created. In that sense A fails to that extent.
Correct Answer is (D):
The proper answer regarding to bigquery roles is the listed in the options, the proper rol that resolve this requirement is: roles/bigquery.dataViewer
https://cloud.google.com/bigquery/docs/access-control#custom_roles
on the other hand, the question explicitly is asking to use the GCP best practices on IAM :
GCP Best Practices explain clearly these rules:
Policy management
❑ Set organization-level IAM policies to grant access to all projects in your organization.
❑ Grant roles to a Google group instead of individual users when possible. It is easier to add members to and remove members from a Google group instead of updating an IAM policy to add or remove users.
❑ If you need to grant multiple roles to allow a particular task, create a Google group, grant the roles to that group, and then add users to that group.
https://cloud.google.com/iam/docs/using-iam-securely#policy_management
I correct myself: https://cloud.google.com/iam/docs/understanding-custom-roles
Key Point: Custom roles enable you to enforce the principle of least privilege, ensuring that the user and service accounts in your organization have only the permissions essential to performing their intended functions.
Answer is A: roles/bigquery.user is a BigQuery User role which when applied to a project provides the ability to run jobs, including queries, within the project. A member with this role can enumerate their own jobs, cancel their own jobs, and enumerate datasets within a project.
Ref: https://cloud.google.com/iam/docs/understanding-roles#bigquery-roles
you can create data set with bigquery.user role because it has bigquery.datasets.create permissions. And if a user has bigquery.datasets.create permissions, when that user creates a dataset, they are granted bigquery.dataOwner access to it. So A is NOT a choice
A is correct because the key point is.. users can query the dataset but not delete. For querying, jobs create role required which comes under bigquery user role
You can create a custom role at the project or organization level. Since users are added to role, it should be A. https://cloud.google.com/iam/docs/creating-custom-roles
I think the right answer is A due to a predefine valid role. I mean that biqguery.user role is valid so it's not needed to create a custom role. bigquery.user role can't delete datasets created by anyone.
https://cloud.google.com/iam/docs/understanding-roles#bigquery.user
bigquery.datasets.delete
bigquery.datasets.deleteTagBinding
I think the right answer is A due to a predefine valid role. I mean that biqguery.user role is valid so it's not needed to create a custom role. bigquery.user role can't delete datasets.
https://cloud.google.com/iam/docs/understanding-roles#bigquery.user
I think it's A for a couple of reasons.
1. you don't need to create a custom role if there is already one there, an it's Google best practice to ALWAYS use their roles, not create new ones unless absolutely necessary, which is very few cases and I'd be surprised if they'd put a Q in there that would actually .
2. the "roles/bigquery.user" role already allows for bigquery.datasets.create, bigquery.datasets.get, bigquery.datasets.getIamPolicy, which this Q is asking for.
I have no idea, but I think it's D as you add users to group first, then to a role, which is google best practice, but not sure about custom role in the first place.
The correct answer is C. Create a custom role by removing delete permissions, and add users to that role only.
This is the recommended approach by Google, as it provides a granular level of control over user permissions. By creating a custom role that only allows users to query datasets, you can ensure that they do not have the ability to accidentally delete them.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
someoneinthecloud
Highly Voted 4 years, 4 months agoTAvenger
3 years, 8 months agoBableves
2 years, 7 months agoafooh
2 years, 3 months agoYuvarajK
3 years, 5 months agoAbhi00754
1 year, 7 months agoAbhi00754
1 year, 7 months agokyo
3 years, 4 months agoBossam
2 years, 4 months agoZina12
1 year, 11 months agobrvinod
2 years, 9 months agoESP_SAP
Highly Voted 4 years, 3 months agoJackGlemins
3 years, 9 months agoJackGlemins
3 years, 9 months agoprashuG
4 years, 2 months agoj1c4b
3 years, 7 months agoAnji14
Most Recent 2 months agoTimfdklfajlksdjlakf
2 months, 3 weeks agoomunoz
6 months, 2 weeks agorahulsahni849
8 months, 2 weeks agoblackBeard33
9 months agoAks14
9 months, 1 week agoleoalvarezh
9 months, 1 week agoleoalvarezh
9 months, 1 week agokuracpalac
9 months, 2 weeks agobubidubi
9 months, 2 weeks agokelliot
12 months agonathanBK
1 year agoBAofBK
1 year agoVijKall
1 year agoekta25
1 year, 1 month ago