aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main
diff options
context:
space:
mode:
authorTrabelsi Tobias <tobias.trabelsi@sonarsource.com>2021-10-19 08:24:20 +0200
committersonartech <sonartech@sonarsource.com>2021-10-22 20:03:27 +0000
commit959f7f05fc7ee9a75669fe75f27c624930b284d7 (patch)
treec630afed3b38a38fb97aa4ad353e36060744d53b /server/sonar-main
parente2faf2d86511c2b843f2ac82a811579c937a768c (diff)
downloadsonarqube-959f7f05fc7ee9a75669fe75f27c624930b284d7.tar.gz
sonarqube-959f7f05fc7ee9a75669fe75f27c624930b284d7.zip
DOCKER-27 disable FIPS mode
Diffstat (limited to 'server/sonar-main')
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/command/CeJvmOptions.java4
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java2
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/command/WebJvmOptions.java3
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java3
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java2
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java3
6 files changed, 15 insertions, 2 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/CeJvmOptions.java b/server/sonar-main/src/main/java/org/sonar/application/command/CeJvmOptions.java
index 57b367fe9cc..cf7c70207d3 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/command/CeJvmOptions.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/command/CeJvmOptions.java
@@ -45,6 +45,10 @@ public class CeJvmOptions extends JvmOptions<CeJvmOptions> {
res.put("--add-opens=java.base/sun.nio.ch=ALL-UNNAMED", "");
res.put("--add-opens=java.management/sun.management=ALL-UNNAMED", "");
res.put("--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED", "");
+
+ // disable FIPS mode for the JVM so SonarQube can use certain algorithms
+ res.put("-Dcom.redhat.fips=", "false");
+
return res;
}
}
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java b/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
index 975b5a7071e..89a2e99aae0 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
@@ -126,6 +126,8 @@ public class EsJvmOptions extends JvmOptions<EsJvmOptions> {
* parsing will break in an incompatible way for some date patterns and locales.
*/
res.put("-Djava.locale.providers=", "COMPAT");
+ // disable FIPS mode for the JVM so SonarQube can use certain algorithms
+ res.put("-Dcom.redhat.fips=", "false");
}
public void writeToJvmOptionFile(File file) {
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/WebJvmOptions.java b/server/sonar-main/src/main/java/org/sonar/application/command/WebJvmOptions.java
index b4eb48796c6..608a38de1b9 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/command/WebJvmOptions.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/command/WebJvmOptions.java
@@ -49,6 +49,9 @@ public class WebJvmOptions extends JvmOptions<WebJvmOptions> {
res.put("--add-opens=java.base/sun.nio.ch=ALL-UNNAMED", "");
res.put("--add-opens=java.management/sun.management=ALL-UNNAMED", "");
res.put("--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED", "");
+
+ // disable FIPS mode for the JVM so SonarQube can use certain algorithms
+ res.put("-Dcom.redhat.fips=", "false");
return res;
}
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java
index 20171b98e4c..3a58d8dfbbf 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java
@@ -51,6 +51,7 @@ public class CeJvmOptionsTest {
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.management/sun.management=ALL-UNNAMED",
- "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED");
+ "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED",
+ "-Dcom.redhat.fips=false");
}
}
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
index 12b202f261f..a4c7c3bcc91 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
@@ -68,6 +68,7 @@ public class EsJvmOptionsTest {
"-Dlog4j.shutdownHookEnabled=false",
"-Dlog4j2.disable.jmx=true",
"-Djava.locale.providers=COMPAT",
+ "-Dcom.redhat.fips=false",
"-Des.enforce.bootstrap.checks=true");
}
@@ -149,6 +150,7 @@ public class EsJvmOptionsTest {
"-Dlog4j.shutdownHookEnabled=false\n" +
"-Dlog4j2.disable.jmx=true\n" +
"-Djava.locale.providers=COMPAT\n" +
+ "-Dcom.redhat.fips=false\n" +
"-Des.enforce.bootstrap.checks=true\n" +
"-foo\n" +
"-bar");
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java
index 3134c2f1ef6..751d307c165 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java
@@ -54,7 +54,8 @@ public class WebJvmOptionsTest {
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.management/sun.management=ALL-UNNAMED",
- "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED");
+ "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED",
+ "-Dcom.redhat.fips=false");
}
}