Skip to content

Commit 196b84e

Browse files
joshjohanningsabrowning1jc-clark
authoredMar 20, 2025
docs: add content on validating sbom attestations (#54918)
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
1 parent a897b75 commit 196b84e

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed
 

‎content/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,20 @@ When you run your updated workflows, they will build your artifacts and generate
177177

178178
## Verifying artifact attestations with the {% data variables.product.prodname_cli %}
179179

180+
You can validate artifact attestations for binaries and container images and validate SBOM attestations using the {% data variables.product.prodname_cli %}. For more information, see the [`attestation`](https://cli.github.com/manual/gh_attestation) section of the {% data variables.product.prodname_cli %} manual.
181+
182+
>[!NOTE]These commands assume you are in an online environment. If you are in an offline or air-gapped environment, see [AUTOTITLE](/actions/security-guides/verifying-attestations-offline).
183+
184+
### Verifying an artifact attestation for binaries
185+
180186
To verify artifact attestations for **binaries**, use the following {% data variables.product.prodname_cli %} command.
181187

182188
```bash copy
183189
gh attestation verify PATH/TO/YOUR/BUILD/ARTIFACT-BINARY -R ORGANIZATION_NAME/REPOSITORY_NAME
184190
```
185191

192+
### Verifying an artifact attestation for container images
193+
186194
To verify artifact attestations for **container images**, you must provide the image's FQDN prefixed with `oci://` instead of the path to a binary. You can use the following {% data variables.product.prodname_cli %} command.
187195

188196
```bash copy
@@ -191,6 +199,24 @@ docker login ghcr.io
191199
gh attestation verify oci://ghcr.io/ORGANIZATION_NAME/IMAGE_NAME:test -R ORGANIZATION_NAME/REPOSITORY_NAME
192200
```
193201

194-
>[!NOTE]These commands assume you are in an online environment. If you are in an offline or air-gapped environment, see [AUTOTITLE](/actions/security-guides/verifying-attestations-offline).
202+
### Verifying an attestation for SBOMs
203+
204+
To verify SBOM attestations, you have to provide the `--predicate-type` flag to reference a non-default predicate. For more information, see [Vetted predicates](https://github.com/in-toto/attestation/tree/main/spec/predicates#vetted-predicates) in the `in-toto/attestation` repository.
195205

196-
For more information, see the [`attestation`](https://cli.github.com/manual/gh_attestation) section of the {% data variables.product.prodname_cli %} manual.
206+
For example, the [`attest-sbom` action](https://github.com/actions/attest-sbom) currently supports either SPDX or CycloneDX SBOM predicates. To verify an SBOM attestation in the SPDX format, you can use the following {% data variables.product.prodname_cli %} command.
207+
208+
```bash copy
209+
gh attestation verify PATH/TO/YOUR/BUILD/ARTIFACT-BINARY \
210+
-R ORGANIZATION_NAME/REPOSITORY_NAME \
211+
--predicate-type https://spdx.dev/Document/v2.3
212+
```
213+
214+
To view more information on the attestation, reference the `--format json` flag. This can be especially helpful when reviewing SBOM attestations.
215+
216+
```bash copy
217+
gh attestation verify PATH/TO/YOUR/BUILD/ARTIFACT-BINARY \
218+
-R ORGANIZATION_NAME/REPOSITORY_NAME \
219+
--predicate-type https://spdx.dev/Document/v2.3 \
220+
--format json \
221+
--jq '.[].verificationResult.statement.predicate'
222+
```

0 commit comments

Comments
 (0)
Failed to load comments.