-
Notifications
You must be signed in to change notification settings - Fork 3
ci: switch from SLSA provenance to actions/attest with subject-path #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5f2a68d
ci: use draft releases to support immutable GitHub releases
keelerm84 49a59a4
ci: add force-tag-creation and publish_release option
keelerm84 7a40d96
ci: simplify for attestation-only releases (no draft needed)
keelerm84 1ffbad9
ci: remove force-tag-creation from attestation-only repo
keelerm84 59da396
ci: switch from subject-checksums to subject-path for attestation
keelerm84 e094cba
ci: remove unnecessary contents: write and fetch-depth: 0
keelerm84 d6c9cb3
ci: use format() for dry_run conditions to handle both string and boo…
keelerm84 2ee25cc
docs: update PROVENANCE.md and README.md for GitHub artifact attestat…
keelerm84 7e4d3c4
docs: use real gh attestation verify output template and --owner flag
keelerm84 8b882ca
docs: restore original SLSA framework text in README.md
keelerm84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,49 @@ | ||
| ## Verifying SDK build provenance with the SLSA framework | ||
| ## Verifying SDK build provenance with GitHub artifact attestations | ||
|
|
||
| LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. | ||
| LaunchDarkly uses [GitHub artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. | ||
|
|
||
| As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance about our SDK package builds using [GitHub's generic SLSA3 provenance generator](https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/generic/README.md#generation-of-slsa3-provenance-for-arbitrary-projects) for distribution alongside our packages. These attestations are available for download from the GitHub release page for the release version under Assets > `multiple.intoto.jsonl`. | ||
| LaunchDarkly publishes provenance about our SDK package builds using [GitHub's `actions/attest` action](https://github.com/actions/attest). These attestations are stored in GitHub's attestation API and can be verified using the [GitHub CLI](https://cli.github.com/). | ||
|
|
||
| To verify SLSA provenance attestations, we recommend using [slsa-verifier](https://github.com/slsa-framework/slsa-verifier). Example usage for verifying a package is included below: | ||
| To verify build provenance attestations, we recommend using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). Example usage for verifying SDK packages is included below: | ||
|
|
||
| <!-- x-release-please-start-version --> | ||
|
|
||
| ``` | ||
| # Set the version of the library to verify | ||
| VERSION=0.16.1 | ||
| ``` | ||
|
|
||
| <!-- x-release-please-end --> | ||
|
|
||
| ``` | ||
| # Download package from PyPi | ||
| # Download package from PyPI | ||
| $ pip download --only-binary=:all: launchdarkly-server-sdk-ai==${VERSION} | ||
|
|
||
| # Download provenance from Github release into same directory | ||
| $ curl --location -O \ | ||
| https://github.com/launchdarkly/python-server-sdk-ai/releases/download/${VERSION}/multiple.intoto.jsonl | ||
|
|
||
| # Run slsa-verifier to verify provenance against package artifacts | ||
| $ slsa-verifier verify-artifact \ | ||
| --provenance-path multiple.intoto.jsonl \ | ||
| --source-uri github.com/launchdarkly/python-server-sdk-ai \ | ||
| launchdarkly_server_sdk_ai-${VERSION}-py3-none-any.whl | ||
| # Verify provenance using the GitHub CLI | ||
| $ gh attestation verify launchdarkly_server_sdk_ai-${VERSION}-py3-none-any.whl --owner launchdarkly | ||
| ``` | ||
|
|
||
| Below is a sample of expected output. | ||
|
|
||
| ``` | ||
| Verified signature against tlog entry index 150910243 at URL: https://rekor.sigstore.dev/api/v1/log/entries/108e9186e8c5677ab3f14fc82cd3deb769e07ef812cadda623c08c77d4e51fc03124ee7542c470a1 | ||
| Verified build using builder "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v2.0.0" at commit 8e2d4094b4833d075e70dfce43bbc7176008c4a1 | ||
| Verifying artifact launchdarkly_server_sdk_ai-0.3.0-py3-none-any.whl: PASSED | ||
| Loaded digest sha256:... for file://launchdarkly_server_sdk_ai-0.16.1-py3-none-any.whl | ||
| Loaded 1 attestation from GitHub API | ||
|
|
||
| The following policy criteria will be enforced: | ||
| - Predicate type must match:................ https://slsa.dev/provenance/v1 | ||
| - Source Repository Owner URI must match:... https://github.com/launchdarkly | ||
| - Subject Alternative Name must match regex: (?i)^https://github.com/launchdarkly/ | ||
| - OIDC Issuer must match:................... https://token.actions.githubusercontent.com | ||
|
|
||
| ✓ Verification succeeded! | ||
|
|
||
| The following 1 attestation matched the policy criteria | ||
|
|
||
| PASSED: SLSA verification passed | ||
| - Attestation #1 | ||
| - Build repo:..... launchdarkly/python-server-sdk-ai | ||
| - Build workflow:. .github/workflows/release-please.yml | ||
| - Signer repo:.... launchdarkly/python-server-sdk-ai | ||
| - Signer workflow: .github/workflows/release-please.yml | ||
| ``` | ||
|
|
||
| Alternatively, to verify the provenance manually, the SLSA framework specifies [recommendations for verifying build artifacts](https://slsa.dev/spec/v1.0/verifying-artifacts) in their documentation. | ||
| For more information, see [GitHub's documentation on verifying artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#verifying-artifact-attestations-with-the-github-cli). | ||
|
|
||
| **Note:** These instructions do not apply when building our libraries from source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused tag-name outputs left after provenance job removal
Low Severity
The four
*-tag-nameoutputs in therelease-pleasejob (package-server-ai-tag-name,package-server-ai-langchain-tag-name,package-server-ai-openai-tag-name,package-server-ai-optimization-tag-name) are now dead code. Their only consumers were the*-provenancejobs (e.g.,release-server-ai-provenance) which used them forupload-tag-name, and those jobs were all removed in this PR. No other workflow or job references these outputs.