Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Your enterprise is designing a secure Continuous Integration (CI) pipeline using Cloud Build triggered from a Secure Source Manager repository. The pipeline must fetch application dependencies, retrieve sensitive API keys from Secret Manager, build container images, push them to Artifact Registry, and create attestations for Binary Authorization. To enforce security compliance, your team must adhere strictly to the principle of least privilege for all service identities involved in build invocation and execution.
Which IAM role and identity configuration should you implement?
This configuration establishes a secure, least-privilege CI pipeline by separating the identity that triggers the build from the custom identity that executes the build steps. A user-managed repository service account handles build triggering, while a dedicated, user-specified Cloud Build service account carries out the actual build operations.
roles/secretmanager.secretAccessor directly to the custom Cloud Build execution service account allows the build steps to securely access required sensitive API credentials from Secret Manager without embedding keys into source code or environment variables.roles/artifactregistry.writer allows the build runner to push generated container images, while the user-managed repository service account uses roles/iam.serviceAccountUser and roles/cloudbuild.builds.editor to invoke builds securely.This approach aligns with Google Cloud architecture best practices for securing CI/CD pipelines. It prevents privilege escalation by ensuring the repository service account only possesses rights to trigger builds and impersonate the designated execution account, while the execution account is constrained to access only the specific artifacts and secrets required for that application.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.