forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
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 (elastic#81629)
- Loading branch information
1 parent
ef64808
commit 9a3422e
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) | ||
} |