The role is 'roles/storage.objectViewer', which allows viewing objects only.
Step 2: Understand permissions of the role
This role grants read-only access to storage objects, no editing or deleting.
Final Answer:
Can view objects in storage buckets -> Option B
Quick Check:
objectViewer = read-only access [OK]
Hint: Viewer roles allow read-only access [OK]
Common Mistakes:
Confusing viewer with editor or owner roles
Assuming viewer can delete or edit
Ignoring the specific role name
4. You assigned the 'roles/editor' role to a service account, but it only needs to read data. What is the best fix to follow the least privilege principle?
medium
A. Keep the 'editor' role since it covers all needs
B. Remove the role and do not assign any role
C. Change the role to 'roles/viewer' or a more specific read-only role
D. Assign the 'owner' role for future flexibility
Solution
Step 1: Identify the problem with current role
'roles/editor' grants broad permissions beyond reading, violating least privilege.
Step 2: Choose a role with minimal needed permissions
Assigning 'roles/viewer' or a specific read-only role limits access appropriately.
Final Answer:
Change the role to 'roles/viewer' or a more specific read-only role -> Option C
Quick Check:
Least privilege = minimal needed permissions [OK]
Hint: Use read-only roles if only reading is needed [OK]
Common Mistakes:
Keeping overly broad roles
Removing roles entirely causing access failure
Assigning owner role unnecessarily
5. You manage a GCP project with multiple teams. One team needs to deploy apps but should not access billing info. How do you apply the least privilege principle?
hard
A. Assign a custom role with deployment permissions but no billing access
B. Assign 'Project Owner' role to the team for full control
C. Assign the 'Project Editor' role to the team and 'Billing Admin' to a few users
D. Give the team billing account access to avoid deployment delays
Solution
Step 1: Understand team needs and restrictions
The team needs deployment rights but must not access billing info.
Step 2: Choose role assignment following least privilege
A custom role with only deployment permissions and no billing access fits best.
Final Answer:
Assign a custom role with deployment permissions but no billing access -> Option A
Quick Check:
Least privilege = custom roles for precise access [OK]
Hint: Use custom roles to separate duties precisely [OK]