forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JEP-237] Disable usage stats in fips mode (jenkinsci#8483)
* [JEP-237] disable UsageStats in FIPS mode UsageStatistics is so close to being FIPS-140 compliant but fails at the last hurdle. We can not encrypt with RSA but we can perform key wrap. The output does separate the key and data, by creating a new Key for encrypting the data and that key is encrypted with RSA. If only the RSA cipher was created with Cipher.WRAP_MODE (or Cipher.UNWRAP_MODE) instead of CIPHER.ENCRYPT_MODE (or CIPHER.DECRYPT_MODE) we would be fine, alas it is not and changing this would mean a change on the backend and to be able to continue to support both whilst older versions are in the wild. The goal of JEP-237 is not to fix all non compliant issues, so here we just ensure that in FIPS mode the usage statistics are disabled. Updates the UI in the global config page to adapt to usagestats being fully disabled by system property or partially disabled by the FIPS property Co-authored-by: Daniel Beck <[email protected]>
- Loading branch information
1 parent
81af975
commit c4d6fa2
Showing
4 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
core/src/main/resources/hudson/model/UsageStatistics/global.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
package hudson.model.UsageStatistics | ||
|
||
import hudson.model.UsageStatistics | ||
import jenkins.security.FIPS140 | ||
import hudson.Functions | ||
|
||
def f=namespace(lib.FormTagLib) | ||
|
||
f.section(title: _("Usage Statistics")) { | ||
f.optionalBlock(field: "usageStatisticsCollected", checked: app.usageStatisticsCollected, title: _("statsBlurb")) | ||
if (UsageStatistics.DISABLED) { | ||
span(class: "jenkins-not-applicable") { | ||
raw(_("disabledBySystemProperty")) | ||
} | ||
} else if (FIPS140.useCompliantAlgorithms()) { | ||
f.optionalBlock(field: "usageStatisticsCollected", checked: app.usageStatisticsCollected, title: _("statsBlurbFIPS")) | ||
} else { | ||
f.optionalBlock(field: "usageStatisticsCollected", checked: app.usageStatisticsCollected, title: _("statsBlurb")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters