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

Gem Push Sigstore Bundles RFC #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

segiddins
Copy link
Member

Signed-off-by: Samuel Giddins [email protected]

Signed-off-by: Samuel Giddins <[email protected]>
@segiddins segiddins force-pushed the segiddins/gem-push-sigstore-bundles-rfc branch from e08e557 to 2c88bf8 Compare October 24, 2024 22:37
In that case:

The request MUST include a part with name `gem` that contains the gem file. The `gem` part SHOULD have a `Content-Type` header of `application/octet-stream`.
The request MAY include a part with name `attestations` that contains sigstore bundles. The `sigstore` part MUST have a `Content-Type` header of `application/json` and MUST be a valid JSON array of sigstore bundle object.

Choose a reason for hiding this comment

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

Will you be opinionated on the contents of the bundles? Namely, should the bundle only contain attestations, or will you accept raw signatures over artifacts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm. Right now I have it accepting what sigstore-ruby can verify against an artifact. That includes hashedrekord entries, if that's your question

Choose a reason for hiding this comment

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

The bundle can contain either a raw signature or a DSSE envelope. For Maven Central, they are using a signature. For npm, a DSSE envelope with a SLSA attestation. For PyPI, we defined an in-toto statement which we called an "trusted publishing attestation" which is roughly a subject and an empty predicate, and PyPI can support other in-toto statements in the future as well like SLSA attestations.

I was wondering if you wanted to define a specific format you'll accept. It'll make verification more straightforward if you accept one initial format, though I'd suggest setting it up so that you could accept other formats in the future as well, like what PyPI is doing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm this is a good question that actually dovetails with what clients should be doing when verifying...

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm going to leave things as-is for now, and we can always restrict what attestations we allow publishing with in the future.

As-is, both raw signatures and DSSE envelopes will verify, so long as the dsse envelope is an in-toto statement with a subject that matches the artifact

# Summary

RubyGems.org will add a new variant to the gem push endpoint that allows gems authors to include sigstore bundles with their gem pushes.
RubyGems.org will verify that the sigstore bundle is valid and signed by a trusted publisher configured for the gem.

Choose a reason for hiding this comment

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

To confirm, will trusted publishing be a requirement to accept Sigstore bundles, as in you won't accept signatures generated by a non-CI workflow identity?

Copy link
Member Author

Choose a reason for hiding this comment

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

To start, I plan on limiting to trusted publishing, since it gives us a solid basis for an identity to verify against. I believe this is the approach that pypi is taking. Going forward though, I see no reason why rubygems.org fundamentally needs to restrict what attestations we accept, given they are coming from an actor that has permissions to publish to the gem

Choose a reason for hiding this comment

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

One benefit for only accepting trusted publishing identities is if you want to provide a default verification policy, as you don't have to worry about exposing non-public maintainer details (except for dealing with private repos).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants