File tree Expand file tree Collapse file tree 4 files changed +47
-7
lines changed Expand file tree Collapse file tree 4 files changed +47
-7
lines changed Original file line number Diff line number Diff line change 17
17
* under the License.
18
18
*/
19
19
20
- subprojects {
21
- /*
22
- * All subprojects are java projects using Elasticsearch's standard build
23
- * tools.
24
- */
25
- apply plugin : ' elasticsearch.build'
20
+ configure( subprojects - project( ' log4j ' )) {
21
+ /*
22
+ * All subprojects are java projects using Elasticsearch's standard build
23
+ * tools.
24
+ */
25
+ apply plugin : ' elasticsearch.build'
26
26
27
27
/*
28
28
* Subprojects may depend on the "core" lib but may not depend on any
Original file line number Diff line number Diff line change
1
+ import org.elasticsearch.gradle.VersionProperties
2
+ import org.elasticsearch.gradle.BuildPlugin
3
+
4
+ plugins {
5
+ id ' base'
6
+ }
7
+
8
+ configurations {
9
+ log4j {
10
+ transitive = false
11
+ }
12
+ }
13
+
14
+ BuildPlugin . configureRepositories(project)
15
+ def log4jVersion = VersionProperties . versions. log4j
16
+ dependencies {
17
+ log4j " org.apache.logging.log4j:log4j-core:${ log4jVersion} "
18
+ }
19
+
20
+ // Strip out JndiLookup class to avoid any possibility of exploitation of CVE-2021-44228
21
+ // See: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
22
+ // See: https://issues.apache.org/jira/browse/LOG4J2-3201
23
+ task patchLog4j (type : Zip ) {
24
+ extension = ' jar'
25
+ baseName = ' log4j-core'
26
+ version = log4jVersion
27
+ from({ zipTree(configurations. log4j. singleFile) }) {
28
+ exclude ' **/JndiLookup.class'
29
+ }
30
+ }
31
+
32
+ artifacts {
33
+ ' default' (patchLog4j)
34
+ }
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ if (!isEclipse) {
72
72
}
73
73
}
74
74
75
+ configurations. all {
76
+ resolutionStrategy. dependencySubstitution {
77
+ substitute module(" org.apache.logging.log4j:log4j-core" ) because " patched to remove JndiLookup class" with project(" :libs:log4j" )
78
+ }
79
+ }
80
+
75
81
dependencies {
76
82
77
83
compile " org.elasticsearch:elasticsearch-core:${ version} "
Original file line number Diff line number Diff line change 1
- 592a48674c926b01a9a747c7831bcd82a9e6d6e4
1
+ fe18be6aecfbf008a8f479397d233dcf089e9643
You can’t perform that action at this time.
0 commit comments