-
Notifications
You must be signed in to change notification settings - Fork 45
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
Investigate simplifying SPEC 8 through use of pypa/gh-action-pypi-publish v1.11.0+ #359
Comments
@matthewfeickert so looking into SPEC 8, I noticed what I think is a misconception — the suggested GitHub Environment name uses a verb. This name correspond to the deployment target, a platform where dists end up, which would be PyPI, TestPyPI or some devpi etc. It's not a process but a place, which is why it's odd to see it starting with a verb.. So I recommend changing Another thing is that the example there shows signing before the release happened. I think I saw it in some of @woodruffw's repos that this premature step might be problematic if publishing to PyPI fails and you may end up with published signatures for dists that would never appear in the official published lists. Imagine you have to trigger the release pipeline again keeping the version the same and end of with two sets of signatures for the same dist names. I would suspect the nonpublished ones could be used for something like dependency confusing attacks. For that reason, I treat the event of successful publishing to PyPI the point of no return and do any signing after the fact, in separate jobs even. One of the tools, SLSA, even provides a reusable workflow that can't be embedded into an existing job as it's a bundle of jobs itself: https://github.com/ansible/awx-plugins/blob/c7fc0a1/.github/workflows/ci-cd.yml#L828-L1115 (demo workflow run graph: https://github.com/ansible/awx-plugins/actions/runs/10793404435). |
Feel free to make PRs to suggest some edits 😃 |
Thanks as always for the rapid and detailed feedback, @webknjaz!
Correct me if I'm wrong (though for my projects this works, so if I'm wrong then there's something rather unclear), but the name field is the name of the corresponding GitHub Actions deployment environment that has been created for the trusted publisher process. It can be arbitrary, and I'm fine with changing it, but I feel that this (that the
Wow that's really nice! Also thanks for teaching me that the
Yes, this issue of having multiple attestations exist with the same human readable tags has come up in practice before given reruns. Also AFAIK the attestations are immutable as
so I think they're up there forever. The motivation here for generating the attestation as close to the build as possible was to try to ensure that any subsequent steps between building and publishing (e.g. |
That's right, this is exposed as a field in GHA workflow jobs. And when you configure trust on the PyPI side, it should be the same. If it's set, PyPI will additionally verify that it matches. So technically it's arbitrary and works for as long as it matches. I'm talking about the underlying concept it corresponds to. It's something that I believe GitHub itself did a poor job explaining and naming. When using GitHub Actions, though, you don't have to resort to making API calls. Instead, you specify that
You're welcome ;)
Yeah, there's also currently no association between the attestations and indexes they're intended for. So people are concerned about things like publishing a thing to TestPyPI and having it signed. And then, tricking the users into using those dists would be a possibility as they are trusted. The same goes for cancelled uploads. I think, there's a potential for rollback attacks here. As for having the steps close to each other, it's probably not that big of a concern. This is happening within a pipeline that you control. If that pipeline is compromised, the timing wouldn't really matter, and this would mean more serious impersonation problems anyway. Besides, with |
As noted in pypa/gh-action-pypi-publish#281, in https://github.com/pypa/gh-action-pypi-publish/
v1.11.0
This is great news, so a big thanks to @webknjaz and @woodruffw for this!
For some of our packages that have upcoming releases we should investigate how the attestations differ from the
actions/attest-build-provenance
ones and what the verification workflow is like. If we like them, then we should revise SPEC 8 to just use these automatically generated attestations, simplifying the process.The text was updated successfully, but these errors were encountered: