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.
A development team is configuring a Cloud Build pipeline to build container images and store them in Artifact Registry. Their compliance requirements state that the pipeline must:
Currently, their cloudbuild.yaml runs a docker build step followed by an explicit docker push step, does not define options or images, and is invoked manually with gcloud builds submit. After running builds, querying Artifact Analysis for BUILD occurrences returns no provenance records.
Which set of changes should the team make to meet the requirements?
docker push step alongside the images field, set logging: CLOUD_LOGGING_ONLY under options, and manually create a Grafeas ATTESTATION note in Artifact Analysis.In Cloud Build, logging: CLOUD_LOGGING_ONLY directs build execution logs exclusively to Cloud Logging rather than a default Cloud Storage bucket. In Artifact Analysis, Grafeas ATTESTATION notes and occurrences store cryptographic certifications—such as Binary Authorization attestations—confirming that an artifact passed a specific verification step.
docker push breaks provenance: Even if the images field is present, pushing via an explicit docker push step interferes with Cloud Build's native artifact upload lifecycle required for provenance generation.CLOUD_LOGGING_ONLY does not enable verification: Log routing settings have no effect on provenance generation; requestedVerifyOption: VERIFIED is required to enforce provenance creation.BUILD kind occurrence (inTotoSlsaProvenanceV1), not as a manually created ATTESTATION note.BUILD, VULNERABILITY, PACKAGE, ATTESTATION, and SBOM_REFERENCE), while occurrences bind those notes to specific image digests.ATTESTATION notes does not satisfy SLSA Level 3 requirements because SLSA provenance must be generated and signed directly by the trusted build platform.gcloud builds submit omits repository trigger metadata needed for verifiable SLSA provenance.The team needed to route build logs solely to Cloud Logging and implement a custom post-build quality gate that creates a Binary Authorization ATTESTATION occurrence after integration tests pass.
While Binary Authorization can read both ATTESTATION occurrences and Cloud Build BUILD provenance occurrences, the provenance records themselves are always generated automatically by Cloud Build rather than manually authored as ATTESTATION notes.
docker push step in cloudbuild.yaml, enable the Container Scanning API, and configure Cloud Build to upload the provenance JSON file to a Cloud Storage bucket.The Container Scanning API enables Artifact Analysis to automatically scan container images pushed to Artifact Registry for operating system and application package vulnerabilities, and to generate Software Bill of Materials (SBOM) inventories. Cloud Storage is used to store generated SBOM documents and third-party package metadata, rather than acting as the native metadata store for Cloud Build container provenance.
docker push build step.BUILD occurrences without requiring manual uploads to Cloud Storage.SBOM_REFERENCE occurrences, whereas container build provenance is stored directly as BUILD occurrences.requestedVerifyOption: VERIFIED and a build trigger, Cloud Build will not enforce or generate SLSA Level 3 provenance.The requirement were to automatically scan container images for known vulnerabilities and retain SPDX dependency inventories in Cloud Storage after images are pushed to Artifact Registry.
Students often confuse SBOM storage (which uses Cloud Storage buckets backed by reference occurrences) with build provenance storage, which Artifact Analysis handles natively as BUILD occurrences generated directly by Cloud Build.
slsa-verifier and cosign after the docker push step, and execute the builds in a Cloud Build private pool without modifying options.The slsa-verifier CLI is an open source tool from the SLSA framework used by consumers to validate existing SLSA provenance attestations against expected source URIs and builder IDs. cosign is a Sigstore utility used to sign container images or verify blob attestations, while Cloud Build private pools provide isolated, customizable worker environments with VPC peering and VPC Service Controls support.
slsa-verifier checks an already-generated provenance.json file; it cannot create SLSA Level 3 provenance from a build that lacks it.requestedVerifyOption: VERIFIED is explicitly set in options.docker push prevents generation: Pushing with docker push instead of using the images field prevents Cloud Build from recording the built digest and generating provenance.cosign can record metadata about the user or service account initiating a build, which complements—but does not replace—Cloud Build's native service-signed SLSA provenance.requestedVerifyOption: VERIFIED configuration in cloudbuild.yaml to emit provenance metadata.gcloud builds submit still lacks the repository trigger context required for provenance checks.The team already had verifiable provenance generated by Cloud Build and needed a downstream CI/CD validation step inside an isolated private pool to verify an image's SLSA provenance and cosign signature before deployment.
A common misconception is that running inside a more secure worker environment like a private pool automatically enables SLSA provenance, when in fact private pools disable attestation generation by default unless requestedVerifyOption: VERIFIED is configured.
docker push step, specify the target image in the images field, set requestedVerifyOption: VERIFIED under options, and invoke builds using a Cloud Build trigger with the Container Analysis API enabled.Build provenance is a collection of cryptographically signed, verifiable metadata describing how a software artifact was produced, including image digests, input source locations, the build toolchain, build arguments, and execution timestamps. Cloud Build generates SLSA Level 3 provenance (supporting in-toto statements wrapped in a DSSE envelope) and automatically stores those records in Artifact Analysis—Google Cloud's Grafeas-based metadata store—as BUILD kind occurrences.
docker push with images: Cloud Build only generates provenance when it manages the upload to Artifact Registry via the images field in cloudbuild.yaml; an explicit docker push step prevents provenance generation.requestedVerifyOption: VERIFIED: Setting this option instructs Cloud Build to generate provenance metadata and fail the build if verifiable provenance cannot be produced.buildConfigSource and resolvedDependencies) required for SLSA Level 3 compliance, whereas manual builds do not produce provenance.containeranalysis.googleapis.com) to automatically persist BUILD occurrences associated with the Artifact Registry image digest.provenanceSigner and builtByGCB) verifiable by Binary Authorization or slsa-verifier.buildType schema, including external and internal parameters.Unlike manual scripting, third-party signing steps, or logging flags, this native configuration satisfies every prerequisite for automated SLSA Level 3 provenance generation and Artifact Analysis persistence with zero custom infrastructure.
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