-
Notifications
You must be signed in to change notification settings - Fork 2
ci: migrate from SLSA provenance to actions/attest with subject-path #16
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
11 commits
Select commit
Hold shift + click to select a range
c2c6b0e
ci: use draft releases to support immutable GitHub releases
keelerm84 15c6de3
ci: add force-tag-creation and publish_release option
keelerm84 a873dcc
ci: simplify for attestation-only releases (no draft needed)
keelerm84 0701773
ci: remove force-tag-creation from attestation-only repo
keelerm84 0df2aa2
ci: switch from subject-checksums to subject-path for attestation
keelerm84 b22672b
ci: remove unused tag input
keelerm84 133baa7
ci: use format() for dry_run conditions to handle both string and boo…
keelerm84 64fb498
ci: remove dead tag_name outputs and inputs
keelerm84 b41e479
docs: add PROVENANCE.md for GitHub artifact attestations
keelerm84 a4d8235
docs: add SLSA provenance section to README.md
keelerm84 604be69
ci: register PROVENANCE.md in release-please extra-files
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
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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| ## Verifying SDK build provenance with GitHub artifact attestations | ||
|
|
||
| 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. | ||
|
|
||
| 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 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 SDK to verify | ||
| SDK_VERSION=2.0.0 | ||
| ``` | ||
| <!-- x-release-please-end --> | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| ``` | ||
| # Download the nupkg from NuGet | ||
| $ nuget install LaunchDarkly.Logging -Version $SDK_VERSION -OutputDirectory ./packages | ||
|
|
||
| # Verify provenance using the GitHub CLI | ||
| $ gh attestation verify ./packages/LaunchDarkly.Logging.${SDK_VERSION}/LaunchDarkly.Logging.${SDK_VERSION}.nupkg --owner launchdarkly | ||
| ``` | ||
|
|
||
| Below is a sample of expected output. | ||
|
|
||
| ``` | ||
| Loaded digest sha256:... for file://LaunchDarkly.Logging.2.0.0.nupkg | ||
| 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 | ||
|
|
||
| - Attestation #1 | ||
| - Build repo:..... launchdarkly/dotnet-logging | ||
| - Build workflow:. .github/workflows/release-please.yml | ||
| - Signer repo:.... launchdarkly/dotnet-logging | ||
| - Signer workflow: .github/workflows/release-please.yml | ||
| ``` | ||
|
|
||
| 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 SDKs 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
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.
Missing
artifact-metadata: writepermission foractions/attest@v4High Severity
actions/attest@v4requires three permissions:id-token: write,attestations: write, andartifact-metadata: write. The workflow addsattestations: writebut omitsartifact-metadata: write, which is a new requirement introduced in v4 and is needed to create the artifact storage record. Without it, theAttest build provenancestep will fail at runtime.