Skip to content

Make sql plugin aware of FIPS build param (-Pcrypto.standard=FIPS-140-3) - #5155

Merged
peterzhuamazon merged 2 commits into
opensearch-project:mainfrom
cwperks:fips-build-param
Feb 18, 2026
Merged

peterzhuamazon merged 2 commits into
opensearch-project:mainfrom
cwperks:fips-build-param

Conversation

@cwperks

@cwperks cwperks commented Feb 18, 2026 •

Copy link
Copy Markdown
Member

Description

This PR makes the sql plugin aware of the -Pcrypto.standard=FIPS-140-3 build param. When present, it means that any bc (bouncycastle) FIPS jars are provided from the core and available at runtime. When absent, the sql plugin needs to include them in its assembly (i.e. difference between compileOnly and implementation for dependency scope.

Testing:

  1. When core built with ./gradlew localDistro -Pcrypto.standard=FIPS-140-3 but sql plugin is not
➜  ./bin/opensearch-plugin install file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Installing file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Downloading file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
[=================================================] 100%
-> Failed installing file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Rolling back file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Rolled back file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
Exception in thread "main" java.lang.IllegalStateException: failed to load plugin opensearch-sql due to jar hell
	at org.opensearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:779)
	at org.opensearch.plugins.PluginsService.checkJarHellForPlugin(PluginsService.java:404)
	at org.opensearch.tools.cli.plugin.InstallPluginCommand.jarHellCheck(InstallPluginCommand.java:834)
	at org.opensearch.tools.cli.plugin.InstallPluginCommand.loadPluginInfo(InstallPluginCommand.java:811)
	at org.opensearch.tools.cli.plugin.InstallPluginCommand.installPlugin(InstallPluginCommand.java:846)
	at org.opensearch.tools.cli.plugin.InstallPluginCommand.execute(InstallPluginCommand.java:277)
	at org.opensearch.tools.cli.plugin.InstallPluginCommand.execute(InstallPluginCommand.java:251)
	at org.opensearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:110)
	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
	at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
	at org.opensearch.cli.Command.main(Command.java:101)
	at org.opensearch.tools.cli.plugin.PluginCli.main(PluginCli.java:66)
Caused by: java.lang.IllegalStateException: jar hell!
class: META-INF.versions.11.org.bouncycastle.crypto.fips.FipsSecureRandom$Random11Spi
jar1: /Users/cwperx/Projects/opensearch/OpenSearch/build/distribution/local/opensearch-3.6.0-SNAPSHOT/plugins/.installing-12569613205466069468/bc-fips-2.1.2.jar
jar2: /Users/cwperx/Projects/opensearch/OpenSearch/build/distribution/local/opensearch-3.6.0-SNAPSHOT/lib/bc-fips-2.1.2.jar
	at org.opensearch.common.bootstrap.JarHell.checkClass(JarHell.java:316)
	at org.opensearch.common.bootstrap.JarHell.checkJarHell(JarHell.java:215)
	at org.opensearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:777)
	... 12 more
  1. When both core and sql are built with -Pcrypto.standard=FIPS-140-3
➜  ./bin/opensearch-plugin install file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Installing file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
-> Downloading file:/Users/cwperx/Projects/opensearch/sql/plugin/build/distributions/opensearch-sql-3.6.0.0-SNAPSHOT.zip
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.io.FilePermission /Users/cwperx}${/}.aws${/}* read
* java.lang.RuntimePermission *
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission accessUserInformation
* java.lang.RuntimePermission defineClass
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.net.NetPermission getProxySelector
* java.net.SocketPermission * connect,accept,resolve
* java.util.PropertyPermission * read,write
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed opensearch-sql with folder name opensearch-sql
  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Enhancement

Issues Resolved

opensearch-project/opensearch-build#5979

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

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.

@coderabbitai

coderabbitai Bot commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Enhanced build system to support FIPS-140-3 compliance with optimized dependency handling.
    • Improved post-build artifact management and publication workflow.

Walkthrough

Updated build and release scripts to support FIPS-140-3 builds: datasources/build.gradle now conditionally declares the bc-fips dependency based on FIPS mode; scripts/build.sh adds -Pcrypto.standard=FIPS-140-3 to Gradle invocations and copies local Maven staging output into $OUTPUT/maven/org/opensearch.

Changes

Cohort / File(s) Summary
Build configuration
datasources/build.gradle
Added import org.opensearch.gradle.info.FipsBuildParams; changed org.bouncycastle:bc-fips from unconditional implementation to conditional: compileOnly when FipsBuildParams.isInFipsMode(), otherwise implementation. Added explanatory comment about FIPS-140-3.
Build script / publish outputs
scripts/build.sh
Appended -Pcrypto.standard=FIPS-140-3 to assemble, publishToMavenLocal, and publishPluginZipPublicationToZipStagingRepository Gradle calls; ensured $OUTPUT/maven/org/opensearch is created and copied from the local staging repo after publish.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: making the SQL plugin aware of the FIPS build parameter (-Pcrypto.standard=FIPS-140-3), which is the primary objective reflected in both the code changes and PR description.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the FIPS build parameter awareness, the difference between compileOnly and implementation dependency scopes, and providing detailed test scenarios demonstrating the fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@peterzhuamazon peterzhuamazon added the enhancement New feature or request label Feb 18, 2026
Added FIPS-140-3 standard option to Gradle commands.

Signed-off-by: Peter Zhu <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/build.sh (1)

71-81: ⚠️ Potential issue | 🟠 Major

Make the FIPS flag opt‑in to avoid inconsistency with primary CI builds.

The main CI workflows (sql-test-and-build-workflow.yml and maven-publish.yml) build without -Pcrypto.standard=FIPS-140-3, producing standard (non-FIPS) artifacts. Hardcoding this flag in scripts/build.sh creates a different artifact output path that conflicts with the primary build process. Since the script already parameterizes VERSION, SNAPSHOT, and QUALIFIER, the FIPS standard should also be configurable via an environment variable or argument rather than forced.

💡 Suggested opt‑in toggle
+CRYPTO_STANDARD_ARG=""
+if [[ "${CRYPTO_STANDARD:-}" == "FIPS-140-3" ]]; then
+  CRYPTO_STANDARD_ARG="-Pcrypto.standard=FIPS-140-3"
+fi
+
-./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -Pcrypto.standard=FIPS-140-3
+./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER $CRYPTO_STANDARD_ARG
 ...
-./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -Pcrypto.standard=FIPS-140-3
-./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER -Pcrypto.standard=FIPS-140-3
+./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER $CRYPTO_STANDARD_ARG
+./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER $CRYPTO_STANDARD_ARG
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/build.sh` around lines 71 - 81, The script currently hardcodes the
FIPS flag (-Pcrypto.standard=FIPS-140-3) in the gradle invocations (the two
./gradlew calls) which forces FIPS artifacts; make the crypto standard opt-in by
introducing an environment variable (e.g., CRYPTO_STANDARD or ENABLE_FIPS) and
conditionally appending the -Pcrypto.standard=$CRYPTO_STANDARD argument only
when that variable is set (leave VERSION, SNAPSHOT, QUALIFIER usage unchanged);
update the two places that reference -Pcrypto.standard=FIPS-140-3 and any other
gradlew invocations to use the conditional flag so the default CI build behavior
remains non‑FIPS while still allowing opt‑in FIPS builds when the env var is
provided.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@scripts/build.sh`:
- Around line 71-81: The script currently hardcodes the FIPS flag
(-Pcrypto.standard=FIPS-140-3) in the gradle invocations (the two ./gradlew
calls) which forces FIPS artifacts; make the crypto standard opt-in by
introducing an environment variable (e.g., CRYPTO_STANDARD or ENABLE_FIPS) and
conditionally appending the -Pcrypto.standard=$CRYPTO_STANDARD argument only
when that variable is set (leave VERSION, SNAPSHOT, QUALIFIER usage unchanged);
update the two places that reference -Pcrypto.standard=FIPS-140-3 and any other
gradlew invocations to use the conditional flag so the default CI build behavior
remains non‑FIPS while still allowing opt‑in FIPS builds when the env var is
provided.

@peterzhuamazon
peterzhuamazon merged commit 1e3c249 into opensearch-project:main Feb 18, 2026
36 checks passed
qianheng-aws added a commit that referenced this pull request Feb 24, 2026
* Struct return array value instead of string

Signed-off-by: Heng Qian <[email protected]>

* Support filter in GraphLookup

Signed-off-by: Heng Qian <[email protected]>

* Fix IT

Signed-off-by: Heng Qian <[email protected]>

* Add experimental tag in doc

Signed-off-by: Heng Qian <[email protected]>

* Increment version to 3.6.0-SNAPSHOT (#5115)

Signed-off-by: opensearch-ci-bot <[email protected]>
Co-authored-by: opensearch-ci-bot <[email protected]>

* Fix fallback error handling to show original Calcite error (#5133)

* Fix fallback error handling to show original Calcite error

When Calcite falls back to V2 and V2 also fails, now correctly returns the
original Calcite error instead of V2's generic "only supported when calcite
enabled" message, improving error clarity for users. Fixes #5060.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>

* coderabbit: preserve exception types

Signed-off-by: Simeon Widdis <[email protected]>

* Refactoring for coderabbit: consistent handling of calcite and legacy calcite errors

Signed-off-by: Simeon Widdis <[email protected]>

* Update explain error handling to match non-explain

Signed-off-by: Simeon Widdis <[email protected]>

* Minor tweaks: commenting & eval order

Signed-off-by: Simeon Widdis <[email protected]>

* Add a yaml test

Signed-off-by: Simeon Widdis <[email protected]>

---------

Signed-off-by: Simeon Widdis <[email protected]>
Co-authored-by: Claude <[email protected]>

* Add auto-extract mode for `spath` command (#5140)

* Add auto extraction mode in spath command

Signed-off-by: Chen Dai <[email protected]>

* Change json_extract_all to return map<string,string> and fix null perserve issue

Signed-off-by: Chen Dai <[email protected]>

* Refactor all unit test and integration tests

Signed-off-by: Chen Dai <[email protected]>

* Refactor json_extract_all and fix stringify issue

Signed-off-by: Chen Dai <[email protected]>

* Fix broken IT and doctest

Signed-off-by: Chen Dai <[email protected]>

* Address PR comments

Signed-off-by: Chen Dai <[email protected]>

* Mark auto extract mode as experimental

Signed-off-by: Chen Dai <[email protected]>

---------

Signed-off-by: Chen Dai <[email protected]>

* Add nomv command  (#5130)

* Add nomv command + parser/AST/calcite wiring + tests + docs

Signed-off-by: Srikanth Padakanti <[email protected]>

# Conflicts:
#	core/src/main/java/org/opensearch/sql/ast/analysis/FieldResolutionVisitor.java
#	integ-test/src/test/java/org/opensearch/sql/security/CalciteCrossClusterSearchIT.java
#	ppl/src/main/antlr/OpenSearchPPLParser.g4
#	ppl/src/test/java/org/opensearch/sql/ppl/parser/FieldResolutionVisitorTest.java

* Address coderrabbit suggestions.

Signed-off-by: Srikanth Padakanti <[email protected]>

* Correct the no_push_down yaml expected result

Signed-off-by: Srikanth Padakanti <[email protected]>

* Fix Windows CI: Override verifyPPLToSparkSQL to preserve ARRAY_JOIN '\n' delimiter

Signed-off-by: Srikanth Padakanti <[email protected]>

* Fix Windows CI: Override verifyPPLToSparkSQL to preserve ARRAY_JOIN '\n' delimiter

Signed-off-by: Srikanth Padakanti <[email protected]>

* Fix Windows CI: Override verifyPPLToSparkSQL to preserve ARRAY_JOIN '\n' delimiter

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address code review comments

Signed-off-by: Srikanth Padakanti <[email protected]>

---------

Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Srikanth Padakanti <[email protected]>

* Fix #5114: preserve head/TopK semantics for sort-expression pushdown (#5135)

* Fix bug 5114

Signed-off-by: Peng Huo <[email protected]>

* Update

Signed-off-by: Peng Huo <[email protected]>

* Address comments

Signed-off-by: Peng Huo <[email protected]>

* Fix spotless import ordering for EnumerableLimitSort

Signed-off-by: Peng Huo <[email protected]>

---------

Signed-off-by: Peng Huo <[email protected]>

* Fix path navigation on map columns for `spath` command (#5149)

* Fix path navigation bug in qualified name resolver and add spath tests

Signed-off-by: Chen Dai <[email protected]>

* Add spath UT and IT with other commands

Signed-off-by: Chen Dai <[email protected]>

* Move aliasing logic from resolver to project item expansion

Signed-off-by: Chen Dai <[email protected]>

* Update javadoc and readme

Signed-off-by: Chen Dai <[email protected]>

---------

Signed-off-by: Chen Dai <[email protected]>

* Make sql plugin aware of FIPS build param (-Pcrypto.standard=FIPS-140-3) (#5155)

* Make sql plugin aware of FIPS build param (-Pcrypto.standard=FIPS-140-3)

Signed-off-by: Craig Perkins <[email protected]>

* Update build script to include FIPS-140-3 option

Added FIPS-140-3 standard option to Gradle commands.

Signed-off-by: Peter Zhu <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Co-authored-by: Peter Zhu <[email protected]>

* [Maintenance] Fix bc-fips jar hell by marking dependency as compileOnly (#5158)

* [maintenance] Fix bc-fips jar hell by marking dependency as compileOnly

Signed-off-by: Jialiang Liang <[email protected]>

* add fix for tests

Signed-off-by: Jialiang Liang <[email protected]>

---------

Signed-off-by: Jialiang Liang <[email protected]>

* [Feature] PPL Command: MvExpand  (#5144)

* MvExpand new PR - After resolving the merge issues

Signed-off-by: Srikanth Padakanti <[email protected]>

# Conflicts:
#	core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
#	core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java
#	core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java
#	docs/category.json
#	docs/user/ppl/index.md
#	integ-test/src/test/java/org/opensearch/sql/calcite/CalciteNoPushdownIT.java
#	integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java
#	integ-test/src/test/java/org/opensearch/sql/ppl/NewAddedCommandsIT.java
#	integ-test/src/test/java/org/opensearch/sql/security/CalciteCrossClusterSearchIT.java
#	ppl/src/main/antlr/OpenSearchPPLParser.g4
#	ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java
#	ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java
#	ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java

* Address coderrabbit comments

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address coderrabbit comments

Signed-off-by: Srikanth Padakanti <[email protected]>

* merge main to my branch

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address corerabbit suggestions

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address corerabbit suggestions

Signed-off-by: Srikanth Padakanti <[email protected]>

* ci: trigger

Signed-off-by: Srikanth Padakanti <[email protected]>

* ci: trigger

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address corerabbit suggestions

Signed-off-by: Srikanth Padakanti <[email protected]>

* ci: trigger

Signed-off-by: Srikanth Padakanti <[email protected]>

* Address comments.

Signed-off-by: Srikanth Padakanti <[email protected]>

* Change the exception from illegalarg to SyntaxCheckException

Signed-off-by: Srikanth Padakanti <[email protected]>

* change the exception message for consistency

Signed-off-by: Srikanth Padakanti <[email protected]>

* ci: rerun

Signed-off-by: Srikanth Padakanti <[email protected]>

---------

Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Srikanth Padakanti <[email protected]>

* bump antlr version to 4.13.2 (#5159)

* Address comments

Signed-off-by: Heng Qian <[email protected]>

---------

Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: opensearch-ci-bot <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Signed-off-by: Peng Huo <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Jialiang Liang <[email protected]>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: opensearch-ci-bot <[email protected]>
Co-authored-by: Simeon Widdis <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Chen Dai <[email protected]>
Co-authored-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Peng Huo <[email protected]>
Co-authored-by: Craig Perkins <[email protected]>
Co-authored-by: Peter Zhu <[email protected]>
Co-authored-by: Jialiang Liang <[email protected]>
Co-authored-by: Eric Wei <[email protected]>
@Swiddis Swiddis mentioned this pull request Apr 1, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants