|
| 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. |
0 commit comments