Skip to content

Commit 20c58b9

Browse files
committed
Added plug-in configuration for avoiding any usages of outdated log4j2 versions,
some of which are subject to the RCE CVE-2021-44228 ("Log4Shell") and CVE-2021-45046 From https://gist.github.com/gunnarmorling/8026d004776313ebfc65674202134e6d/899f13f64324ff80620684d77486c71fad18ec77
1 parent 99f2af3 commit 20c58b9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,30 @@
127127
<groupId>org.springframework.boot</groupId>
128128
<artifactId>spring-boot-maven-plugin</artifactId>
129129
</plugin>
130+
<plugin>
131+
<groupId>org.apache.maven.plugins</groupId>
132+
<artifactId>maven-enforcer-plugin</artifactId>
133+
<version>3.0.0</version>
134+
<executions>
135+
<execution>
136+
<id>ban-bad-log4j-versions</id>
137+
<phase>validate</phase>
138+
<goals>
139+
<goal>enforce</goal>
140+
</goals>
141+
<configuration>
142+
<rules>
143+
<bannedDependencies>
144+
<excludes combine.children="append">
145+
<exclude>org.apache.logging.log4j:log4j-core:(,2.16.0)</exclude>
146+
</excludes>
147+
</bannedDependencies>
148+
</rules>
149+
<fail>true</fail>
150+
</configuration>
151+
</execution>
152+
</executions>
153+
</plugin>
130154
</plugins>
131155
</build>
132156

0 commit comments

Comments
 (0)