Skip to content

Commit

Permalink
Remove old ES libraries used in reindex due to CVEs (#1359) (#1497)
Browse files Browse the repository at this point in the history
This commit removes old ES libraries version 090 and 176 due to CVE

Signed-off-by: Xue Zhou <[email protected]>
  • Loading branch information
xuezhou25 authored Nov 2, 2021
1 parent 77efa2d commit 984eb34
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 242 deletions.
85 changes: 0 additions & 85 deletions modules/reindex/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,88 +92,3 @@ forbiddenPatterns {
exclude '**/*.p12'
}

// Support for testing reindex-from-remote against old Elasticsearch versions
configurations {
oldesFixture
es2
es1
es090
}

dependencies {
oldesFixture project(':test:fixtures:old-elasticsearch')
/* Right now we just test against the latest version of each major we expect
* reindex-from-remote to work against. We could randomize the versions but
* that doesn't seem worth it at this point. */
es2 'org.elasticsearch.distribution.zip:elasticsearch:2.4.5@zip'
es1 'org.elasticsearch:elasticsearch:1.7.6@zip'
es090 'org.elasticsearch:elasticsearch:0.90.13@zip'
}

jdks {
legacy {
vendor = 'adoptopenjdk'
version = '8u242+b08'
platform = OS.current().name().toLowerCase()
architecture = Architecture.current().name().toLowerCase()
}
}

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
logger.warn("Disabling reindex-from-old tests because we can't get the pid file on windows")
javaRestTest {
systemProperty "tests.fromOld", "false"
}
} else if (rootProject.rootDir.toString().contains(" ")) {
logger.warn("Disabling reindex-from-old tests because Elasticsearch 1.7 won't start with spaces in the path")
javaRestTest {
systemProperty "tests.fromOld", "false"
}
} else {
/* Set up tasks to unzip and run the old versions of ES before running the
* integration tests. */
def versions = ['2', '1', '090']
if (Os.isFamily(Os.FAMILY_MAC)) {
// 0.90 fails sometimes on mac, given that it is so old, let us disable it
// see: https://github.com/elastic/elasticsearch/issues/51202
versions = ['2', '1']
}
for (String version : versions) {
Task unzip = task("unzipEs${version}", type: Sync) {
Configuration oldEsDependency = configurations['es' + version]
dependsOn oldEsDependency
/* Use a closure here to delay resolution of the dependency until we need
* it */
from {
oldEsDependency.collect { zipTree(it) }
}
into temporaryDir
}

Task fixture = task("oldEs${version}Fixture", type: org.opensearch.gradle.test.AntFixture) {
dependsOn project.configurations.oldesFixture, jdks.legacy
dependsOn unzip
executable = "${BuildParams.runtimeJavaHome}/bin/java"
env 'CLASSPATH', "${-> project.configurations.oldesFixture.asPath}"
env 'JAVA_HOME', jdks.legacy.javaHomePath
args 'oldes.OldElasticsearch',
baseDir,
unzip.temporaryDir,
version == '090'
waitCondition = { fixture, ant ->
// the fixture writes the ports file when Elasticsearch's HTTP service
// is ready, so we can just wait for the file to exist
return fixture.portsFile.exists()
}
}

javaRestTest {
dependsOn fixture
systemProperty "tests.fromOld", "true"
/* Use a closure on the string to delay evaluation until right before we
* run the integration tests so that we can be sure that the file is
* ready. */
nonInputProperties.systemProperty "es${version}.port", "${-> fixture.addressAndPort}"
}
}
}

This file was deleted.

0 comments on commit 984eb34

Please sign in to comment.