Skip to content

Commit e6b3980

Browse files
committed
make fips configurable
1 parent 657f5b7 commit e6b3980

64 files changed

Lines changed: 202 additions & 776 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildSrc/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ dependencies {
123123
api 'org.jruby.joni:joni:2.2.1'
124124
api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson_databind')}"
125125
api "org.ajoberstar.grgit:grgit-core:5.2.1"
126+
api "org.bouncycastle:bc-fips:1.0.2.5"
127+
126128

127129
testFixturesApi "junit:junit:${props.getProperty('junit')}"
128130
testFixturesApi "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}"

buildSrc/src/main/java/org/opensearch/gradle/info/BuildParams.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class BuildParams {
5252
private static JavaVersion gradleJavaVersion;
5353
private static JavaVersion runtimeJavaVersion;
5454
private static String runtimeJavaDetails;
55+
@Deprecated
5556
private static Boolean inFipsJvm;
5657
private static String gitRevision;
5758
private static String gitOrigin;

buildSrc/src/main/java/org/opensearch/gradle/info/GlobalBuildInfoPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void apply(Project project) {
129129
params.setIsCi(System.getenv("JENKINS_URL") != null);
130130
params.setIsInternal(isInternal);
131131
params.setDefaultParallel(findDefaultParallel(project));
132-
params.setInFipsJvm(Util.getBooleanProperty("tests.fips.enabled", true));
132+
params.setInFipsJvm(Util.getBooleanProperty("tests.fips.enabled", false));
133133
params.setIsSnapshotBuild(Util.getBooleanProperty("build.snapshot", true));
134134
if (isInternal) {
135135
params.setBwcVersions(resolveBwcVersions(rootDir));

buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,56 +1170,6 @@ private void createConfiguration() {
11701170
baseConfig.put("node.portsfile", "true");
11711171
baseConfig.put("http.port", httpPort);
11721172
baseConfig.put("transport.port", transportPort);
1173-
baseConfig.put("http.host", "192.168.33.46");
1174-
1175-
1176-
// self-signed CA authority
1177-
baseConfig.put("reindex.ssl.certificate_authorities", "/home/iwan/workspace/OpenSearch/certs/centST9/root-ca.pem");
1178-
1179-
// DSA (basically can only be used for signing)
1180-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-DSA.pem");
1181-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-DSA.pem");
1182-
1183-
// DSA enc
1184-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-DSA.pem");
1185-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-DSA-enc.pem");
1186-
// baseConfig.put("reindex.ssl.key_passphrase", "password");
1187-
1188-
// Elliptic Curve Diffie-Hellman (ECDH) secp256r1 aka prime256v1
1189-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-EC.pem");
1190-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-secp256r1.pem");
1191-
1192-
// Elliptic Curve enc
1193-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-EC.pem");
1194-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-secp256r1-enc.pem");
1195-
// baseConfig.put("reindex.ssl.key_passphrase", "password");
1196-
1197-
// RSA PKCS#1
1198-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-PKCS1.pem");
1199-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-PKCS1.pem");
1200-
1201-
// RSA PKCS#1 enc
1202-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-PKCS1.pem");
1203-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-PKCS1-enc.pem");
1204-
// baseConfig.put("reindex.ssl.key_passphrase", "password");
1205-
1206-
// RSA PKCS#8
1207-
// baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-PKCS8.pem");
1208-
// baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-PKCS8.pem");
1209-
1210-
// RSA PKCS#8 enc
1211-
baseConfig.put("reindex.ssl.certificate", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-PKCS8-enc.pem");
1212-
baseConfig.put("reindex.ssl.key", "/home/iwan/workspace/OpenSearch/certs/centST9/node2-key-PKCS8-enc.pem");
1213-
baseConfig.put("reindex.ssl.key_passphrase", "rzg9RxrMBDU3jV^^$vNB");
1214-
1215-
// keystore + struststore config
1216-
// baseConfig.put("reindex.ssl.keystore.path", "/home/iwan/workspace/OpenSearch/certs/centST9/keystore.bks");
1217-
// baseConfig.put("reindex.ssl.keystore.password", "password");
1218-
// baseConfig.put("reindex.ssl.truststore.path", "/home/iwan/workspace/OpenSearch/certs/centST9/truststore.bks");
1219-
// baseConfig.put("reindex.ssl.truststore.password", "password");
1220-
1221-
baseConfig.put("reindex.remote.whitelist", "node1.dns.a-record:10200");
1222-
12231173
// Default the watermarks to absurdly low to prevent the tests from failing on nodes without enough disk space
12241174
baseConfig.put("cluster.routing.allocation.disk.watermark.low", "1b");
12251175
baseConfig.put("cluster.routing.allocation.disk.watermark.high", "1b");
@@ -1232,6 +1182,7 @@ private void createConfiguration() {
12321182
baseConfig.put("indices.breaker.total.use_real_memory", "false");
12331183
// Don't wait for state, just start up quickly. This will also allow new and old nodes in the BWC case to become the master
12341184
baseConfig.put("discovery.initial_state_timeout", "0s");
1185+
baseConfig.put("fips.approved", "true");
12351186

12361187
// TODO: Remove these once https://github.com/elastic/elasticsearch/issues/46091 is fixed
12371188
baseConfig.put("logger.org.opensearch.action.support.master", "DEBUG");
-187 KB
Binary file not shown.

buildSrc/src/main/resources/fips_java_bcjsse_11.policy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// Security Policy for JDK 11 and higher, with BouncyCastle FIPS provider and BouncyCastleJsseProvider in FIPS mode
1313

1414
grant {
15+
permission org.bouncycastle.crypto.CryptoServicesPermission “changeToApprovedModeEnabled”;
1516
permission java.security.SecurityPermission "putProviderProperty.BCFIPS";
1617
permission java.security.SecurityPermission "putProviderProperty.BCJSSE";
1718
permission java.lang.RuntimePermission "getProtectionDomain";

buildSrc/src/main/resources/fips_java_bcjsse_11.security

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ policy.provider=sun.security.provider.PolicyFile
1212
policy.expandProperties=true
1313
policy.allowSystemProperty=true
1414
policy.ignoreIdentityScope=false
15-
keystore.type=BCFKS
1615
keystore.type.compat=true
1716
package.access=sun.misc.,\
1817
sun.reflect.

certs/centST9/admin-key.pem

Lines changed: 0 additions & 28 deletions
This file was deleted.

certs/centST9/admin.pem

Lines changed: 0 additions & 21 deletions
This file was deleted.

certs/centST9/bak/node2-PKCS8-enc.pem

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)