-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch log4j JAR to remove JndiLookup class (#81631)
- Loading branch information
1 parent
cdc5ae4
commit 5b38441
Showing
3 changed files
with
33 additions
and
1 deletion.
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
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,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) | ||
} |
5b38441
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm, why didnt you just bump to the latest Log4j version , it works fine and prevents this from showing up on a security scan