Skip to content

Conversation

@beanuwave
Copy link
Contributor

@beanuwave beanuwave commented Aug 5, 2025

Description

Provides additional build tooling to support builds in FIPS env, including a CLI trust-store installer to override $JAVA_HOME/lib/security/cacerts

  • add demo/test CLI configurator with the ability to:
    -- migrate JVM's default SSL trust store to a BCFKS-formatted one
    -- use an existing PKCS#11 trust store
    -- display installed 'KeyStore' providers
    -- show help
    -- execute above commands interactively or in script mode
  • add BC libs to standalone REST tests.
  • print out 'java.security.properties' for reproducibility information

Related Issues

Resolves RFC

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

❌ Gradle check result for f656bd4: 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?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

❌ Gradle check result for 20a5611: null

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?

@beanuwave beanuwave force-pushed the fips_build_tooling2 branch from 20a5611 to 2241009 Compare August 5, 2025 14:27
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

❌ Gradle check result for 2241009: 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?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

❕ Gradle check result for 1829731: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 61.70732% with 157 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.22%. Comparing base (753c135) to head (e4e4710).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...ools/cli/fips/truststore/CreateFipsTrustStore.java 22.22% 53 Missing and 3 partials ⚠️
.../opensearch/bootstrap/FipsTrustStoreValidator.java 50.81% 28 Missing and 2 partials ⚠️
...h/tools/cli/fips/truststore/TrustStoreService.java 61.40% 20 Missing and 2 partials ⚠️
...ols/cli/fips/truststore/FipsTrustStoreCommand.java 36.00% 16 Missing ⚠️
.../org/opensearch/gradle/test/rest/RestTestUtil.java 0.00% 9 Missing ⚠️
...ls/cli/fips/truststore/UserInteractionService.java 87.03% 7 Missing ⚠️
.../cli/fips/truststore/ProviderSelectionService.java 84.61% 4 Missing and 2 partials ⚠️
...search/gradle/test/StandaloneRestTestPlugin.groovy 0.00% 3 Missing ⚠️
...li/fips/truststore/GeneratedTrustStoreCommand.java 25.00% 3 Missing ⚠️
...pensearch/gradle/test/ClusterFormationTasks.groovy 0.00% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18921      +/-   ##
============================================
+ Coverage     73.10%   73.22%   +0.11%     
- Complexity    70959    71124     +165     
============================================
  Files          5737     5753      +16     
  Lines        324766   325184     +418     
  Branches      46981    47032      +51     
============================================
+ Hits         237425   238106     +681     
+ Misses        68226    67911     -315     
- Partials      19115    19167      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cwperks
Copy link
Member

cwperks commented Aug 6, 2025

Patch coverage is showing as 0% because the new tests are guarded with

@BeforeClass
public static void beforeClass() throws Exception {
   assumeTrue("Test should run in FIPS JVM", FipsMode.CHECK.isFipsEnabled());
}

The actual patch coverage is much higher, but the gradle check of this repo does not run with FIPS enabled.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

❌ Gradle check result for 974cec3: 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?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

✅ Gradle check result for 974cec3: SUCCESS

iigonin and others added 3 commits August 14, 2025 10:06
Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
…erts file; add bc-jsse provider

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
…tegy for default trust-store

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
@beanuwave beanuwave force-pushed the fips_build_tooling2 branch from 974cec3 to b08999b Compare August 14, 2025 17:29
Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
@beanuwave
Copy link
Contributor Author

@andrross @reta @cwperks Just pushed an update to introduce the new cluster-settings - do you think it's evolve into the right direction?

@github-actions
Copy link
Contributor

❌ Gradle check result for 69d46e3: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 1839524: 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?

@reta
Copy link
Contributor

reta commented Oct 23, 2025

@reta @cwperks All comments have been addressed or resolved. Is there anything else that needs to be done on my end?

Thank you @beanuwave , I have few really minor things, @andrross I would love to hear your opinion regarding #18921 (comment) before getting it in, thank you

iigonin and others added 2 commits October 24, 2025 11:55
…ut/output handling in CLI classes

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
@github-actions
Copy link
Contributor

❌ Gradle check result for ecff1dc: 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?

iigonin and others added 2 commits October 27, 2025 11:44
…r improved clarity

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
@github-actions
Copy link
Contributor

❌ Gradle check result for 3f9f021: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 8f24562: 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?

@beanuwave beanuwave force-pushed the fips_build_tooling2 branch from 8f24562 to a1c2c96 Compare October 27, 2025 16:13
@github-actions
Copy link
Contributor

✅ Gradle check result for a1c2c96: SUCCESS

@github-actions
Copy link
Contributor

❌ Gradle check result for e4e4710: 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?

Copy link
Contributor

@reta reta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @beanuwave , great work. Just an ask if you plan to push some more changes, there are quite a few places in tests where we still use manual lifecycle management for sharedTempDir, would be great to unify those with:

@ClassRule
    public static TemporaryFolder sharedTempDir= new TemporaryFolder();

@github-actions
Copy link
Contributor

❌ Gradle check result for e4e4710: 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?

@github-actions
Copy link
Contributor

✅ Gradle check result for e4e4710: SUCCESS

@cwperks cwperks merged commit 32c2fd3 into opensearch-project:main Oct 28, 2025
41 of 47 checks passed
@beanuwave
Copy link
Contributor Author

@cwperks @reta Thank you for the comprehensive reviews and your effort to push it over the line. Of course the next PR is already just around the corner 😄

anandpatel9998 pushed a commit to anandpatel9998/OpenSearch that referenced this pull request Nov 3, 2025
…18921)

* Add build-tooling to run in the FIPS environment

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* replace java.util with lfs4j logger; use AccessController to read cacerts file; add bc-jsse provider

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* replace fallback mechanism with cluster-setting to determine the strategy for default trust-store

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* cleanup changelog.md

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* add default enum value; extend MultiProviderTrustStoreHandler test-class

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* fix :server:forbiddenApisTest

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* configure docker and testClusters builds to use generated truststore

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* add more unit tests

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* replace MultiProviderTrustStoreHandler with demo script

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* fix CHANGELOG; update CLI's build.gradle; write additional docu

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* add more tests

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* remove '--enable-native-access=ALL-UNNAMED'

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* apply BouncyCastleThreadFilter

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* replace BuildParams.inFipsJvm with getter

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* make use of 'testFipsRuntimeOnly' inside StandaloneRestTestPlugin; override and simplify ConfigurationProperties#toString

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* use BCFIPS_RNG; make java.util.Scanner test-friendly; write additional unit tests

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* get SecureRandom from server-module

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* add '--password option' to CLI

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* increase tests coverage for FipsTrustStoreValidator

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* fix teardown on SecurityProviderManagerTests

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* Throw a reasonable error when FIPS is not configured

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* Refactor tests to use TemporaryFolder rule; simplify and clean up input/output handling in CLI classes

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

* Rename `SecurityProviderService` to `SecurityConfigurationPrinter` for improved clarity

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>

---------

Signed-off-by: Igonin <[email protected]>
Co-authored-by: Igonin <[email protected]>
Co-authored-by: Benny Goerzig <[email protected]>
Co-authored-by: Karsten Schnitter <[email protected]>
Co-authored-by: Kai Sternad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] FIPS-140 Compliance Roadmap for OpenSearch

6 participants