-
Notifications
You must be signed in to change notification settings - Fork 1.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
Support for FIPS compliance mode #14912
base: main
Are you sure you want to change the base?
Support for FIPS compliance mode #14912
Conversation
❌ Gradle check result for 6016d5d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
8e8ed47
to
6016d5d
Compare
❌ Gradle check result for 8e8ed47: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 6016d5d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
.../identity-shiro/src/main/java/org/opensearch/identity/shiro/realm/BCryptPasswordMatcher.java
Outdated
Show resolved
Hide resolved
Could use some help maybe from @cwperks or @peternied reviewing this, please. |
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Iwan Igonin <[email protected]> # Conflicts: # server/build.gradle # Conflicts: # server/build.gradle
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]> # Conflicts: # buildSrc/version.properties
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
…ional tests. Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
…Pattern Signed-off-by: Iwan Igonin <[email protected]>
Summery: - replace unsecure kerberos crypto algorithms - add 'java.security.KeyStore' to forbidden-apis - instantiate and use SecureRandom from BCFIPS library - exclude SunJCE from security providers list at runtime, when running in FIPS JVM - exclude Azure tests when running in FIPS JVM Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
Signed-off-by: Iwan Igonin <[email protected]>
c2db6e7
to
eabee15
Compare
❌ Gradle check result for eabee15: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
eabee15
to
663d3f5
Compare
❌ Gradle check result for 663d3f5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Iwan Igonin <[email protected]>
663d3f5
to
6a14fdc
Compare
Since the last code review, a few changes were introduced in the most recent two commits. I kindly ask to review them as well:
|
@kaimst taking another pass at this PR. I think all of my outstanding comments have been addressed. This PR looks like its in a good state w/ the introduction of the |
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.
Took another pass. This PR looks like its in a good state to me. @reta have your comments been addressed with the introduction of a build param?
@@ -113,6 +114,12 @@ dependencies { | |||
|
|||
// https://mvnrepository.com/artifact/org.roaringbitmap/RoaringBitmap | |||
api libs.roaringbitmap | |||
|
|||
// bouncyCastle |
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.
Most dependencies in this module reference the gradle version catalog. These could be converted similarly, but can be addressed in a future change.
@@ -0,0 +1,55 @@ | |||
# Security Properties for JDK 11 and higher, with BouncyCastle FIPS provider and BouncyCastleJsseProvider in approved-only mode |
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.
Are the same properties applicable to JDK 21 which 3.0.0 is planning to target?
@@ -64,6 +67,7 @@ | |||
import static org.hamcrest.Matchers.instanceOf; | |||
import static org.hamcrest.Matchers.lessThanOrEqualTo; | |||
|
|||
@LuceneTestCase.AwaitsFix(bugUrl = "") |
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.
Which test is failing in this suite? Is it necessary to mute these tests?
@@ -93,6 +93,26 @@ grant codeBase "${codebase.reactor-core}" { | |||
permission java.net.SocketPermission "*", "connect,resolve"; | |||
}; | |||
|
|||
// security | |||
grant { | |||
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.internal.spec"; |
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.
nit: this block and the block below can be consolidated into a single grant
block and the comment could be kept for maintainability to group permissions.
I don't expect this comment to be addressed, because JSM is on the deprecation path and there is an RFC open on whether it should be disabled in OpenSearch 3.0.0 entirely: #17181
@@ -122,34 +119,37 @@ private RestClient buildRestClient() { | |||
return RestClient.builder(new HttpHost("https", address.getHostString(), address.getPort())).build(); | |||
} | |||
|
|||
private static SSLContext getSslContext() throws Exception { | |||
SSLContext sslContext = SSLContext.getInstance(getProtocol()); | |||
private static SSLContext getSslContext(boolean server) throws Exception { |
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.
Does it make sense to split this test into 2? The one the deals with crt / jks, and a new one with bcfks?
Description
This PR makes FIPS mode available through the
OPENSEARCH_CRYPTO_STANDARD=FIPS-140-3
environmental parameter instead of thetests.fips.enabled
setting. It provides FIPS 140-3 support by replacing all BC dependencies with BCFIPS dependencies and making FIPS approved-only mode configurable at launch. Running this mode restricts the BCFIPS provider to rely solely on FIPS-certified ciphers.fips.gradle
build script is removed in order to support a single-build solution.java.security
file is added to the build to distinguish between FIPS and non-FIPS environments.fips_java.security
file is altered due to evolving security standards.security.policy
file is altered to grant necessary security permissions.Runtime limitations (known so far) that come with enabling FIPS mode:
Admins can continue to manage their systems without being impacted by this change. However, for those keen on FIPS compliance, the most common obstacle will likely be the requirement to set a stronger password for the internal keystore and also convert key and truststores to *.bcfks format.
ssl.verification_mode=NONE
setting is not permitted.Reasons for refactoring
PemUtils
, which is used by the Reindex API in cases of migrating data from a remote cluster that is TLS protected:Related Issues
opensearch-project/security#3420
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.