GCP Professional Cloud Security Engineer Practice Question
A security engineering team needs to build an automated tool that runs in Cloud Run and synchronizes a nightly CSV stored in Cloud Storage with Cloud Identity. The container must add any new contractor accounts, suspend accounts that were removed from the file, and ensure every active contractor is a member of the Google Group [email protected]. The solution must avoid storing long-lived human credentials inside the image or environment and must follow the principle of least privilege by granting only the permissions required for user and group administration. Which design meets these requirements?
Generate an OAuth 2.0 client ID for the Cloud Run service, bake a long-lived refresh token into the container image, and call the Cloud Identity API directly to create and suspend users and modify group membership.
Give the Cloud Run service account the roles/iam.serviceAccountAdmin role on the organization and have the container run gcloud iam service-accounts commands to create and delete Cloud Identity users and groups.
Create a dedicated service account, enable domain-wide delegation for it, grant it the Cloud Identity User Management Admin and Groups Admin roles in the Admin console, deploy the Cloud Run service to run as this account, and invoke the Admin SDK Directory API via Application Default Credentials to manage users and groups.
Store a super administrator's username and password in Secret Manager; have the Cloud Run service fetch them at runtime and use headless browser automation to update users and groups through the Google Admin UI.
The Admin SDK Directory API is the programmatic interface for creating, updating, and suspending Cloud Identity or Google Workspace users, as well as managing Google Groups and their memberships. A Cloud Run service can authenticate to Google APIs with the short-lived OAuth 2.0 access tokens that Application Default Credentials (ADC) obtains automatically for its attached service account, so no static secrets are embedded in code or configuration. Because the Directory API acts on behalf of a domain administrator, the service account must be granted domain-wide delegation and receive only the specific administrator roles needed-in this case Cloud Identity User Management Admin (to create and suspend users) and Groups Admin (to modify group membership). The other options either rely on long-lived human credentials, misuse IAM roles that do not control Cloud Identity users and groups, or embed static OAuth refresh tokens in the container, all of which violate the security requirements.
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 Domain-wide Delegation 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
What is the Admin SDK Directory API?
Open an interactive chat with Bash
What is domain-wide delegation, and why is it required for this solution?
Open an interactive chat with Bash
Why does the solution emphasize avoiding long-lived human credentials or static tokens?
Open an interactive chat with Bash
What is the principle of least privilege, and how does this solution follow it?
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 .