Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team is configuring a Cloud Build pipeline in project ci-build-prod that runs under a user-specified service account. The pipeline builds Docker images from source code and stores them in an Artifact Registry repository located in a separate project (shared-registry). Builds are currently slow because external base images are repeatedly downloaded from Docker Hub, sometimes hitting rate limits.
You need to configure the pipeline to meet the following requirements:
shared-registry.CRITICAL or HIGH vulnerabilities are found.Which pipeline configuration should you implement?
shared-registry. Configure an Artifact Registry connector repository for Docker Hub and rely on Cloud Build's persistent local Docker cache between builds. Enable automatic vulnerability scanning on shared-registry so Artifact Registry rejects docker push operations for images containing CRITICAL or HIGH vulnerabilities.This approach assigns the correct cross-project IAM role (roles/artifactregistry.writer) and pairs it with Artifact Registry connector repositories, automatic vulnerability scanning, and default Cloud Build worker storage.
docker push operation when CRITICAL or HIGH vulnerabilities are present.--cache-from or remote caching mechanisms to reuse Docker layers.images field is omitted from cloudbuild.yaml.The organization had a compliance policy that explicitly prohibited caching third-party artifacts in Google Cloud, and the security team only needed passive post-push vulnerability alerts rather than blocking non-compliant builds in the pipeline.
Many engineers confuse remote repositories (which cache upstream packages and container images) with connector repositories (which proxy without caching), and similarly assume automatic registry scanning acts as an admission gate like On-Demand Scanning in a build pipeline.
ci-build-prod the Artifact Registry Administrator role on shared-registry. Copy external base images once using gcrane into a standard repository so Artifact Registry keeps them synchronized with Docker Hub. In cloudbuild.yaml, scan the image with On-Demand Scanning checking for HIGH severity, and specify only the images field without a docker push step.This configuration attempts to manage cross-project permissions via the default Cloud Build service account, migrate external images using gcrane, run On-Demand Scanning filtered for HIGH severity, and rely solely on the images field for image delivery.
HIGH severity fails to catch CRITICAL vulnerabilities. Severity filters match only the exact levels specified; omitting CRITICAL allows the most severe vulnerabilities to pass the check.gcrane performs a one-time copy of container images into a standard repository. Artifact Registry does not monitor upstream registries for updates to manually copied images, nor does this setup provide Docker layer caching across ephemeral builds.list-vulnerabilities requires specifying all severities to block (such as CRITICAL|HIGH).gcrane become stale unless updated manually or via scheduled automation.docker push when using the images field still uploads the image at the end of a successful build and records it in build results, making it the only partially viable piece of this option.It used a remote repository instead of one-time gcrane copies, granted Artifact Registry Writer to the user-specified service account, and checked CRITICAL|HIGH severities.
A frequent pitfall in Cloud Build security pipelines is assuming that checking for HIGH severity automatically includes CRITICAL findings, which leaves pipelines exposed to critical CVEs.
shared-registry and configure Binary Authorization to block pushes of images with CRITICAL or HIGH vulnerabilities. Create an Artifact Registry virtual repository pointing directly to Docker Hub to cache base images. In cloudbuild.yaml, run docker push without the images field so Cloud Build automatically registers the image in build results.This option assigns the Artifact Registry Reader role, relies on Binary Authorization for push-time enforcement, attempts to use a virtual repository as a direct cache for Docker Hub, and pushes images solely via a docker push step.
roles/artifactregistry.reader) role only permits reading and downloading artifacts; it does not allow Cloud Build to upload images, causing docker push to fail with a permission denied error.docker push requests to Artifact Registry.docker push in cloudbuild.yaml without specifying the images field uploads the image to Artifact Registry, but the image will not appear in Cloud Build results, the Build description page, or gcloud builds list.docker push.images field is populated.None of the constraints required blocking uploads before storage, and the goal was simply to enforce runtime deployment policies in GKE while reading from an existing remote repository behind a virtual endpoint.
Understanding the distinction between Artifact Registry build-time controls (On-Demand Scanning + IAM Writer) and Binary Authorization runtime controls is essential for designing end-to-end Google Cloud supply chain security.
shared-registry. Configure an Artifact Registry remote repository to cache Docker Hub base images and pass --cache-from to docker build using a previously pushed image. In cloudbuild.yaml, run On-Demand Scanning and fail the build on CRITICAL|HIGH severities before running docker push, and include the image in the images field.This solution combines least-privilege Identity and Access Management (IAM), Artifact Registry remote repositories, Docker layer caching, On-Demand Scanning, and Cloud Build metadata tracking into a cohesive CI/CD workflow. It ensures that images are built quickly in ephemeral Cloud Build workers, verified for security before storage, and tracked accurately across projects.
roles/artifactregistry.writer) role on the target repository provides the exact permissions needed to upload and download artifacts without over-provisioning administrative privileges.gcloud artifacts docker images scan and gcloud artifacts docker images list-vulnerabilities) directly into cloudbuild.yaml evaluates the locally built container image before docker push executes. Checking for the CRITICAL|HIGH regular expression ensures that matching severe vulnerabilities cause the build step to exit with a non-zero status and abort the upload.--cache-from to docker build allows Docker to reuse unchanged layers across separate builds.images field alongside docker push ensures that the stored image is surfaced in the Build description page, gcloud builds list, and the Cloud Build API.Unlike automatic registry scanning—which only evaluates images after upload—or connector repositories—which do not cache artifacts—this configuration actively prevents non-compliant artifacts from reaching the registry while maximizing build performance and adhering to least-privilege access control.
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