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 team is establishing a "shift-left" security practice for containerized applications built with Cloud Build and stored in Artifact Registry. You need to implement an automated policy gate within the continuous integration (CI) pipeline that satisfies the following requirements:
CRITICAL or HIGH is detected.What should you do?
Artifact Analysis On-Demand Scanning is a feature that allows developers and CI/CD systems to initiate vulnerability scans on container images locally or during build time before pushing them to a central repository like Artifact Registry.
gcloud artifacts docker images scan analyzes the local container image built in the pipeline workspace prior to executing a docker push step.gcloud artifacts docker images list-vulnerabilities queries the scan ID and outputs metadata including the vulnerability.effectiveSeverity level.CRITICAL or HIGH. If found, it outputs a failure message and exits with a non-zero exit code (exit 1), halting the Cloud Build pipeline immediately and blocking subsequent steps (such as docker push).'CRITICAL|HIGH').On-Demand Scanning allows proactive evaluation of artifact compliance directly within the CI execution runner. Waiting until after the image is stored in the registry or deployed to a cluster increases the attack surface and requires reactive mitigation instead of preventative enforcement.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.