Skip to content

Commit d15c6bc

Browse files
chore: (optimization) add provenance file + register with release please (#190)
**Requirements** - [x] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [x] I have validated my changes against all supported platform versions **Describe the solution you've provided** This adds a PROVENANCE.md file and registers it with release-please. **Describe alternatives you've considered** No alternatives here; required for security <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: documentation-only addition plus a release configuration tweak to include `PROVENANCE.md` in version bumps; no runtime code changes. > > **Overview** > Adds a new `packages/optimization/PROVENANCE.md` documenting how to verify published wheel provenance using GitHub artifact attestations. > > Updates `release-please-config.json` so `packages/optimization` treats `PROVENANCE.md` as an `extra-file`, ensuring the doc’s embedded version snippet is kept in sync during releases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 32dc4d0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
2 parents 3b4baa3 + 32dc4d0 commit d15c6bc

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Verifying SDK build provenance with GitHub artifact attestations
2+
3+
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.
4+
5+
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/).
6+
7+
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:
8+
9+
<!-- x-release-please-start-version -->
10+
```
11+
# Set the version of the library to verify
12+
VERSION=0.1.0
13+
```
14+
<!-- x-release-please-end -->
15+
16+
```
17+
# Download package from PyPI
18+
$ pip download --only-binary=:all: launchdarkly-ai-optimizer==${VERSION}
19+
20+
# Verify provenance using the GitHub CLI
21+
$ gh attestation verify launchdarkly_ai_optimizer-${VERSION}-py3-none-any.whl --owner launchdarkly
22+
```
23+
24+
Below is a sample of expected output.
25+
26+
```
27+
Loaded digest sha256:... for file://launchdarkly_ai_optimizer-0.1.0-py3-none-any.whl
28+
Loaded 1 attestation from GitHub API
29+
30+
The following policy criteria will be enforced:
31+
- Predicate type must match:................ https://slsa.dev/provenance/v1
32+
- Source Repository Owner URI must match:... https://github.com/launchdarkly
33+
- Subject Alternative Name must match regex: (?i)^https://github.com/launchdarkly/
34+
- OIDC Issuer must match:................... https://token.actions.githubusercontent.com
35+
36+
✓ Verification succeeded!
37+
38+
The following 1 attestation matched the policy criteria
39+
40+
- Attestation #1
41+
- Build repo:..... launchdarkly/python-server-sdk-ai
42+
- Build workflow:. .github/workflows/release-please.yml
43+
- Signer repo:.... launchdarkly/python-server-sdk-ai
44+
- Signer workflow: .github/workflows/release-please.yml
45+
```
46+
47+
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).
48+
49+
**Note:** These instructions do not apply when building our libraries from source.

release-please-config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
"versioning": "default",
3939
"bump-minor-pre-major": true,
4040
"include-v-in-tag": false,
41-
"extra-files": ["src/ldai_optimizer/__init__.py"],
41+
"extra-files": [
42+
"src/ldai_optimizer/__init__.py",
43+
"PROVENANCE.md"
44+
],
4245
"component": "ldai_optimizer"
4346
}
4447
}

0 commit comments

Comments
 (0)