Stay organized with collections Save and categorize content based on your preferences.
This page describes how to secure your software supply chain by configuring Binary Authorization to allow only container images built by Cloud Build to be deployed.
You configure this deployment control by requiring the built-by-cloud-build
attestor in your Binary Authorization policy. Cloud Build automatically creates the built-by-cloud-build
attestor in your project when you run a build that generates images. After images are successfully built, Cloud Build automatically signs and creates attestations for them. At deploy time, Binary Authorization verifies the attestations with the built-by-cloud-build
attestor. Verified images are allowed to be deployed. Images that fail verification are disallowed from being deployed, and the failure is logged to Cloud Audit Logs.
For end-to-end guide that describes how to use Cloud Build-recorded metadata and Binary Authorization, see Using signed provenance and Binary Authorization.
Before you beginTo use this feature you must first do the following:
Set up Cloud Build and build an image.
Note: If your build specifies a location, an attestation is created only if you explicitly setrequestedVerifyOption
to VERIFY_REQUESTED
.In this section you configure the Binary Authorization policy to require the built-by-cloud-build
attestor.
To allow only images built by Cloud Build to be deployed, perform the following steps:
ConsoleGo to the Binary Authorization page in the Google Cloud console:
In the Policy tab, click Edit Policy.
In the Edit Policy dialog, select Allow only images that have been approved by all of the following attestors.
Click Add Attestors.
In the Add attestors dialog box, do the following:
built-by-cloud-build
attestor is available.built-by-cloud-build
.Alternatively, select Add by attestor resource ID. In Attestor resource ID, enter
projects/PROJECT_ID/attestors/built-by-cloud-build
Replacing PROJECT_ID
with the project where you run Cloud Build.
Click Add 1 attestor.
Click Save Policy.
Export your existing policy to a file using the following command:
gcloud container binauthz policy export > /tmp/policy.yaml
Edit your policy file.
Edit one of the following rules:
defaultAdmissionRule
clusterAdmissionRules
istioServiceIdentityAdmissionRules
kubernetesServiceAccountAdmissionRules
Add a requireAttestationsBy
block to the rule if there isn't one there already.
In the requireAttestationsBy
block, add
projects/PROJECT_ID/attestors/built-by-cloud-build
Replacing PROJECT_ID
with the project where you run Cloud Build.
Save the policy file.
Import the policy file.
gcloud container binauthz policy import /tmp/policy.yaml
The following is an example policy file that contains the reference to the built-by-cloud-build-attestor
:
defaultAdmissionRule:
evaluationMode: REQUIRE_ATTESTATION
enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG
requireAttestationsBy:
- projects/PROJECT_ID/attestors/built-by-cloud-build
name: projects/PROJECT_ID/policy
Replace PROJECT_ID
with the project ID where you run Cloud Build.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This guide outlines how to secure your software supply chain using Binary Authorization to ensure only container images built by Cloud Build are deployable."],["Cloud Build automatically creates a `built-by-cloud-build` attestor and signs images, generating attestations upon successful builds."],["The Binary Authorization policy can be configured via the Google Cloud console or gcloud to require the `built-by-cloud-build` attestor, allowing only verified images to be deployed."],["Deployments of images that fail Binary Authorization verification are blocked, with the failure logged to Cloud Audit Logs for tracking and troubleshooting."],["To use this feature, you must set up Binary Authorization and Cloud Build before configuring the policy and running builds."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4