Add build provenance attestation#156
Add build provenance attestation#156kevinbackhouse wants to merge 1 commit intoGitHubSecurityLab:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds build provenance attestation to the PyPI and TestPyPI publishing workflows, aligning them with the security practices already established in the release.yml workflow. The changes add artifact attestation capabilities using GitHub's attest-build-provenance action, which complements the existing Sigstore signing and provides additional supply chain security for the published Python packages.
Changes:
- Added
attestations: writepermission to both PyPI publishing workflows - Added
Attest build provenancestep to generate attestations for wheel and tar.gz distribution files
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/publish-to-testpypi.yaml | Added attestations permission and build provenance attestation step for TestPyPI releases |
| .github/workflows/publish-to-pypi.yaml | Added attestations permission and build provenance attestation step for PyPI releases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fde3b3a to
6125d5f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6125d5f to
cdeb102
Compare
|
Okay, so there's 3 ways that attestations are being generated and "stored":
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks @steiza! One more question for you though: on a different PR where I'm making the same change, Copilot recommended doing the attestation step before the artifact-upload. Do you agree that it would be better to swap the order? |
🤷 The example Copilot gave is what should happen if the attestation step fails - do you still want it to have uploaded the artifact? I guess that depends on what you want! I think most people will be consuming this (and attestations) from PyPI instead of GitHub directly, but I don't have a strong opinion either way. |
9446238 to
20ae77b
Compare
|
I've moved the attestation before upload-artifact and squashed the commits. |
I noticed that we have this in the
release.ymlworkflow but not in these two workflows. I was a bit confused because we already have a "sign with sigstore" step in these workflows. As I understand it, "sign with sigstore" is the preferred way to sign the artifacts for PyPI and attest-build-provenance is the prefered way to do it for GitHub releases. And it doesn't hurt to do both.