Skip to content

Commit ea584f4

Browse files
authored
docs: add section for verify-github-attestation (#858)
Readme update for #850 Signed-off-by: Appu Goundan <[email protected]>
1 parent 2950204 commit ea584f4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- [npm packages built using the SLSA3 Node.js builder](#npm-packages-built-using-the-slsa3-nodejs-builder)
3636
- [npm packages built using the npm CLI](#npm-packages-built-using-the-npm-cli)
3737
- [Container-based builds](#container-based-builds)
38+
- [Verification for GitHub `attest-build-provenance` Attestations](#verification-for-github-attest-build-provenance-attestations)
3839
- [Verification for Google Cloud Build](#verification-for-google-cloud-build)
3940
- [Artifacts](#artifacts-1)
4041
- [Containers](#containers-1)
@@ -440,6 +441,50 @@ The builder image is described using an [in-toto Resource Descriptor](https://gi
440441

441442
In case the builds are reproducible, you may also use the internal [docker CLI tool](https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/docker#the-verify-command) to verify the artifact by rebuilding the artifact with the provided provenance.
442443

444+
## Verification for GitHub `attest-build-provenance` Attestations
445+
446+
Attestations produced by builders that leverage the [attest-build-provenance](https://github.com/actions/attest-build-provenance) action.
447+
448+
Currently limited to artifacts built with the following builder-ids:
449+
- `github.com/bazel-contrib/.github/blob/master/.github/workflows/release_ruleset.yaml`
450+
- `github.com/bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml`
451+
452+
### the `verify-github-attestation` command
453+
454+
```bash
455+
$ slsa-verifier verify-github-attestation --help
456+
Verifies SLSA provenance for a GitHub attestation
457+
458+
Usage:
459+
slsa-verifier verify-github-attestation [flags] module-file
460+
461+
Flags:
462+
--attestation-path string path to an attestation file
463+
--builder-id string the unique builder ID who created the provenance
464+
-h, --help help for verify-github-attestation
465+
--print-attestation [optional] print the verified attestation to stdout
466+
--source-uri string expected source repository that should have produced the binary, e.g. github.com/some/repo
467+
```
468+
469+
First download the artifact and attestation (from bazel central registry in this example)
470+
471+
```shell
472+
$ curl -sSO https://bcr.bazel.build/modules/aspect_rules_lint/1.3.4/MODULE.bazel
473+
$ curl -sSO https://bcr.bazel.build/modules/aspect_rules_lint/1.3.4/MODULE.bazel.intoto.jsonl
474+
```
475+
476+
Verify the attestation
477+
478+
```shell
479+
$ slsa-verifier verify-github-attestation --source-uri github.com/aspect-build/rules_lint --builder-id https://github.com/bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml --attestation-path MODULE.bazel.intoto.jsonl MODULE.bazel
480+
481+
482+
Verified build using builder "https://github.com/bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@refs/tags/v0.0.1" at commit 1e1a949147d641428dac19e77f044b782f5941fd
483+
Verifying artifact MODULE.bazel: PASSED
484+
485+
PASSED: SLSA verification passed
486+
```
487+
443488
## Verification for Google Cloud Build
444489

445490
### Artifacts

0 commit comments

Comments
 (0)