Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: add artefact attestation (using GitHub / SigStore) #1267

Merged

Conversation

tonyandrewmeyer
Copy link
Contributor

This PR adds artefact attestation to the ops builds. Essentially: users are able to verify that the wheel and source dist tarball produced by the build script were actually generated by the workflow in this repo (and not, for example, uploaded by someone else that got access to the PyPI account).

The test-publish workflow is also updated to use the build backend, which was missed when the main script was migrated. Annoyingly, we are still waiting for access to the operator package on test.pypi.org.

@tonyandrewmeyer
Copy link
Contributor Author

I'm not sure how to e2e test this prior to a release (and particularly pre-merge) 😞. I've verified that it properly generates the attestations, but the actual uploading with the test publish script doesn't work since we don't have access to that account. It works with totally different packages, but that's not really testing this specific PR, just the action.

Maybe we could publish a 2.15.0.dev0 to verify and then yank that? Not ideal, but this is the purpose of test.pypi.org...

@tonyandrewmeyer
Copy link
Contributor Author

Note: an alternative here would be to go for higher level SLSA, probably with slsa-github-generator. It's better but more complex. My feeling is that we're better off starting with the simpler GitHub-native attestation and potentially improving that later (maybe based on what the Canonical security team prefers).

The PR doesn't add SBOM generation as part of the workflow (you can get one from the dependencies page, of course). I'm not sure whether an SBOM would really add anything to the source tarball, and I'm not sure whether it's worth adding just for the wheel. My feeling is to wait to see whether there ends up being a Canonical policy on this. If we do generate an SBOM then we'd want to attest that as well, of course.

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me, thanks. I'm not too worried about testing it before a release. If we run into issues during the next release (this Thu I guess), we can just tweak it at that time.

@tonyandrewmeyer tonyandrewmeyer marked this pull request as ready for review June 24, 2024 03:35
@tonyandrewmeyer tonyandrewmeyer requested a review from dimaqq June 24, 2024 03:36
@tonyandrewmeyer tonyandrewmeyer merged commit bed3d44 into canonical:main Jun 26, 2024
27 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the artefact-attestation branch June 26, 2024 10:24
amandahla pushed a commit to amandahla/operator that referenced this pull request Jun 26, 2024
This PR adds [artefact
attestation](https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/)
to the ops builds. Essentially: users are able to verify that the wheel
and source dist tarball produced by the build script were actually
generated by the workflow in this repo (and not, for example, uploaded
by someone else that got access to the PyPI account).

The `test-publish` workflow is also updated to use the `build` backend,
which was missed when the main script was migrated. Annoyingly, [we are
still waiting for access to the operator package on
test.pypi.org](pypi/support#3349).
tonyandrewmeyer added a commit to tonyandrewmeyer/operator that referenced this pull request Jun 26, 2024
This PR adds [artefact
attestation](https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/)
to the ops builds. Essentially: users are able to verify that the wheel
and source dist tarball produced by the build script were actually
generated by the workflow in this repo (and not, for example, uploaded
by someone else that got access to the PyPI account).

The `test-publish` workflow is also updated to use the `build` backend,
which was missed when the main script was migrated. Annoyingly, [we are
still waiting for access to the operator package on
test.pypi.org](pypi/support#3349).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants