gcloud alpha container binauthz Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha container binauthz - manage attestations for Binary Authorization on Google Cloud Platform
- SYNOPSIS
gcloud alpha container binauthzGROUP|COMMAND[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Binary Authorization is a feature which allows binaries torun on Google Cloud Platform only if they are appropriately attested. BinaryAuthorization is configured by creating a policy.- EXAMPLES
- This example assumes that you have created a keypair using gpg, usually byrunning
gpg --gen-key …, withName-Emailset toattesting_user@example.comfor your attestor.First, some convenience variables for brevity:
ATTESTING_USER="attesting_user@example.com"DIGEST="000000000000000000000000000000000000000000000000000000000000abcd"ARTIFACT_URL="gcr.io/example-project/example-image@sha256:${DIGEST}"ATTESTOR_NAME="projects/example-project/attestors/canary"
Export your key's fingerprint (note this may differ based on version andimplementations of gpg):
gpg\--with-colons\--with-fingerprint\--force-v4-certs\--list-keys\"${ATTESTING_USER}"|grepfpr|cut--delimiter=':'--fields10
This should produce a 40 character, hexidecimal encoded string. Seehttps://tools.ietf.org/html/rfc4880#section-12.2for more information on key fingerprints.
Create your attestation payload:
gcloudalphacontainerbinauthzcreate-signature-payload\--artifact-url="${ARTIFACT_URL}"\ >example_payload.txt
Create a signature from your attestation payload:
gpg\--local-user"${ATTESTING_USER}"\--armor\--clearsign\--outputexample_signature.pgp\example_payload.txt
Upload the attestation:
gcloudalphacontainerbinauthzattestationscreate\--public-key-id=${KEY_FINGERPRINT}\--signature-file=example_signature.pgp\--artifact-url="${ARTIFACT_URL}"\--attestor=${ATTESTOR_NAME}
List the attestation by artifact URL.
--formatcan be passed tooutput the attestations as json or another supported format:gcloudalphacontainerbinauthzattestationslist\--artifact-url="${ARTIFACT_URL}"\--format=yaml----|-----BEGINPGPPUBLICKEYBLOCK-----Version:GnuPGv1 …SNIP…-----ENDPGPPUBLICKEYBLOCK------|-----BEGINPGPSIGNEDMESSAGE-----Hash:SHA1 …SNIP…-----BEGINPGPSIGNATURE-----Version:GnuPGv1 …SNIP…-----ENDPGPSIGNATURE-----
List all artifact URLs on the project for which Container Analysis Occurrencesexist. This list includes the list of all URLs with BinAuthz attestations:
gcloudalphacontainerbinauthzattestationslist---https://gcr.io/example-project/example-image@sha256:000000000000000000000000000000000000000000000000000000000000abcd…
Listing also works for kind=ATTESTATION_AUTHORITY attestations, just pass theattestor:
gcloudalphacontainerbinauthzattestationslist\--artifact-url="${ARTIFACT_URL}"\--attestor=${ATTESTOR_NAME}\--format=yaml…
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--help.Run
$gcloud helpfor details. - GROUPS
is one of the following:GROUPattestations(ALPHA)Create and manage Google Binary Authorization attestations.attestors(ALPHA)Create and manage Google Binary Authorization Attestors.continuous-validation(ALPHA)Manage Binary Authorization Continuous Validation.policy(ALPHA)Create and manage Google Binary Authorization policies.
- COMMANDS
is one of the following:COMMANDcreate-signature-payload(ALPHA)Create a JSON container image signature object.
- NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudcontainerbinauthzgcloudbetacontainerbinauthz
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.