|
35 | 35 | - [npm packages built using the SLSA3 Node.js builder](#npm-packages-built-using-the-slsa3-nodejs-builder) |
36 | 36 | - [npm packages built using the npm CLI](#npm-packages-built-using-the-npm-cli) |
37 | 37 | - [Container-based builds](#container-based-builds) |
| 38 | +- [Verification for GitHub `attest-build-provenance` Attestations](#verification-for-github-attest-build-provenance-attestations) |
38 | 39 | - [Verification for Google Cloud Build](#verification-for-google-cloud-build) |
39 | 40 | - [Artifacts](#artifacts-1) |
40 | 41 | - [Containers](#containers-1) |
@@ -440,6 +441,50 @@ The builder image is described using an [in-toto Resource Descriptor](https://gi |
440 | 441 |
|
441 | 442 | 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. |
442 | 443 |
|
| 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 | + |
443 | 488 | ## Verification for Google Cloud Build |
444 | 489 |
|
445 | 490 | ### Artifacts |
|
0 commit comments