-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.8] Patch log4j JAR to remove JndiLookup class (#81632)
- Loading branch information
1 parent
416629f
commit 403e8db
Showing
4 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import org.elasticsearch.gradle.VersionProperties | ||
import org.elasticsearch.gradle.BuildPlugin | ||
|
||
plugins { | ||
id 'base' | ||
} | ||
|
||
configurations { | ||
log4j { | ||
transitive = false | ||
} | ||
} | ||
|
||
BuildPlugin.configureRepositories(project) | ||
def log4jVersion = VersionProperties.versions.log4j | ||
dependencies { | ||
log4j "org.apache.logging.log4j:log4j-core:${log4jVersion}" | ||
} | ||
|
||
// 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 | ||
task patchLog4j(type: Zip) { | ||
extension = 'jar' | ||
baseName = 'log4j-core' | ||
version = log4jVersion | ||
from({ zipTree(configurations.log4j.singleFile) }) { | ||
exclude '**/JndiLookup.class' | ||
} | ||
} | ||
|
||
artifacts { | ||
'default'(patchLog4j) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
592a48674c926b01a9a747c7831bcd82a9e6d6e4 | ||
fe18be6aecfbf008a8f479397d233dcf089e9643 |