build.gradle 629 B

12345678910111213141516171819202122232425262728
  1. plugins {
  2. id 'base'
  3. id 'elasticsearch.repositories'
  4. }
  5. configurations {
  6. log4j {
  7. transitive = false
  8. }
  9. }
  10. dependencies {
  11. log4j "org.apache.logging.log4j:log4j-core:${versions.log4j}"
  12. }
  13. // Strip out JndiLookup class to avoid any possibility of exploitation of CVE-2021-44228
  14. // See: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
  15. // See: https://issues.apache.org/jira/browse/LOG4J2-3201
  16. def patchLog4j = tasks.register('patchLog4j', Zip) {
  17. archiveExtension = 'jar'
  18. from({ zipTree(configurations.log4j.singleFile) }) {
  19. exclude '**/JndiLookup.class'
  20. }
  21. }
  22. artifacts {
  23. 'default'(patchLog4j)
  24. }