PCSE Practice Question: Configuring Access Within a Cloud Solution Environment
A company runs a batch job on Compute Engine that processes sensitive data. The job uses a service account with a JSON key file stored on the VM. A security audit recommends removing long-lived keys. The job must run unattended. What is the best alternative?
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 a new service account and attach it to the VM instance; remove the old key.
Using a service account attached to the VM instance is the best practice. Compute Engine automatically obtains short-lived tokens from the metadata server, eliminating the need for keys. Workload Identity Federation is for external workloads. Secret Manager still requires a key to access. Default compute service account is less secure than a custom one.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Store the service account key in Secret Manager and retrieve it at runtime.
Why it's wrong here
This still requires a long-lived key to access Secret Manager or the key itself.
- ✓
Create a new service account and attach it to the VM instance; remove the old key.
Why this is correct
Attached service accounts use short-lived tokens from the metadata server, no keys needed.
- ✗
Use the default compute engine service account instead.
Why it's wrong here
Default service accounts often have broad permissions and less control.
- ✗
Use Workload Identity Federation to authenticate the batch job.
Why it's wrong here
Workload Identity Federation is for external identities (e.g., AWS), not for Compute Engine VMs.
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.