Professional Cloud Security 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.
A security engineer is designing an automated CI/CD pipeline in Google Cloud to build and publish hardened base container images. The pipeline must enforce security guardrails by shifting vulnerability detection left.
The pipeline must fulfill the following requirements:
CRITICAL or HIGH severity vulnerabilities are detected.Which pipeline workflow should the security engineer implement in Cloud Build?
Artifact Analysis On-Demand Scanning is a Google Cloud capability that allows developers and security pipelines to perform vulnerability assessments on container images locally or in a build workspace before pushing them to an artifact repository. By combining the gcloud artifacts docker images scan and gcloud artifacts docker images list-vulnerabilities commands within a Cloud Build configuration (cloudbuild.yaml), organizations can automate vulnerability gatekeeping in CI/CD pipelines.
docker build) to assemble the hardened container layers inside the Cloud Build workspace.gcloud artifacts docker images scan submits the locally tagged image to the On-Demand Scanning API, returning a unique scan ID without requiring the image to exist in a public or production registry.gcloud artifacts docker images list-vulnerabilities retrieves the scan occurrences. A conditional shell filter inspects vulnerability.effectiveSeverity against the configured regular expression (CRITICAL|HIGH). If any match occurs, the script executes exit 1, immediately failing the Cloud Build job.docker push is placed as a downstream step in cloudbuild.yaml, the push step will never execute if the severity check step fails, preventing vulnerable images from ever entering the Artifact Registry repository.gcr.io/google.com/cloudsdktool/cloud-sdk builder images without requiring external third-party vulnerability scanners.This approach stops vulnerable artifacts at the pipeline gate before they enter the repository, avoiding complex post-push quarantine workflows or accidental consumption by deployment pipelines.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.