hardMultiple ChoiceObjective-mapped
Google ACE Practice Question: Designing an environment where a CI/CD pipeline…
You are designing an environment where a CI/CD pipeline running in GitHub Actions needs to deploy Cloud Run services without storing any long-lived service account keys. Your organization's security policy prohibits downloading SA keys. Which approach meets these requirements?
⚠ Common exam trap
Google Cloud often tests the misconception that you can rely on the runner VM's default service account in GitHub Actions, but GitHub-hosted runners are not GCP VMs, so that service account is irrelevant and the runner has no inherent GCP identity.
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
✓
Use Workload Identity Federation to allow GitHub Actions to impersonate a service account using OIDC tokens.
Workload Identity Federation allows GitHub Actions to exchange OIDC tokens from GitHub's identity provider for Google Cloud service account impersonation, eliminating the need to download and store long-lived service account keys. This approach satisfies the security policy by using short-lived, automatically rotated tokens that are valid for only one hour, and it integrates directly with GitHub's OIDC provider without requiring any secret key material.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a service account key, base64-encode it, and store it as a GitHub Actions secret.
Why it's wrong here
Creating a service account key, base64-encoding it, and storing it as a GitHub Actions secret violates the organization's policy because it introduces a long-lived, static credential that never rotates. Anyone with access to the secret can impersonate the service account indefinitely until the key is manually revoked, and the key is effectively a standing backdoor. Workload Identity Federation avoids this by using short-lived, never-stored credentials, so this option both fails the policy and is architecturally insecure.
- ✓
Use Workload Identity Federation to allow GitHub Actions to impersonate a service account using OIDC tokens.
Why this is correct
Workload Identity Federation is the correct approach because it lets GitHub Actions present an OIDC token minted for the GitHub workflow run, which Google Cloud then exchanges for a short-lived STS security token. This token is scoped to a service account via an IAM binding and optional attribute conditions, and it expires after a configurable duration (typically under 1 hour). No service account key is ever created or stored, satisfying the security policy while still granting the pipeline the exact permissions it needs via impersonation.
- ✗
Grant the GitHub Actions runner VM's default service account the necessary roles.
Why it's wrong here
Granting the GitHub Actions runner VM's default service account is invalid because GitHub Actions runners are ephemeral VMs managed by GitHub, not by your GCP project. They have no access to the GCE metadata server and therefore cannot obtain a default service account token from the environment. Even if the runner ran on a GCE VM you controlled, the default service account would be a fixed machine identity, not a per-workflow identity, and it would not satisfy the least-privilege, zero-standing-credential policy.
- ✗
Use Cloud Build triggers instead of GitHub Actions to avoid key management.
Why it's wrong here
Using Cloud Build triggers instead of GitHub Actions sidesteps the problem rather than solving it because Cloud Build is a different CI/CD service with its own authentication model. If the team must continue using GitHub Actions for orchestration, Cloud Build does not eliminate the need for a secure way to authenticate GitHub Actions calls to GCP; it would just move the integration point. Moreover, if GitHub Actions triggers Cloud Build, the GitHub side would still need credentials, so this approach fails to address the original requirement.
Go deeper
Related to this question
Learn chapter
Google Cloud Platform Overview
Key term
Service account
A service account is a special type of account used by an application or a virtual machine, rather than a human user, to authenticate and interact with cloud services and APIs securely.
Key term
Workload Identity Federation
Workload Identity Federation lets a non-human software workload (like an app or server) securely prove its identity to a cloud provider using a token from an external identity provider, without needing long-term secrets.
About these practice questions
One of 769 original ACE 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 ACE 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 ACE exam.