GCP Professional Cloud Architect Practice Question
Your security team wants to grant an external automation system running in GitHub Actions the ability to deploy container images to a production Cloud Run service that resides in project "prod-app," but nothing else in the project. The automation already authenticates with GitHub's OIDC token. You create a workload identity pool and provider in the prod-app project. Which approach best satisfies least privilege while eliminating long-lived service account keys?
Bind the Cloud Run Admin predefined role to the GitHub workload identity principal at the project level.
Export a JSON key for a dedicated service account with the Cloud Run Admin role and store it as a GitHub Actions secret.
Allow the GitHub workload identity principal to impersonate a dedicated service account that has the Cloud Run Developer role on the specific Cloud Run service.
Create a custom role containing only run.services.invoke and bind it to the GitHub principal at the organization level.
Granting the GitHub principal permission to impersonate (generate short-lived tokens for) a dedicated service account avoids persistent keys and allows fine-grained scoping. By assigning the Cloud Run Developer predefined role only on the target service, the principal can deploy revisions but cannot change IAM policies or access other resources. Binding the role directly at the project level (Cloud Run Admin or Developer) would provide broader access than necessary. Storing a JSON key contradicts the requirement to avoid long-lived credentials. Granting only run.services.invoke at the organization level would not allow deployments, and assigning it at the top of the hierarchy violates least-privilege design.
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 a workload identity pool and how does it help in avoiding long-lived service account keys?
Open an interactive chat with Bash
How does impersonating a service account work in Google Cloud for workload identities?
Open an interactive chat with Bash
What is the Cloud Run Developer role and why is it used in this case?
Open an interactive chat with Bash
What is a workload identity pool in GCP?
Open an interactive chat with Bash
What is the Cloud Run Developer role, and how is it different from Cloud Run Admin?
Open an interactive chat with Bash
What is the significance of least-privilege access in cloud security?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Designing for security and compliance
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .