mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Patch log4j JAR to remove JndiLookup class (#81629)
This commit is contained in:
parent
ef64808caf
commit
9a3422e1a6
3 changed files with 33 additions and 1 deletions
|
@ -275,6 +275,10 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
all {
|
||||||
|
resolutionStrategy.dependencySubstitution {
|
||||||
|
substitute module("org.apache.logging.log4j:log4j-core") using project(":libs:elasticsearch-log4j") because "patched to remove JndiLookup clas"}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
subprojects {
|
configure(subprojects - project('elasticsearch-log4j')) {
|
||||||
/*
|
/*
|
||||||
* All subprojects are java projects using Elasticsearch's standard build
|
* All subprojects are java projects using Elasticsearch's standard build
|
||||||
* tools.
|
* tools.
|
||||||
|
|
28
libs/log4j/build.gradle
Normal file
28
libs/log4j/build.gradle
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
plugins {
|
||||||
|
id 'base'
|
||||||
|
id 'elasticsearch.repositories'
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
log4j {
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
log4j "org.apache.logging.log4j:log4j-core:${versions.log4j}"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Strip out JndiLookup class to avoid any possibility of exploitation of CVE-2021-44228
|
||||||
|
// See: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
|
||||||
|
// See: https://issues.apache.org/jira/browse/LOG4J2-3201
|
||||||
|
def patchLog4j = tasks.register('patchLog4j', Zip) {
|
||||||
|
archiveExtension = 'jar'
|
||||||
|
from({ zipTree(configurations.log4j.singleFile) }) {
|
||||||
|
exclude '**/JndiLookup.class'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
'default'(patchLog4j)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue