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

assemble-maven-repository should include PGP signatures in the P2 site #203

Closed
laeubi opened this issue Jul 28, 2021 · 9 comments
Closed
Milestone

Comments

@laeubi
Copy link
Member

laeubi commented Jul 28, 2021

As P2 support PGP signatures as an alternative to code signed artifacts, and maven artifacts that are deployed to maven central are PGP signed already we should add this information to prevent any "resign" requirements later on.

@laeubi
Copy link
Member Author

laeubi commented Jul 28, 2021

Currently there is some code that downloads the PGP signature via maven (but not included yet). Before we enable this for reactor projects we might need to find a different solution.

@mickaelistria as your are familiar with the p2 PGP stuff, can you give a hint how to include a signature? Is there a special 'PGPAdvice' that could be used?

I also wonder if the PGP signature is something that is generated and then simply deployed as a regular artifact or if this is generated in the process while actually uploading the artifact to the maven-repository?

@mickaelistria
Copy link
Contributor

This is not only for assemble-maven-repository; but for everything that fertches remote Maven artifacts (eg bundles cominf from pomDependencies=consider ot from fhe Maven locations in .target).
See https://www.eclipse.org/eclipse/news/4.20/platform_isv.php#pgp-signature-verification . PGP signatures are properties to be added to the artifact entry of artifacts metadata. I imagine there is a possibility to use some PropertyAdvice; not sure about those can be used for artifact metadata.
One thing to consider with PGP is trust: imagine Platform ships an Apache artifact, it would atill be worth having Platform pgp-sign it so it could be trusted by default inthe Eclipse context. So re-signing is not necessarily a bad thing and can even be desirable.

@laeubi
Copy link
Member Author

laeubi commented Aug 1, 2021

PGP signatures are properties to be added to the artifact entry of artifacts metadata. I imagine there is a possibility to use some PropertyAdvice; not sure about those can be used for artifact metadata.

So what is the usual way to add such signatures? Editing the file directly?

One thing to consider with PGP is trust: imagine Platform ships an Apache artifact, it would atill be worth having Platform pgp-sign it so it could be trusted by default inthe Eclipse context. So re-signing is not necessarily a bad thing and can even be desirable.

Shouldn't it work in a way that Platform trusts Apache and thus an Apache artifact would be trusted trough web of trust? Beside that 're-signing' was more referred here as the process of taking an artifact from an arbitrary source and code-sign it with the Eclipse codesigning certificate, one thing that could be avoided when using the PGP trust if I have understand that correctly...

@mickaelistria
Copy link
Contributor

So what is the usual way to add such signatures? Editing the file directly?

All that PGP story is still too young and immature to pretend any workfow is "usual".
But indeed, at the moment, editing the content.xml file directly is the only way.
A dedicated p2 publisher advice taking the private keys to sign with as input would be a good addition.

Shouldn't it work in a way that Platform trusts Apache and thus an Apache artifact would be trusted trough web of trust?

Te Web Of Trust is not implemented in the Platform so far, and even if web of trust exists, it's not something to automate but more something to use as hints for users to decide whether to trust or not.

Beside that 're-signing' was more referred here as the process of taking an artifact from an arbitrary source and code-sign it with the Eclipse codesigning certificate, one thing that could be avoided when using the PGP trust if I have understand that correctly...

PGP signature is an external way of doing code signing, which is capable of resigning; I think resigning is actually interesting for Eclipse case as explained in my previoys comment.

@laeubi
Copy link
Member Author

laeubi commented Aug 1, 2021

A dedicated p2 publisher advice taking the private keys to sign with as input would be a good addition.

okay, thanks for clarification, I'll take a look if I can create one then for this purpose

PGP signature is an external way of doing code signing

Can you explain this more? I must confess I have thought about that the actual jar file/artifact is signed an not the individual class files as it is done with traditional codesigning (is the signing information also available at runtime?)

@mickaelistria
Copy link
Contributor

mickaelistria commented Aug 1, 2021 via email

@laeubi
Copy link
Member Author

laeubi commented Aug 2, 2021

@mickaelistria I have some more question, looking at your gpg-repository signer it does two things:

  1. sign each artifact and attach the signature as a property
  2. add the public key of the signer to the repo properties

Is the second part optional and key-list (e.g. MIT Keylist used by maven) can be used instead of specify the key? Does it mean that each artifact needs to be signed with the same key or can we have multiple ones?
Because I would have expected, instead of a single property pgp.publicKeys, ones in the form pgp.publicKeys.<keyid> so we can have multiple ones..

@mickaelistria
Copy link
Contributor

mickaelistria commented Aug 2, 2021 via email

@laeubi
Copy link
Member Author

laeubi commented Aug 2, 2021

P2 doesn't relt on keyserver,

Are there any plans to support this? I ask this because specifically for maven artifacts it seems that the MIT Key server is a requirement to upload artifacts and thus this one seems a good starting point. And especially if it comes to revocation of keys or expired key, statically embedding public keys into the metadata "forever" might be problematic.

If Eclipse plans to go towards PGP it even would be good to have an eclipse-key server to allow/require e.g. project-commiters to publish a PGP key there also (similar to ECA services).

The pgp.publicKeys repo property can include multiple public keys

okay that makes it a bit more complicated to enhance existing repos but for sure is not an issue when creating one from scratch like done here.

laeubi added a commit to laeubi/tycho that referenced this issue Aug 17, 2021
…signatures in

the P2 site

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
laeubi added a commit to laeubi/tycho that referenced this issue Aug 19, 2021
…signatures in

the P2 site

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
@laeubi laeubi closed this as completed in 1f94567 Aug 21, 2021
@laeubi laeubi added this to the 2.5 milestone Sep 21, 2021
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

No branches or pull requests

2 participants