GCP Professional Cloud Architect Practice Question
Your organization hosts its source code in GitHub and triggers a GitHub Actions workflow on every commit. The workflow must execute gcloud and gsutil commands that create and configure Cloud Storage buckets in both dev and prod Google Cloud projects. The security team forbids storing any long-lived credentials, including service account key files or user OAuth tokens, in the repository or runner. As the cloud architect, which authentication approach best aligns with Google Cloud security best practices?
Store a base64-encoded service account JSON key in GitHub encrypted secrets and activate it with gcloud auth activate-service-account during the workflow.
Use gcloud auth login --no-launch-browser beforehand, save the resulting OAuth refresh token in a GitHub secret, and reuse it for future workflow runs.
Create a project-wide unrestricted API key and set it as an environment variable in the GitHub Actions runner for all gcloud and gsutil calls.
Configure Workload Identity Federation with an external identity pool and OIDC provider for GitHub, allowing the workflow to exchange its GitHub-issued identity token for a short-lived access token on a dedicated Google Cloud service account at runtime.
Workload Identity Federation lets external workloads such as GitHub Actions exchange their short-lived OIDC token for a Google Cloud access token bound to a specific IAM service account. Because no service-account key file is ever created or stored, there is no long-lived secret to manage or rotate, satisfying the security team's requirements. Storing a JSON key as an encrypted secret, embedding a user OAuth refresh token, or using an unrestricted API key all rely on long-lived credentials that can be exfiltrated or misused and are therefore discouraged by Google Cloud's identity best practices.
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 OIDC work in authentication for workflows like GitHub Actions?
Open an interactive chat with Bash
Why are long-lived credentials considered insecure for cloud workflows?
Open an interactive chat with Bash
What is Workload Identity Federation?
Open an interactive chat with Bash
How does OIDC work in the context of Workload Identity Federation?
Open an interactive chat with Bash
Why are service account keys considered a security risk?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Managing implementation
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 .