GCP Professional Cloud Security Engineer Practice Question
Your organization relies on Cloud Identity and enforces least-privilege access. Human Resources produces a daily list of employees whose status has changed to TERMINATED. You have been asked to deploy an automated Cloud Run service that reads this list, suspends the user accounts, and removes them from every Google Group. The job must run unattended, avoid long-lived credentials such as stored passwords or service-account keys, and ensure each change is attributable to an identifiable principal in Cloud Audit Logs. Which approach best satisfies the requirements?
Create a dedicated service account with domain-wide delegation and only user and group admin privileges. Grant the Cloud Run runtime service account the iam.serviceAccountTokenCreator role on it, then have the workload impersonate the delegated account and invoke the Admin SDK Directory API.
Develop the Cloud Run container to use a JSON key for a Super Admin user's service account stored in Secret Manager, then call the Admin SDK Directory API with that key.
Invoke the Cloud Identity API from Cloud Run using an API key generated in the Google Cloud console; pass the key in each request to disable users and update groups.
Assign the Super Admin role directly to the Cloud Run runtime service account and call the Directory API with its default access token obtained from the metadata server.
The Admin SDK Directory API is the correct interface for programmatically suspending users and managing their group memberships. To invoke it securely from Cloud Run you should:
Create a dedicated service account in Cloud Identity, enable domain-wide delegation on it, and authorize only the Directory API scopes needed for user and group administration.
Grant that service account the minimum delegated admin roles (for example User Management Admin and Groups Admin) so the actions it performs are scoped and auditable to that principal.
Configure the Cloud Run service to run under its own runtime service account and grant that account the iam.serviceAccountTokenCreator role on the delegated service account. At runtime the code uses Application Default Credentials to impersonate (via the IAM Credentials API) the delegated service account, obtaining short-lived access tokens to call the Directory API.
This design eliminates long-lived keys, keeps permissions narrowly scoped, and records every impersonated call in Cloud Audit Logs. The other options either rely on static keys, insecure API keys, or assign overly broad Super Admin privileges, all of which violate the stated constraints.
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.
Can you explain domain-wide delegation in more detail?
Open an interactive chat with Bash
What is the IAM Credentials API, and how does it help in this setup?
Open an interactive chat with Bash
Why is avoiding long-lived credentials, such as stored passwords or service-account keys, important?
Open an interactive chat with Bash
What is domain-wide delegation in Google Cloud?
Open an interactive chat with Bash
What is the role of the iam.serviceAccountTokenCreator in Google Cloud?
Open an interactive chat with Bash
How does Application Default Credentials (ADC) work 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 .