Skip to content

Commit 50914fd

Browse files
Archiit19dbwiddis
andauthored
fix: issue-19148 - bump commons-lang3, bcprov-jdk18on, bouncycastle (#19155)
* fix: security: bump commons-lang3, bcprov-jdk18on, bouncycastle Signed-off-by: Archit Goyal <engg.archit19@gmail.com> * Update SHAs Signed-off-by: Daniel Widdis <widdis@gmail.com> * Bump bc-fips to 2.1.2 and set cleanup delay to 0 to fix tests Signed-off-by: Daniel Widdis <widdis@gmail.com> * Suppress Thread Leak warning on BouncyCastle daemon Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Archit Goyal <engg.archit19@gmail.com> Signed-off-by: Daniel Widdis <widdis@gmail.com> Co-authored-by: Daniel Widdis <widdis@gmail.com>
1 parent c2ac0d2 commit 50914fd

File tree

10 files changed

+39
-4
lines changed

10 files changed

+39
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
- Bump Apache Lucene to 9.12.3 ([#19444](https://github.com/opensearch-project/OpenSearch/pull/19444))
1313
- Bump `commons-beanutils:commons-beanutils` from 1.9.4 to 1.11.0 ([#18401](https://github.com/opensearch-project/OpenSearch/issues/18401))
1414
- Bump `org.apache.poi` version from 5.2.5 to 5.4.1 in /plugins/ingest-attachment ([#17887](https://github.com/opensearch-project/OpenSearch/pull/17887))
15+
- Bump `org.bouncycastle:bc-fips` from 2.0.0 to 2.1.2 ([#19155](https://github.com/opensearch-project/OpenSearch/pull/19155))
16+
- Bump `org.apache.commons:commons-lang3` from 3.14.0 to 3.18.0 ([#19155](https://github.com/opensearch-project/OpenSearch/pull/19155))
17+
- Bump `org.bouncycastle:bcprov-jdk18on` from 1.78 to 1.79 ([#19155](https://github.com/opensearch-project/OpenSearch/pull/19155))
18+
- Bump `org.bouncycastle:bcmail-jdk18on` from 1.78 to 1.79 ([#19155](https://github.com/opensearch-project/OpenSearch/pull/19155))
19+
- Bump `org.bouncycastle:bcpkix-jdk18on` from 1.78 to 1.79 ([#19155](https://github.com/opensearch-project/OpenSearch/pull/19155))
1520
- Bump `org.apache.tika` from 2.9.2 to 3.2.2 ([#19242](https://github.com/opensearch-project/OpenSearch/pull/19242))
1621
- Bump `org.apache.commons:commons-compress` from 1.26.1 to 1.28.0 ([#19125](https://github.com/opensearch-project/OpenSearch/pull/19242))
1722
- Bump `org.apache.commons:commonscodec` from 1.16.1 to 1.18.0 ([#19125](https://github.com/opensearch-project/OpenSearch/pull/19242))

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ gradle.projectsEvaluated {
425425

426426
project.tasks.withType(Test) { task ->
427427
if (task != null) {
428+
// BouncyCastle introduced cleanup daemon with 5-second delay giving thread leak failures
429+
// See https://github.com/opensearch-project/OpenSearch/issues/19238
430+
task.systemProperty('org.bouncycastle.native.cleanup_delay', '0')
431+
428432
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
429433
task.jvmArgs += ["-Djava.security.manager=allow"]
430434
}

distribution/tools/plugin-cli/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
compileOnly project(":server")
3939
compileOnly project(":libs:opensearch-cli")
4040
api "org.bouncycastle:bcpg-fips:2.0.9"
41-
api "org.bouncycastle:bc-fips:2.0.0"
41+
api "org.bouncycastle:bc-fips:2.1.2"
4242
testImplementation project(":test:framework")
4343
testImplementation 'com.google.jimfs:jimfs:1.3.0'
4444
testRuntimeOnly("com.google.guava:guava:${versions.guava}") {

distribution/tools/plugin-cli/licenses/bc-fips-2.0.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
061fbe8383f70489dda95a11a2a4739eb818ff2c

distribution/tools/plugin-cli/src/test/java/org/opensearch/plugins/InstallPluginCommandTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
package org.opensearch.plugins;
3434

3535
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
36+
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
3637

3738
import com.google.common.jimfs.Configuration;
3839
import com.google.common.jimfs.Jimfs;
@@ -71,6 +72,7 @@
7172
import org.opensearch.env.Environment;
7273
import org.opensearch.env.TestEnvironment;
7374
import org.opensearch.semver.SemverRange;
75+
import org.opensearch.test.BouncyCastleThreadFilter;
7476
import org.opensearch.test.OpenSearchTestCase;
7577
import org.opensearch.test.PosixPermissionsResetter;
7678
import org.opensearch.test.VersionUtils;
@@ -134,6 +136,7 @@
134136
import static org.hamcrest.Matchers.startsWith;
135137

136138
@LuceneTestCase.SuppressFileSystems("*")
139+
@ThreadLeakFilters(filters = BouncyCastleThreadFilter.class)
137140
public class InstallPluginCommandTests extends OpenSearchTestCase {
138141

139142
private InstallPluginCommand skipJarHellCommand;

plugins/repository-hdfs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dependencies {
7676
api "org.apache.commons:commons-compress:${versions.commonscompress}"
7777
api 'org.apache.commons:commons-configuration2:2.11.0'
7878
api "commons-io:commons-io:${versions.commonsio}"
79-
api 'org.apache.commons:commons-lang3:3.17.0'
79+
api 'org.apache.commons:commons-lang3:3.18.0'
8080
implementation 'com.google.re2j:re2j:1.8'
8181
api 'javax.servlet:servlet-api:2.5'
8282
api "org.slf4j:slf4j-api:${versions.slf4j}"

plugins/repository-hdfs/licenses/commons-lang3-3.17.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fb14946f0e39748a6571de0635acbe44e7885491
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.test;
10+
11+
import com.carrotsearch.randomizedtesting.ThreadFilter;
12+
13+
/**
14+
* ThreadFilter to exclude ThreadLeak checks for BC’s global background threads
15+
*/
16+
public class BouncyCastleThreadFilter implements ThreadFilter {
17+
@Override
18+
public boolean reject(Thread t) {
19+
String n = t.getName();
20+
// Ignore BC’s global background threads
21+
return "BC Disposal Daemon".equals(n) || "BC Cleanup Executor".equals(n);
22+
}
23+
}

0 commit comments

Comments
 (0)