-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[JENKINS-58743] Allow to provide a custom path for master key #10235
[JENKINS-58743] Allow to provide a custom path for master key #10235
Conversation
Insert a call to |
core/src/main/java/jenkins/security/DefaultConfidentialStore.java
Outdated
Show resolved
Hide resolved
if (SystemProperties.getBoolean(MASTER_KEY_READONLY_SYSTEM_PROPERTY_NAME)) { | ||
throw new IOException(masterSecret + " does not exist and system property " + MASTER_KEY_READONLY_SYSTEM_PROPERTY_NAME + " is set. You must provide a valid master key file."); | ||
} else { | ||
// we are only going to use small number of bits (since export control limits AES key length) |
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.
BTW I think this comment has been obsolete for years?
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.
Still
jenkins/core/src/main/java/hudson/Util.java
Line 704 in 2c92eae
// Due to the stupid US export restriction JDK only ships 128bit version. |
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.
Since Java 9 not true? https://stackoverflow.com/a/46857694/4951015
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.
Indeed, though would take non-trivial changes to migrate to the new key length. Not in scope of my current change.
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.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
Please file a pull request to document these system properties at https://www.jenkins.io/doc/book/managing/system-properties/ |
See JENKINS-58743.
The following system properties can be used to control the behaviour
jenkins.security.DefaultConfidentialStore.file
allows to provide an alternative path to load/store the master key (when unset, defaults to$JENKINS_HOME/secrets/master.key
as previously)jenkins.security.DefaultConfidentialStore.readOnly
whentrue
, prevents Jenkins from generating a master key. If the master key file doesn't exist, Jenkins fails to start.User-facing doc jenkins-infra/jenkins.io#7859
Testing done
Create master.key beforehand in standard path
✅ Normal startup sequence
Content of
$JENKINS_HOME/secrets
after startupCreate master.key beforehand in custom path
✅ Normal startup sequence
Content of
$JENKINS_HOME/secrets
after startupReadonly missing master key
Starting with
-Djenkins.master.key.readOnly=true
and missingmaster.key
.Jenkins fails to start
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist