-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow passing in private/public key from casc #19
Comments
Why would that be a problem? Jenkins would begin to serve the new public key from the OIDC discovery endpoint, and relying parties should honor the new public key when validating id tokens signed with the new private key. Put another way, it is a fundamental part of the design of this plugin that when creating credentials you are not prompted for a key, you never see a key, you never manage a key. The keypair is not intended to be part of the visible configuration. #3 would even make it ephemeral. |
I forgot to mention that we are using the external issuer option. Otherwise you are of course correct, the OIDC discovery endpoint would handle it. Do you have any recommendation |
Ah external issuer. Yes I think some sort of cron job (whether inside Jenkins or out) which mirrors the current |
@jglick The way I see it is there is no way to replicate this information (easily) to a separate website so:
This is a great plugin and works quite well for what we're doing - but having it change creds on restart is painful. |
They are not. This issue is about recreating the controller from scratch, not a restart with configuration in place.
The public key is served from an unauthenticated URL space already. |
Apologies for being mistaken, where are they stored then?
Even when an external issuer is used? (Jenkins is not publicly accessible in my case) Thanks! |
Hence this issue. Very different from merely restarting a controller, which should not rotate keypairs.
Oh not in that case. oidc-provider-plugin/src/main/java/io/jenkins/plugins/oidc_provider/Keys.java Lines 72 to 75 in 30947d5
|
I'm in the same exact scenario as @bdellegrazie. Having the key rotate when Jenkins is recreated doesn't work well when using an External Issuer which is Isolated from Jenkins. Defining the keys through CasC and passing a secret would address this problem. I understand that at the moment the key is totally managed by the plugin and that's how it was intended. But this really doesn't work well at all when using an external issuer. |
@DavidRomao Just FYI - I've worked around this by using the Jenkins API to get the public key after a re-creation to put the external issuer content from Jenkins. It's annoying but at least it's largely automated. |
Thanks, I'm considering that option ! |
I'd like to know that too actually. Where are they stored? Security isn't my area of expertise but if they aren't available only in the runtime code execution, that means they're presumably on a file / db somewhere and so are grab-able, right? |
I think I found the private key actually in encrypted form in Now as far as I've been able to tell from this and this, if someone has access to both the encrypted forms of the credentials as well as the files under Technically you can add your line of defense at who is able to access your jenkins-hosting server, but it's probably a good idea to also auto rotate the OIDC keypair frequently; I'm thinking maybe through a job that runs once or twice a day by recreating the id token credential (and updating the publicly served Anyway, I know all this is kind of a tangent but I thought about sharing my thoughts in case anyone has a similar concern. If anything I've said (where & how creds are stored / concerns / etc) is wrong or incomplete, please correct me for my and anyone else's benefit. Thanks. |
Anyone with direct filesystem (shell) access to Using this plugin should be safer than storing static credentials in Jenkins, since even if files on These discussions remind me that it would be helpful to publish a clear threat model for the plugin. |
What feature do you want to see added?
In our setup, the jenkins instance is wiped with each redeploy and recreated from casc. This
is done to enforce people to configure their jobs/configuration as code.
Of course this doesn't play well with the OIDC provider plugin, as the secret get re-created
on each jenkins redeploy.
My proposed solution would be, to allow passing in private/public key via constructor and thus
allowing it to be specified in casc. Of course you would not check in the value as plain text,
but pass them in via environment variables.
Upstream changes
No response
The text was updated successfully, but these errors were encountered: