PCSE Practice Question: Configuring Access Within a Cloud Solution Environment
A company has multiple projects under an organization node. A security engineer needs to deny all principals in the organization from creating service account keys, except for a specific project where it must be allowed. Which approach should be used?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create an IAM deny policy at the organization level denying the permission, and create another IAM deny policy at the project level that allows the permission by omitting the deny rule for that project's service accounts.
The correct approach is to use IAM deny policies (v2). Create an organization-level deny policy that denies iam.serviceAccountKeys.create to all principals. Then, create a project-level deny policy that denies the same permission but includes an exception (via exceptionPrincipals) for the project's service accounts. Because deny policies are evaluated hierarchically, the project-level policy with exceptions allows the permission for those specific principals while the organization-level policy denies it for everyone else. This is necessary because the boolean organization policy constraint constraints/iam.disableServiceAccountKeyCreation cannot be overridden or have exceptions. Option C is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a custom organization policy constraint to allow key creation only in the specific project, and deny in all others.
Why it's wrong here
Custom constraints are evaluated similar to boolean constraints; they cannot be selectively applied based on project in a single constraint.
- ✗
Create an IAM deny policy at the organization level denying iam.serviceAccountKeys.create, and then create an IAM allow policy at the project level granting the same permission.
Why it's wrong here
Allow policies cannot override deny policies; deny policies take precedence.
- ✓
Create an IAM deny policy at the organization level denying the permission, and create another IAM deny policy at the project level that allows the permission by omitting the deny rule for that project's service accounts.
Why this is correct
Deny policies at a lower level can effectively allow by not including the deny rule for specific principals. This is the correct way to create an exception.
- ✗
Apply the constraint constraints/iam.disableServiceAccountKeyCreation at the organization level with value True, and then set it to False at the project level.
Why it's wrong here
Boolean constraints cannot be overridden at a lower level; the organization policy is enforced across all projects.
Go deeper
Related to this question
About these practice questions
One of 960 original PCSE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCSE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCSE exam.