- A
Use Cloud Audit Logs to monitor and alert on non-compliant instances.
Why wrong: Monitoring does not prevent creation.
- B
VPC Service Controls to restrict the service account usage.
Why wrong: VPC Service Controls control data exfiltration, not service account enforcement.
- C
An Organization Policy with constraint constraints/compute.setServiceAccount and an IAM deny policy to deny the iam.serviceAccounts.actAs permission on other service accounts.
This combination enforces the service account and prevents override.
- D
Grant users only the Compute Instance Admin v1 role and remove the actAs permission.
Why wrong: Users could still create instances with default service account.
Quick Answer
The correct answer is to combine an Organization Policy with the constraint `constraints/compute.setServiceAccount` and an IAM deny policy that blocks the `iam.serviceAccounts.actAs` permission on all other service accounts. This works because the Organization Policy prevents users from specifying a different service account when creating Compute Engine instances, while the IAM deny policy ensures that even if a user attempts to act as another service account, the permission is explicitly blocked. Together, these mechanisms enforce that only the designated service account can be used and that users cannot override it. On the Google Professional Cloud Security Engineer exam, this scenario tests your understanding of defense-in-depth for service account enforcement—a common trap is relying solely on an Organization Policy without also denying the `actAs` permission, which leaves a bypass open. Remember the memory tip: “Constrain the choice, then deny the act” to recall that the Organization Policy restricts the option, and the IAM deny policy blocks the permission to use any other account.
PCSE Practice Question: Configuring access within a cloud solution environment
This PCSE practice question tests your understanding of configuring access within a cloud solution environment. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
An organization wants to enforce that all Compute Engine instances are created with a specific service account that has only the permissions defined by a custom role. Additionally, users must not be able to override this service account. Which two mechanisms should be combined?
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
An Organization Policy with constraint constraints/compute.setServiceAccount and an IAM deny policy to deny the iam.serviceAccounts.actAs permission on other service accounts.
Option C is correct because it combines an Organization Policy constraint (`constraints/compute.setServiceAccount`) that prevents users from specifying a different service account when creating Compute Engine instances, with an IAM deny policy that blocks the `iam.serviceAccounts.actAs` permission on all other service accounts. Together, these enforce that only the designated service account can be used, and users cannot override it.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
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 Cloud Audit Logs to monitor and alert on non-compliant instances.
Why it's wrong here
Monitoring does not prevent creation.
- ✗
VPC Service Controls to restrict the service account usage.
Why it's wrong here
VPC Service Controls control data exfiltration, not service account enforcement.
- ✓
An Organization Policy with constraint constraints/compute.setServiceAccount and an IAM deny policy to deny the iam.serviceAccounts.actAs permission on other service accounts.
Why this is correct
This combination enforces the service account and prevents override.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Grant users only the Compute Instance Admin v1 role and remove the actAs permission.
Why it's wrong here
Users could still create instances with default service account.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Google Cloud often tests the misconception that a single mechanism (like an organization policy or IAM role restriction) is sufficient, when in reality two complementary controls are needed to both restrict the service account selection and block the actAs permission on unauthorized accounts.
Detailed technical explanation
How to think about this question
The `constraints/compute.setServiceAccount` organization policy constraint, when set to a deny-all or specific list, blocks the `instances.setServiceAccount` permission at the API level, preventing any override of the service account during instance creation or modification. The IAM deny policy for `iam.serviceAccounts.actAs` ensures that even if a user tries to use a different service account (e.g., by attaching it via a script or console), the permission check fails because the user lacks the `actAs` permission on that account. This dual-layer approach is necessary because the organization policy alone does not block the use of service accounts that the user already has `actAs` permission on, and the IAM deny policy alone does not prevent the user from specifying a different service account in the request.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Configuring access within a cloud solution environment — study guide chapter
Learn the concepts, then practise the questions
- →
Configuring access within a cloud solution environment practice questions
Targeted practice on this topic area only
- →
All PCSE questions
500 questions across all exam domains
- →
Google Professional Cloud Security Engineer study guide
Full concept coverage aligned to exam objectives
- →
PCSE practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PCSE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Configuring network security practice questions
Practise PCSE questions linked to Configuring network security.
Configuring access within a cloud solution environment practice questions
Practise PCSE questions linked to Configuring access within a cloud solution environment.
Ensuring data protection practice questions
Practise PCSE questions linked to Ensuring data protection.
Managing operations in a cloud solution environment practice questions
Practise PCSE questions linked to Managing operations in a cloud solution environment.
Supporting compliance requirements practice questions
Practise PCSE questions linked to Supporting compliance requirements.
PCSE fundamentals practice questions
Practise PCSE questions linked to PCSE fundamentals.
PCSE scenario practice questions
Practise PCSE questions linked to PCSE scenario.
PCSE troubleshooting practice questions
Practise PCSE questions linked to PCSE troubleshooting.
Practice this exam
Start a free PCSE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PCSE question test?
Configuring access within a cloud solution environment — This question tests Configuring access within a cloud solution environment — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: An Organization Policy with constraint constraints/compute.setServiceAccount and an IAM deny policy to deny the iam.serviceAccounts.actAs permission on other service accounts. — Option C is correct because it combines an Organization Policy constraint (`constraints/compute.setServiceAccount`) that prevents users from specifying a different service account when creating Compute Engine instances, with an IAM deny policy that blocks the `iam.serviceAccounts.actAs` permission on all other service accounts. Together, these enforce that only the designated service account can be used, and users cannot override it.
What should I do if I get this PCSE question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more ways this is tested on PCSE
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An organization wants to enforce that all Compute Engine instances must use a specific service account. Which three steps are necessary? (Choose three.)
hard- A.Create a custom role with compute.instances.create permission.
- ✓ B.Grant the service account the needed roles on the project.
- ✓ C.Create the service account in the project.
- ✓ D.Set an organization policy constraint compute.restrictServiceAccountUsage to allow only that service account.
- E.Grant the compute.instanceAdmin role to the service account.
Why B: Option B is correct because the service account must be granted the necessary IAM roles on the project (or specific resources) to perform its intended actions. Without these grants, even if the service account is enforced, it will lack permissions to interact with Compute Engine resources. This step ensures the service account has the required access, such as compute.instanceAdmin or custom roles, to manage instances.
Last reviewed: Jun 30, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.