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
Extensible way to GPG-sign repository metadata. #1093
Conversation
|
@ehelms I think you may be interested in this PR. |
45d93d5
to
f575f24
Compare
|
To clarify for me, this keeps GPG signing key management external to Pulp but increases the flexibility for deployment of that key via configurable signing mechanism that lets me have full control over how I deploy my signing key? |
|
Yes, that is the intention. We use relic (https://github.com/sassoftware/relic) and a signing server with an HSM. |
|
@PaulSD I think you will find this very interesting given it would affect the work in (theforeman/puppet-certs#188) potentially changing it or making it less complicated for your scenario. |
|
Cool! For reference, I wrote the initial repo metadata signing stuff here: f73805f theforeman/puppet-certs#188 is meant to configure this behavior in pulp, distribute the public GPG key to clients, and configure subscription-manager on clients (see candlepin/subscription-manager#1749 ). I should probably update that PR to allow configuration of the new Pulp configuration options in this PR, but I don't otherwise think this should impact that. |
|
Actually, in the case that multiple keys are used for different Pulp repos, this may significantly complicate things in theforeman/puppet-certs#188 ... @mibanescu do you have a user story or an actual use case that requires signing the repo metadata on separate repos with separate keys? Would a Foreman user ever need to do that, or is this only needed for more generic/independent uses of Pulp? Can I just ignore that use case for the purposes of theforeman/puppet-certs#188 ? |
|
I am not familiar with Foreman or the other PR, but here is my use case. We use a dev/test/prod model for our software lifecycle. We want our customers, consuming prod packages (and metadata) to validate that the software comes from us. So we sign that with a key. However, we don't want dev or test packages to be signed with the prod key, because that software is not ready for public consumption. We would want a test deployment to act like a prod deployment, including the signature validation part, so do want signatures, just not with the prod key. |
|
Thanks! In that case, you definitely wouldn't want all of the keys automatically distributed to all of the clients, which is part of the point of theforeman/puppet-certs#188 ... So, I think I am safe ignoring this use case for now in that PR. |
|
I should also mention that, if gpg_cmd is not set in the plugin config, the sign command defaults to what was in the original patch. |
docs/tech-reference/yum-plugins.rst
Outdated
|
|
||
| The signing command will be passed the following environment variables: | ||
| * ``GPG_CMD`` | ||
| * ``GPG_KEY_ID`` (if specified in the configuration file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says "the configuration file", but the key ID can also be stored on the yum distributor object, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is correct. All these can be done via distributor configurations as well, although GPG_CMD is probably not hugely helpful. GPG_KEY_ID is.
Would you like me to update the documentation to include this?
Also, is it possible for this to be included in pulp 2.16? I saw an email mentioning that it would need to be merged today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm commenting as an interested user only. We would use this feature, but we'd probably set the key ID on each repo's distributor object.
If written as, "if specified in the configuration", i.e. drop the "file", then I'd have understood it as meaning all of the usual ways config can be provided to a distributor: on the distributor itself, on the config file for that distributor type, or in override_config during a call to publish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, and fixed.
fd7cfc6
to
9e241f8
Compare
|
@mibanescu Can you add a 2.16 release note to pulp_rpm for this? I may be able to test some today before the 2.16 deadline, but it needs a release note. |
In certain environments, GPG private keys are secured in an HSM, instead of being in a keyring, unprotected by a passphrase. This allows one to change the signing command, and passes repository ID information as an envronment variable into the signing command, in case different keys need to be used. Fixes: #3444 https://pulp.plan.io/issues/3444
|
|
After pulling the latest code and making a few changes to testing I believe this feature is demonstrated to be working. Here is what I did:
Specifically you can see that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it and I posted my results. This works as expected and there are no other outstanding changes that I know of.
In certain environments, GPG private keys are secured in an HSM,
instead of being in a keyring, unprotected by a passphrase.
This allows one to change the signing command, and passes
repository ID information as an envronment variable into
the signing command, in case different keys need to be used.
Fixes: #3444
https://pulp.plan.io/issues/3444