|
| 1 | +## Verifying SDK build provenance with the SLSA framework |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +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-provenance.intoto.jsonl`. |
| 6 | + |
| 7 | +To verify SLSA provenance attestations, we recommend using [slsa-verifier](https://github.com/slsa-framework/slsa-verifier). Example usage for verifying SDK packages is included below: |
| 8 | + |
| 9 | +<!-- x-release-please-start-version --> |
| 10 | +``` |
| 11 | +# Set the version of the SDK to verify |
| 12 | +VERSION=0.0.0 |
| 13 | +``` |
| 14 | +<!-- x-release-please-end --> |
| 15 | + |
| 16 | +``` |
| 17 | +# Download gem |
| 18 | +$ gem fetch launchdarkly-server-sdk-ai -v $VERSION |
| 19 | +
|
| 20 | +# Download provenance from Github release |
| 21 | +$ curl --location -O \ |
| 22 | + https://github.com/launchdarkly/ruby-server-sdk-ai/releases/download/${VERSION}/launchdarkly-server-sdk-ai-${VERSION}.gem.intoto.jsonl |
| 23 | +
|
| 24 | +# Run slsa-verifier to verify provenance against package artifacts |
| 25 | +$ slsa-verifier verify-artifact \ |
| 26 | +--provenance-path launchdarkly-server-sdk-ai-${VERSION}.gem.intoto.jsonl \ |
| 27 | +--source-uri github.com/launchdarkly/ruby-server-sdk-ai \ |
| 28 | +launchdarkly-server-sdk-ai-${VERSION}.gem |
| 29 | +``` |
| 30 | + |
| 31 | +Below is a sample of expected output. |
| 32 | +TODO: Verify these are accurate |
| 33 | +``` |
| 34 | +Verified signature against tlog entry index 83653185 at URL: https://rekor.sigstore.dev/api/v1/log/entries/24296fb24b8ad77a7df0bbf87a7d5fcaafa551a2101d9f993d251a56a918bb113e81d2c575dc7e25 |
| 35 | +Verified build using builder "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v1.10.0" at commit 14c48a68c45871c27409591969e7f4c0ebdcdf62 |
| 36 | +Verifying artifact launchdarkly-server-sdk-ai-1.0.0.gem: PASSED |
| 37 | +
|
| 38 | +PASSED: Verified SLSA provenance |
| 39 | +``` |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | +**Note:** These instructions do not apply when building our libraries from source. |
0 commit comments