Add fips.mode configuration to control truststore check in FIPS mode for GCS repository#21122
Add fips.mode configuration to control truststore check in FIPS mode for GCS repository#21122reta merged 10 commits intoopensearch-project:mainfrom
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 5170a9d.
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. |
PR Reviewer Guide 🔍(Review updated until commit 1012319)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 1012319 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 20cc8d4
Suggestions up to commit f9f92c5
Suggestions up to commit 804ecb4
Suggestions up to commit 5170a9d
Suggestions up to commit b4909fe
|
|
❌ Gradle check result for b4909fe: 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? |
|
/retest |
Signed-off-by: tangkai55 <tangkai55@jd.com>
Signed-off-by: tangkai55 <tangkai55@jd.com>
Signed-off-by: tangkai55 <tangkai55@jd.com>
Signed-off-by: tangkai55 <tangkai55@jd.com>
Signed-off-by: tangkai55 <tangkai55@jd.com>
|
This change adds a fips.mode setting (default: true) to control strict FIPS truststore validation behavior. |
Thanks @Richard-coco , I am not entirely onboard with this change. The whole idea behind enabling FIPS is to make sure we could harden the distribution and all its components. Adding such ad-hoc opt-outs calls for issues, if the distribution or some of its components could not be run in the FIPS mode, well, the distribution has to turn it off. For operational flexibility, migrating to FIPS compatible trust store would be preferred (I believe we do provide some scripts already). |
…ogle certificates Replace the previous ad-hoc FIPS bypass switch with a compliant implementation. In FIPS mode, when no custom truststore is configured, the plugin now dynamically creates a FIPS-compliant BCFKS KeyStore and populates it with Google's default trusted certificates. This maintains full FIPS compliance while preserving the out-of-the-box experience without requiring manual truststore configuration or external scripts. Signed-off-by: tangkai55 <tangkai55@jd.com>
|
@reta Thanks for your guidance and feedback. I've removed the FIPS bypass switch and updated the code to use a proper FIPS-compliant BCFKS trust store for Google's default certificates. The scripts you mentioned work great for user-managed certificates, but they don't apply to the built-in Google certificates that come bundled with the GCS library. |
|
Persistent review updated to latest commit 5170a9d |
|
❌ Gradle check result for 5170a9d: 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 5170a9d: 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 5170a9d: 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 5170a9d: 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? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21122 +/- ##
============================================
- Coverage 73.35% 73.23% -0.13%
+ Complexity 73209 73156 -53
============================================
Files 5921 5932 +11
Lines 333798 333935 +137
Branches 48124 48127 +3
============================================
- Hits 244862 244541 -321
- Misses 69387 69877 +490
+ Partials 19549 19517 -32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit 804ecb4 |
|
Thanks @Richard-coco , would you be up adding test case to |
Adjust FIPS unit tests to reflect no custom truststore requirement in FIPS mode. Remove exception assertion for missing truststore and verify client creation succeeds with automatic BCFKS truststore initialization. Signed-off-by: tangkai55 <tangkai55@jd.com>
|
Persistent review updated to latest commit f9f92c5 |
|
@reta Sure, the corresponding test case for no trust store in FIPS mode has been added and pushed. |
|
❌ Gradle check result for f9f92c5: 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: tangkai55 <tangkai55@jd.com>
|
Persistent review updated to latest commit 20cc8d4 |
|
❌ Gradle check result for 20cc8d4: 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 The gradle-check failed on the unrelated arrow-flight-rpc plugin test, which is a flaky test unrelated to my GCS plugin changes. Could you please re-run the CI for me? Thanks a lot! |
|
Persistent review updated to latest commit 1012319 |
|
❕ Gradle check result for 1012319: 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. |
…for GCS repository (opensearch-project#21122) * Add fips.mode configuration to control truststore check in FIPS mode Signed-off-by: tangkai55 <tangkai55@jd.com> * retry gradle-check Signed-off-by: tangkai55 <tangkai55@jd.com> * Adjust comment for fips.mode to address diff analyzer warning Signed-off-by: tangkai55 <tangkai55@jd.com> * retry gradle-check Signed-off-by: tangkai55 <tangkai55@jd.com> * FIPS mode: update comment for compliance check Signed-off-by: tangkai55 <tangkai55@jd.com> * [GCS] Fix FIPS mode truststore handling by using BCFKS for default Google certificates Replace the previous ad-hoc FIPS bypass switch with a compliant implementation. In FIPS mode, when no custom truststore is configured, the plugin now dynamically creates a FIPS-compliant BCFKS KeyStore and populates it with Google's default trusted certificates. This maintains full FIPS compliance while preserving the out-of-the-box experience without requiring manual truststore configuration or external scripts. Signed-off-by: tangkai55 <tangkai55@jd.com> * Update GCS FIPS unit tests for auto-created BCFKS truststore Adjust FIPS unit tests to reflect no custom truststore requirement in FIPS mode. Remove exception assertion for missing truststore and verify client creation succeeds with automatic BCFKS truststore initialization. Signed-off-by: tangkai55 <tangkai55@jd.com> * Fix spotless formatting issues Signed-off-by: tangkai55 <tangkai55@jd.com> --------- Signed-off-by: tangkai55 <tangkai55@jd.com> Co-authored-by: tangkai55 <tangkai55@jd.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
…for GCS repository (opensearch-project#21122) * Add fips.mode configuration to control truststore check in FIPS mode Signed-off-by: tangkai55 <tangkai55@jd.com> * retry gradle-check Signed-off-by: tangkai55 <tangkai55@jd.com> * Adjust comment for fips.mode to address diff analyzer warning Signed-off-by: tangkai55 <tangkai55@jd.com> * retry gradle-check Signed-off-by: tangkai55 <tangkai55@jd.com> * FIPS mode: update comment for compliance check Signed-off-by: tangkai55 <tangkai55@jd.com> * [GCS] Fix FIPS mode truststore handling by using BCFKS for default Google certificates Replace the previous ad-hoc FIPS bypass switch with a compliant implementation. In FIPS mode, when no custom truststore is configured, the plugin now dynamically creates a FIPS-compliant BCFKS KeyStore and populates it with Google's default trusted certificates. This maintains full FIPS compliance while preserving the out-of-the-box experience without requiring manual truststore configuration or external scripts. Signed-off-by: tangkai55 <tangkai55@jd.com> * Update GCS FIPS unit tests for auto-created BCFKS truststore Adjust FIPS unit tests to reflect no custom truststore requirement in FIPS mode. Remove exception assertion for missing truststore and verify client creation succeeds with automatic BCFKS truststore initialization. Signed-off-by: tangkai55 <tangkai55@jd.com> * Fix spotless formatting issues Signed-off-by: tangkai55 <tangkai55@jd.com> --------- Signed-off-by: tangkai55 <tangkai55@jd.com> Co-authored-by: tangkai55 <tangkai55@jd.com> Co-authored-by: Andriy Redko <drreta@gmail.com>
Description
[GCS] Fix FIPS mode truststore handling without opt-out
This commit removes the previously proposed FIPS bypass switch and implements a compliant solution for default Google certificates in FIPS mode.
When running in FIPS mode (BCFIPS provider active) and no custom truststore is configured:
The existing FIPS conversion scripts provided by OpenSearch are intended for user-managed certificates and JVM trust stores, not for the bundled Google certificates inside the GCS client library. Runtime conversion to BCFKS is the cleanest, most user-friendly approach to maintain out-of-the-box functionality.
This change ensures the GCS plugin works correctly in FIPS mode while adhering to all security requirements.
Related Issues
Fixes #20405