-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Attest package provenance #12333
Attest package provenance #12333
Conversation
This uses the new build provenance support added in [build-and-inspect-python-package 2.5.0](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md#250---2024-05-13). More information: https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/ Tested also in pytest-dev/pytest-mock#431. Note: even though it is technically necessary only for the `deploy` workflow, as the `test` workflow does not publish its packages, decided to always attest the provenance in both cases to avoid any surprises related to this (say a misconfiguration) when deploying.
for more information, see https://pre-commit.ci
Provenance information created: https://github.com/pytest-dev/pytest/actions/runs/9111218324/attempts/1#summary-25047879854 |
LGTM. I tested that I can verify the files, and also that if I corrupt one of the files it doesn't verify. Maybe add a release note telling people that we're now doing that? (Perhaps call it "experimental")
I think maybe we shouldn't create "useless" attestations like these:
|
Hmm that's strange, perhaps that's the merge commit? 🤔 EDIT: Yep, that's 3fd5b86 from this branch merged with fdf3aa3 (main when that executed). For our actual releases this should not be a problem, as they are triggered directly from the branch, not from a PR. |
Done, wording suggestions are welcome.
Good points, undid it for |
Co-authored-by: Ran Benita <[email protected]>
@nicoddemus @bluetech @RonnyPfannschmidt FYI I consider this kind of privilege management dangerous as it silently creates opportunities for vulnerabilities in places you wouldn't think of (the attack surface would be other OIDC-connected services). |
@webknjaz thanks for raising this. I read the comment and I think I kind understand the issue, but what would be the fix moving forward exactly? IIUC we build the package using the action, to fix this we would need to build the package directly without using the action at all? |
@nicoddemus attestation should happen in the upload job thats not touching external deps |
Ahh of course, it does not affect the packages themselves, the provenance attestation is done externally. 👍 |
@nicoddemus you could build the package but not use attestation. Then, you could attest in a separate, isolated job. In my guide @ https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#signing-the-distribution-packages, there's an example of putting signatures into GH Releases like that — it was written before GH attestations were a thing so using their action instead would work. There's also work happening over in my The umbrella issue for that effort is pypi/warehouse#15871, by the way. |
Cool, thanks for the detailed explanation! |
I'm OK with us disabling provenance for now and wait for the |
This uses the new build provenance support added in build-and-inspect-python-package 2.5.0.
More information: https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/
Tested also in pytest-dev/pytest-mock#431.
Note: even though it is technically necessary only for the
deploy
workflow, as thetest
workflow does not publish its packages, decided to always attest the provenance in both cases to avoid any surprises related to this (say a misconfiguration) when deploying.