Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
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 relies on the default Cloud Build service account and grants it coarse-grained administrative privileges (roles/editor) at the project level, while assigning the Secret Manager Admin role (roles/secretmanager.admin) to the Secure Source Manager Service Agent.
roles/editor grants broad edit access across almost all Google Cloud resources in the project, exceeding what a CI pipeline requires.roles/secretmanager.secretAccessor), not full administrative authority to modify, create, or delete secret metadata (roles/secretmanager.admin).You were running an unconstrained sandbox prototype where rapid prototyping took complete priority over security controls, IAM governance, and least-privilege compliance.
This configuration assigns the roles/containeranalysis.notesEditor role to the execution service account within the application (customer) project and grants read-only access (roles/artifactregistry.reader) to the target Artifact Registry repository.
roles/artifactregistry.reader role only allows pulling images, which causes image push steps to fail.roles/containeranalysis.occurrences.editor and roles/containeranalysis.notes.attacher), rather than provider note editing.The service account was only intended to scan existing container images and generate new note schemas within a centralized security metadata provider project.
This pattern uses long-lived service account key credentials committed directly into version control, paired with full repository administrative privileges (roles/artifactregistry.admin).
roles/artifactregistry.writer, not full administrative capabilities over repository settings.iam.disableServiceAccountKeyCreation.There were no native Google Cloud IAM integration available between source control and build infrastructure, and an external system strictly required static key file authentication.
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.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated