jodersky / sbt-gpg

Simple and secure artifact signing for sbt.
Other
50 stars 3 forks source link

Support for artifact signature verification #4

Open djspiewak opened 6 years ago

djspiewak commented 6 years ago

Almost no one uses this feature in sbt-pgp anyway, so I could be convinced that it's out of scope, but it would be nice to have. In a more pie-in-the-sky sense, it would be extremely nice if there were some way we could culturally encourage the Scala community (via this tooling) to verify signatures more frequently, since a large chunk of the software development trust model is dependent on this link in the chain that no one checks.

jodersky commented 6 years ago

I would love to see better security for the maven publishing model. IMO the gpg web-of-trust model just requires too much effort from too many participants for it to become a viable way to authenticate binaries. Do you know of keybase.io? Maybe we could somehow leverage that as part of the verification process?

In the longer term, I'd like to see better support from repositories too (check out this thread for some inspiration on Rust's Crates.io https://github.com/rust-lang/cargo/issues/1281) and most importantly, reproducible builds becoming mainstream in the JVM world!

In the short term, I think wrapping around gpg's verify command is the way to go.

djspiewak commented 6 years ago

I would love to see better security for the maven publishing model. IMO the gpg web-of-trust model just requires too much effort from too many participants for it to become a viable way to authenticate binaries. Do you know of keybase.io? Maybe we could somehow leverage that as part of the verification process?

I'm a huge keybase fan. Or at least a huge fan of their core database; I'm less keen on their Slack/Dropbox/whatever-killer product. Either way, I think that would be outstanding. The web-of-trust model doesn't work very well. Some authors do have their keys signed into the strong set, and it's certainly worth respecting that in the verification process, but rejecting a signature just because it fails GPG's user hostile trust model is not the right approach.

Fundamentally, the goal is to assert that the people we think published something, did in fact publish something. I can think of a couple things we can leverage for this…

Oh, and all of these ideas that involve "pulling the SCM information" run into the problem that we're getting that information… from the very POM that we're trying to verify for authenticity. So we're kind of stuck between a rock and a hard-place, here. I'm not sure it completely invalidates those ideas on all levels, but it does kick them out as means of verification without other changes.

Practically, our best bet is probably to start with gpg verify. If that accepts the signature, then leave it at that. If it doesn't, then check trustedKeys as described in the pinning section. Pre-populate the plugin with some reasonable trustedKeys. Off the top of my head:

This has the potential to create winners and losers though due to incumbancy, so I'm somewhat tempted to only pin Scala's key.

wiktor-k commented 5 years ago

I'll drop here some random notes that may be relevant, I hope you don't mind: