Conversation
Contributor
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 6816422. ⛔ Hard block: Issues at High severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Introduces gradle/fips.gradle as the single place where FIPS mode is decided and applied to the build's test surface: which test classes exist in each mode and the JVM arguments test workers need to actually be in FIPS mode. Mode is driven by the OPENSEARCH_FIPS_MODE environment variable, surfaced to production code through the new FipsMode enum. BC FIPS artifacts move to compileOnly in both modes (they are provided by OpenSearch core), bctls-fips is added, and the securityadmin standalone bundles now ship the BC FIPS jars in deps/. Because java_test.security registers BouncyCastleFipsProvider in every test JVM -- including non-FIPS runs -- any suite that touches JCA now leaves a "BC FIPS Entropy Daemon" thread behind, which RandomizedRunner reports as a leak. BCFipsEntropyDaemonFilter covers it; the framework's BouncyCastleThreadFilter does not. It is applied to the suites that trip over it here, and reused by later FIPS work. No FIPS variant test classes exist yet, so this otherwise lands inert: the default build is unchanged and fips.gradle currently selects nothing. Signed-off-by: Iwan Igonin <iigonin@sternad.de> Co-authored-by: Benny Goerzig <benny.goerzig@sap.com> Co-authored-by: Karsten Schnitter <k.schnitter@sap.com> Co-authored-by: Kai Sternad <k.sternad@sternad.de>
Replaces the isPkcs11()-style branching in the SSL configuration layer with sealed pem/jdk/pkcs11 records for both key stores and trust stores, and moves PKCS#11 dispatch into those records. Store passwords are wrapped in a StorePassword type so they are redacted in toString() rather than leaking into logs. A PKCS#11 store lives on the token rather than on disk, so the path becomes optional throughout: KeyStoreUtils loads such stores with a null stream, and error messages name the token instead of a file. PemKeyReader learns the PKCS11 store type and validates that a PKCS#11 provider is actually registered. Trust store settings that a PKCS#11 configuration ignores now produce a warning instead of being silently dropped. Signed-off-by: Iwan Igonin <iigonin@sternad.de> Co-authored-by: Benny Goerzig <benny.goerzig@sap.com> Co-authored-by: Karsten Schnitter <k.schnitter@sap.com> Co-authored-by: Kai Sternad <k.sternad@sternad.de>
iigonin
force-pushed
the
fips-split/2-ssl-store-config
branch
from
September 16, 2026 16:28
af17522 to
6816422
Compare
5 tasks
beanuwave
marked this pull request as ready for review
September 17, 2026 07:18
beanuwave
requested review from
DarshitChanpura,
Rishav9852Kumar,
RyanL1997,
cwperks,
derek-ho,
finnegancarroll,
nibix,
reta,
shikharj05 and
willyborankin
as code owners
September 17, 2026 07:18
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Category: Enhancement, Refactoring
Independent of FIPS: this adds PKCS#11 (HSM) support for node TLS and replaces ad-hoc
isPkcs11()-style branching with a type-driven model. Reviewable without any FIPS context.Key changes
pem/jdk/pkcs11records, and PKCS#11 dispatch moves into the records themselves rather than being re-decided at each call site.StorePasswordwrapper. Store passwords are wrapped in a type whosetoString()redacts the value, so a password cannot reach a log through an accidental interpolation.KeyStoreUtilsloads such stores with a null stream, and error messages name the token instead of a non-existent file.PemKeyReaderlearns thePKCS11store type and validates that a PKCS#11 provider is actually registered, rather than failing obscurely later.no encoding for key); SunJSSE delegates the handshake signature to the key's own provider (SunPKCS11). So when the keystore is PKCS#11,SslConfigurationbuilds theSSLContextagainst SunJSSE (SslContextBuilder.sslContextProvider(SunJSSE)).Reviewer notes
PemSslCertificatesLoaderTestusesnextAlphanumeric(10)where the final branch usesPasswordValidator.FIPS_MIN_PASSWORD_LENGTH. That constant does not exist until PR 5 — this is deliberate, please don't "fix" it here.Testing
./gradlew test integrationTestManual test: node TLS key on a PKCS#11 token (SoftHSM), non-FIPS
Exercises a token-resident node TLS key (signed via SunJSSE) with a PKCS#12 file trust store, on a plain non-FIPS JVM.
securityadminstill authenticates with the PEMkirkcert here — PKCS#11 client keys in the CLI arrive with PR 5. All paths are relative to$OPENSEARCH_HOME.Negative checks (restart per check, restore afterwards):
keystore_password: "0000") — node refuses to start withFailed to load keystore from the PKCS#11 token.OPENSEARCH_JAVA_OPTS(no PKCS#11 provider configured) — node refuses to start at config load with the same message, caused byKeyStoreException: PKCS11 not found, rather than failing later in a handshake.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.