GCP Professional Cloud Security Engineer Practice Question
A global fintech company runs its CI/CD pipelines on self-hosted GitLab runners in an on-premises data center. The pipelines must build container images and deploy them to Cloud Run services in several Google Cloud projects. Corporate policy forbids keeping any long-lived Google Cloud credentials on-prem, and every pipeline execution must obtain fresh, short-lived credentials automatically without human interaction. Which authentication approach best meets these requirements while aligning with Google-recommended security practices?
Re-enable the Compute Engine default service account in one project, export its private key, and reuse that key across all runners and deployments.
Create a dedicated Cloud Identity user for each runner, enforce two-factor authentication, and have the pipeline authenticate via the OAuth installed-app flow.
Generate a single service account with the Editor role, download its JSON key, store it in GitLab's secret store, and use Application Default Credentials during the pipeline.
Configure Workload Identity Federation so each GitLab runner exchanges its OIDC token for a short-lived access token that impersonates a per-project service account.
Using Workload Identity Federation lets an external workload (such as an on-prem GitLab runner) exchange a short-lived identity token issued by its local identity provider (for example, an OIDC token) for a Google-issued access token that impersonates a dedicated service account in the target project. No long-lived JSON key files are created or stored, and each build receives a unique, time-bound credential that automatically expires, satisfying the organization's key-management and automation requirements.
The alternatives all rely on either storing persistent service-account keys or using human user credentials, which violate the mandate to avoid long-lived secrets and to use non-human identities for automated workloads.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Workload Identity Federation?
Open an interactive chat with Bash
How does an OIDC token work in this authentication method?
Open an interactive chat with Bash
Why is using a service account key file considered a security risk?
Open an interactive chat with Bash
What is Workload Identity Federation in Google Cloud?
Open an interactive chat with Bash
How does OIDC (OpenID Connect) work for authentication in workload identity federation?
Open an interactive chat with Bash
Why is using long-lived service account keys discouraged in Google Cloud?
Open an interactive chat with Bash
GCP Professional Cloud Security Engineer
Configuring Access
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .