diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 41c87dc9f69..8eead8eeeab 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -45,5 +45,5 @@ jobs: - name: publish snapshots to maven run: | cd notifications/ - ./gradlew publishPluginZipPublicationToSnapshotsRepository + ./gradlew publishPluginZipPublicationToSnapshotsRepository "-Pcrypto.standard=FIPS-140-3" diff --git a/.github/workflows/notifications-test-and-build-workflow.yml b/.github/workflows/notifications-test-and-build-workflow.yml index 1480567ec86..2a834ae08b6 100644 --- a/.github/workflows/notifications-test-and-build-workflow.yml +++ b/.github/workflows/notifications-test-and-build-workflow.yml @@ -52,7 +52,7 @@ jobs: run: | chown -R 1000:1000 `pwd` cd notifications - su `id -un 1000` -c "./gradlew build" + su `id -un 1000` -c "./gradlew build \"-Pcrypto.standard=FIPS-140-3\"" - name: Upload coverage uses: codecov/codecov-action@v1 @@ -123,7 +123,7 @@ jobs: working-directory: ${{ env.WORKING_DIR }} run: | cd notifications - ./gradlew build ${{ env.BUILD_ARGS }} + ./gradlew build ${{ env.BUILD_ARGS }} "-Pcrypto.standard=FIPS-140-3" env: _JAVA_OPTIONS: ${{ matrix.os_java_options }} diff --git a/.github/workflows/security-notifications-test-workflow.yml b/.github/workflows/security-notifications-test-workflow.yml index 29cfc289f6f..b73df893d85 100644 --- a/.github/workflows/security-notifications-test-workflow.yml +++ b/.github/workflows/security-notifications-test-workflow.yml @@ -46,7 +46,7 @@ jobs: run: | cd notifications chown -R 1000:1000 `pwd` - su `id -un 1000` -c "./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*IT'" + su `id -un 1000` -c "./gradlew integTest \"-Pcrypto.standard=FIPS-140-3\" -Dsecurity=true -Dhttps=true --tests '*IT'" - name: Upload failed logs uses: actions/upload-artifact@v4 diff --git a/notifications/notifications/build.gradle b/notifications/notifications/build.gradle index 65ecfb770d8..6cd94a0ae76 100644 --- a/notifications/notifications/build.gradle +++ b/notifications/notifications/build.gradle @@ -17,6 +17,7 @@ import javax.net.ssl.SSLContext import javax.net.ssl.SSLSession import javax.net.ssl.TrustManager import javax.net.ssl.X509TrustManager +import org.opensearch.gradle.info.FipsBuildParams import org.opensearch.gradle.test.RestIntegTestTask import org.opensearch.gradle.testclusters.OpenSearchCluster import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -117,8 +118,11 @@ configurations.testImplementation { exclude module: "securemock" } -configurations.testRuntimeClasspath { - exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' +// When building with -Pcrypto.standard=FIPS-140-3, bcprov is provided by OpenSearch +if (FipsBuildParams.isInFipsMode()) { + configurations.all { + exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' + } } configurations.all {