-
Notifications
You must be signed in to change notification settings - Fork 275
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
Refactor SSL Configuration #4671
Refactor SSL Configuration #4671
Conversation
ba52873
to
492afb9
Compare
750d140
to
b353893
Compare
53da48a
to
9b5af97
Compare
src/main/java/org/opensearch/security/dlic/rest/api/SecuritySSLCertsApiAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/ssl/SslSettingsManager.java
Outdated
Show resolved
Hide resolved
9b5af97
to
8d93ac9
Compare
Hi @terryquigleysas and @dancristiancecoi, could you please review this solution as well? |
src/test/java/org/opensearch/security/ssl/SslContextHandlerTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/ssl/SslContextHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/ssl/SslSettingsManager.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/ssl/SslSettingsManager.java
Outdated
Show resolved
Hide resolved
431a1d2
to
77b498c
Compare
src/test/java/org/opensearch/security/ssl/OpenSearchSecuritySSLPluginTest.java
Outdated
Show resolved
Hide resolved
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.
Thanks for the changes! Few minor comments
src/test/java/org/opensearch/security/ssl/SslContextHandlerTest.java
Outdated
Show resolved
Hide resolved
1522049
to
044e516
Compare
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.
Apologies for the delay. Looks good to me! Left a question & a few minor nit picky comments that can be ignored.
I couldn't find any new hidden dependencies on bcprov so I think these changes should work in a FIPS environment. Was this something you had a chance to test?
src/main/java/org/opensearch/security/dlic/rest/api/SecuritySSLCertsApiAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/dlic/rest/api/SecuritySSLCertsApiAction.java
Show resolved
Hide resolved
Hi @willyborankin This looks good. I do have one question. Can I ask for more in information on your thinking around using Netty "to use FIPS instead of a BC-based solution" ? As a BC-based solution could use FIPS-approved libraries for those operations how is that achieved by using Netty? |
044e516
to
4cb0e6a
Compare
4cb0e6a
to
e9aefef
Compare
e9aefef
to
5e192a3
Compare
@willyborankin @cwperks Thank you for going over this a bit further with me. Does this mean that, in order to support FIPS here, that a change may be required in Netty to also attempt to load in the BouncyCastleFipsProvider as it does for the non-FIPS provider here https://github.com/netty/netty/blob/4.1/handler/src/main/java/io/netty/handler/ssl/BouncyCastlePemReader.java#L72-L94 ? |
Hi @terryquigleysas, this is not related to FIPS. It pertains to parsing and reading the PKCS1 PEM format, which was not supported prior to JDK 17 (https://bugs.openjdk.org/browse/JDK-8258394) and was backported to JDK1.8 and JDK11. |
@willyborankin Thank you for the additional explanation. |
5e192a3
to
7d66500
Compare
Changes: - Refactored DefaultKeyStore into specialized subclasses, each managing a distinct responsibility. - Added missing tests for certificate loading, SSL parameter configuration, and related processes. Signed-off-by: Andrey Pleskach <[email protected]>
6aed562
7d66500
to
6aed562
Compare
@DarshitChanpura could you plz approve it one more time? I fixed conflicts |
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.
LGTM!
db6e7dc
into
opensearch-project:main
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4671-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 db6e7dc1664694497d80ee0b8b727350c1086b47
# Push it to GitHub
git push --set-upstream origin backport/backport-4671-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
@willyborankin can you open a manual backport for this PR? |
(cherry picked from commit db6e7dc) Signed-off-by: Andrey Pleskach <[email protected]>
Description
Refactor DefaultKeyStore
Changes:
Refactored
DefaultKeyStore
into specialized subclasses,each managing a distinct responsibility.
Added missing tests for certificate loading, SSL parameter configuration, and related processes.
Key differences compared to the existing solution:
Netty for PEM Certificates: Netty is now used to load PEM certificates and private keys, which allows to use FIPS instead of a BC-based solution. In the future, we can switch to JDK 21, which provides much better support for loading from PEM files compared to previous versions.
JDK Key/Trust Store Handling: The SSL settings loader now reads all authority certificates and private keys from the key/trust store, rather than just the first encountered alias/private key.
Certificate Date Validation: For validating notAfter and notBefore dates on certificates, we switched to the built-in JDK function, which only validates date ranges for key material certificates.
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.