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 vulnerability scanning and compliance pipeline for containerized microservices stored in Artifact Registry. The solution must meet the following requirements:
Which combination of configuration steps and IAM permissions should you implement?
gcloud artifacts docker images scan in Cloud Build before pushing; enable the Container Scanning API (containerscanning.googleapis.com) for continuous OS and language package analysis; and grant the roles/containeranalysis.occurrences.viewer role to the auditing service account.This solution combines Google Cloud On-Demand Scanning, Artifact Analysis automatic continuous scanning, and Container Analysis IAM roles to secure the container delivery lifecycle end-to-end.
gcloud artifacts docker images scan (along with gcloud artifacts docker images list-vulnerabilities) allows Cloud Build to analyze locally built container images and enforce build-breaking policies prior to pushing to Artifact Registry.containerscanning.googleapis.com) activates automatic on-push scanning and continuous analysis in Artifact Registry. Artifact Analysis automatically scans both operating system packages and application language packages (such as Go, Java/Maven, Node.js, and Python), refreshing occurrence metadata daily against updated CVE databases for images active within 30 days.roles/containeranalysis.occurrences.viewer (Container Analysis Occurrences Viewer) provides read-only access to view vulnerability occurrences, package dependencies, and metadata notes without granting administrative privileges or unnecessary data access.This approach leverages native Google Cloud services following the principle of least privilege, eliminates custom scanning infrastructure, and achieves automated shift-left security coupled with continuous post-push vulnerability monitoring.
containerscanning.googleapis.com); execute gcloud container images describe --show-package-vulnerability during Cloud Build before pushing; and grant the roles/artifactregistry.reader role to the auditing service account.This configuration attempts to use legacy Container Registry CLI commands (gcloud container images describe) in the build pipeline and assigns the standard Artifact Registry read role for metadata querying.
gcloud container images describe is a legacy command designed to inspect metadata of images already stored in Container Registry/Artifact Registry; it cannot perform on-demand local image scanning inside Cloud Build prior to pushing.roles/artifactregistry.reader role grants permissions to read and pull container images from Artifact Registry, but it does not grant permissions on the containeranalysis.googleapis.com API to list or view vulnerability occurrences and metadata.gcloud container images commands do not support local image analysis prior to upload.You were auditing image pull permissions in Artifact Registry rather than querying vulnerability occurrences, and the image was already pushed to the registry.
roles/viewer basic role to the auditing service account.This option attempts to use runtime deploy-time policy enforcement (Binary Authorization) and cluster-level security posture scanning (GKE Advanced Vulnerability Insights) to handle build-time and registry scanning.
roles/viewer role grants broad read access to almost all Google Cloud resources across the project, violating least privilege principles.roles/viewer are anti-patterns in secure CI/CD pipelines.You needed to prevent non-compliant container images from being deployed to a GKE cluster in production.
gcloud artifacts docker images scan in Cloud Build; configure Cloud Scheduler to pull images daily to trigger OS-only automatic scans; and grant the roles/containeranalysis.occurrences.editor role to the auditing service account.This approach implements on-demand scanning in Cloud Build but introduces an unnecessary scheduled task to trigger scans and over-provisions IAM permissions.
roles/containeranalysis.occurrences.editor violates least privilege by allowing the auditing service account to create, modify, and delete vulnerability occurrences instead of providing read-only viewer access.The service account was an automated remediation agent required to mutate or annotate vulnerability occurrences with custom metadata.
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