Skip to content
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

Add release atteststions #343

Open
orf opened this issue Oct 8, 2024 · 10 comments · Fixed by #481 · May be fixed by #371
Open

Add release atteststions #343

orf opened this issue Oct 8, 2024 · 10 comments · Fixed by #481 · May be fixed by #371
Labels
enhancement New feature or request

Comments

@orf
Copy link
Contributor

orf commented Oct 8, 2024

Hello!

First, thanks for this fantastic project - it’s a great help to the community and ecosystem at large.

I would like to suggest adding artifact attestations to the releases.

This would enable supply chain verification for these builds, and provide a layer of validation above just verifying the signature.

it’s pretty simple to add: just a single step, with no configuration or changes required in the binary itself.

what do you think?

@zanieb
Copy link
Member

zanieb commented Oct 8, 2024

Yeah these seem reasonable, were you interested in contributing this?

@orf
Copy link
Contributor Author

orf commented Oct 8, 2024 via email

orf added a commit to orf/python-build-standalone that referenced this issue Oct 16, 2024
@orf orf linked a pull request Oct 16, 2024 that will close this issue
@chludwig-haufe
Copy link

I see there is an open PR #371, but no further activity. Is there anything blocking the creation of the attestations?

Since I didn't see this mentioned in the documentation: How is the integrity of the Python sources and dependencies used in the build verified?

@indygreg
Copy link
Collaborator

We pin and verify the sha256 and file size of all downloaded assets. See downloads.py.

@zanieb
Copy link
Member

zanieb commented Dec 16, 2024

@chludwig-haufe there's a blocking comment at #371 (comment)

@orf
Copy link
Contributor Author

orf commented Dec 16, 2024

@chludwig-haufe there's a blocking comment at #371 (comment)

Yep! I have this PR in my backlog, but some personal stuff has come up.

We should indeed only attest on main (or anything that actually publishes), adding the relevant if: blocks should be all that is needed.

@charliermarsh charliermarsh added the enhancement New feature or request label Dec 18, 2024
zanieb added a commit that referenced this issue Jan 10, 2025
Follow up on feedback from #371 and the previous work from @orf which I
cherry-picked.

This adds build attestations for the builds using
[actions/attest-build-provenance](https://github.com/actions/attest-build-provenance).

Closes #343

### Test Plan

Did a trial CI run which results in attestations like below for
`cpython-3.10-aarch64-unknown-linux-gnu-lto`

*
https://github.com/samypr100/python-build-standalone/attestations/4246020
* https://search.sigstore.dev/?logIndex=160192732

Co-authored-by: Thomas Forbes <[email protected]>
Co-authored-by: Zanie Blue <[email protected]>
@zanieb
Copy link
Member

zanieb commented Jan 15, 2025

I presume we need to attest the artifacts in .github/workflows/release.yml too? We create several derived artifacts.

@chludwig-haufe
Copy link

Please pardon my ignorance (I am not an active user of GitHub actions) – but Verifying artifact attestations with the GitHub CLI made me assume I could verify the integrity of a downloaded package as follows:

$ curl -LO https://github.com/astral-sh/python-build-standalone/releases/download/20250115/cpython-3.10.16+20250115-aarch64-apple-darwin-install_only.tar.gz
$ export GH_TOKEN="GitHub personal access token w/ read privileges"
$ gh attestation verify cpython-3.10.16+20250115-aarch64-apple-darwin-install_only.tar.gz -R astral-sh/python-build-standalone
Loaded digest sha256:21dba90e7a0b879fdc475411fc8c39e0567c6f5c92112956b63de7f83ee433ad for file://cpython-3.10.16+20250115-aarch64-apple-darwin-install_only.tar.gz
✗ Loading attestations from GitHub API failed

Error: failed to fetch attestations from astral-sh/python-build-standalone: HTTP 404: Not Found (https://api.github.com/repos/astral-sh/python-build-standalone/attestations/sha256:21dba90e7a0b879fdc475411fc8c39e0567c6f5c92112956b63de7f83ee433ad?per_page=30)

What am I missing?

@zanieb
Copy link
Member

zanieb commented Jan 17, 2025

The -install_only archives are derived, as I mentioned in #343 (comment)

@zanieb zanieb reopened this Jan 17, 2025
@zanieb
Copy link
Member

zanieb commented Jan 17, 2025

Let's just re-open this until we reach a point where these are validated as functional. cc @samypr100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants