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 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?
Binary Authorization is a deploy-time security control for platforms like Google Kubernetes Engine (GKE) and Cloud Run that enforces policies requiring images to be signed by trusted authorities (attestors) before deployment.
The objective was to ensure that GKE clusters or Cloud Run reject any container deployment that lacks a cryptographic attestation verifying it passed vulnerability criteria.
This configuration uses Artifact Analysis automatic scanning (on-push scanning) to scan images upon upload to Artifact Registry, with asynchronous event-driven remediation via Cloud Pub/Sub and Cloud Functions to remove vulnerable artifacts.
You needed a centralized, passive security auditing and cleanup mechanism across all projects that automatically purges non-compliant artifacts regardless of the CI tool used to push them.
gcloud artifacts docker images scan on the locally built image, then parse the results with gcloud artifacts docker images list-vulnerabilities and terminate the build step with an exit code of 1 if CRITICAL or HIGH severities are found before pushing.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.
gcloud artifacts docker images describe --show-package-vulnerability in a subsequent Cloud Build step to verify compliance before deploying.This approach pushes the image directly into Artifact Registry and then uses gcloud artifacts docker images describe --show-package-vulnerability to inspect the metadata generated by automatic scanning.
describe command in the next pipeline step often results in incomplete vulnerability data or empty results because the background scan may still be running.gcloud artifacts docker images describe --show-package-vulnerability reads already generated metadata from Artifact Registry.The image was already uploaded to Artifact Registry and you needed a command-line method to inspect existing vulnerability notes and package occurrences on a stored digest.
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