forked from elastic/elasticsearch
-
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.
Enable tests in FIPS 140 in JDK 11 (elastic#48378)
This change enables us to run our test suites in JVMs configured in FIPS 140 approved mode. It does so by: - Using BouncyCastle FIPS Cryptographic provider and BSJSSE in FIPS mode. These are used as testRuntime dependencies for unit tests and internal clusters, and copied (relevant jars) explicitly to the lib directory for testclusters used in REST tests - Configuring any given runtime Java in FIPS mode with the bundled policy and security properties files, setting the system properties java.security.properties and java.security.policy with the == operator that overrides the default JVM properties and policy. Running the tests in FIPS 140 approved mode doesn't require an additional configuration either in CI workers or locally and is controlled by specifying -Dtests.fips.enabled=true Closes: elastic#37250 Supersedes: elastic#41024
- Loading branch information
Showing
27 changed files
with
513 additions
and
220 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
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
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
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
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
grant { | ||
permission java.security.SecurityPermission "putProviderProperty.BCFIPS"; | ||
permission java.security.SecurityPermission "putProviderProperty.BCJSSE"; | ||
permission java.lang.RuntimePermission "getProtectionDomain"; | ||
permission java.util.PropertyPermission "java.runtime.name", "read"; | ||
permission org.bouncycastle.crypto.CryptoServicesPermission "tlsAlgorithmsEnabled"; | ||
//io.netty.handler.codec.DecoderException | ||
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.internal.spec"; | ||
//java.security.InvalidAlgorithmParameterException: Cannot process GCMParameterSpec | ||
permission java.lang.RuntimePermission "accessDeclaredMembers"; | ||
permission java.util.PropertyPermission "intellij.debug.agent", "read"; | ||
permission java.util.PropertyPermission "intellij.debug.agent", "write"; | ||
permission org.bouncycastle.crypto.CryptoServicesPermission "exportSecretKey"; | ||
permission org.bouncycastle.crypto.CryptoServicesPermission "exportPrivateKey"; | ||
permission java.io.FilePermission "${javax.net.ssl.trustStore}", "read"; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
security.provider.1=org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider | ||
security.provider.2=org.bouncycastle.jsse.provider.BouncyCastleJsseProvider fips:BCFIPS | ||
security.provider.3=SUN | ||
securerandom.source=file:/dev/urandom | ||
securerandom.strongAlgorithms=NativePRNGBlocking:SUN,DRBG:SUN | ||
securerandom.drbg.config= | ||
login.configuration.provider=sun.security.provider.ConfigFile | ||
policy.provider=sun.security.provider.PolicyFile | ||
policy.expandProperties=true | ||
policy.allowSystemProperty=true | ||
policy.ignoreIdentityScope=false | ||
keystore.type=BCFKS | ||
keystore.type.compat=true | ||
package.access=sun.misc.,\ | ||
sun.reflect. | ||
package.definition=sun.misc.,\ | ||
sun.reflect. | ||
security.overridePropertiesFile=true | ||
ssl.KeyManagerFactory.algorithm=PKIX | ||
ssl.TrustManagerFactory.algorithm=PKIX | ||
networkaddress.cache.negative.ttl=10 | ||
krb5.kdc.bad.policy = tryLast | ||
jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \ | ||
RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224 | ||
jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \ | ||
DSA keySize < 1024 | ||
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024, \ | ||
EC keySize < 224, DES40_CBC, RC4_40, 3DES_EDE_CBC | ||
jdk.tls.legacyAlgorithms= \ | ||
K_NULL, C_NULL, M_NULL, \ | ||
DH_anon, ECDH_anon, \ | ||
RC4_128, RC4_40, DES_CBC, DES40_CBC, \ | ||
3DES_EDE_CBC | ||
jdk.tls.keyLimits=AES/GCM/NoPadding KeyUpdate 2^37 | ||
crypto.policy=unlimited | ||
jdk.xml.dsig.secureValidationPolicy=\ | ||
disallowAlg http://www.w3.org/TR/1999/REC-xslt-19991116,\ | ||
disallowAlg http://www.w3.org/2001/04/xmldsig-more#rsa-md5,\ | ||
disallowAlg http://www.w3.org/2001/04/xmldsig-more#hmac-md5,\ | ||
disallowAlg http://www.w3.org/2001/04/xmldsig-more#md5,\ | ||
maxTransforms 5,\ | ||
maxReferences 30,\ | ||
disallowReferenceUriSchemes file http https,\ | ||
minKeySize RSA 1024,\ | ||
minKeySize DSA 1024,\ | ||
minKeySize EC 224,\ | ||
noDuplicateIds,\ | ||
noRetrievalMethodLoops | ||
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\ | ||
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!* |
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
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
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
Oops, something went wrong.