Skip to content

Commit

Permalink
Log4j security patch v2.2 (#1038)
Browse files Browse the repository at this point in the history
* update dependencies

* update readme

* remove whitelisting of the value of InetAddress.getLocalHost().getHostAddress()
  • Loading branch information
bennsimon authored Dec 16, 2021
1 parent 4c93c9a commit 92de93f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ The metrics endpoint of the opensrp server is `/opensrp/metrics`. It returns inf
The endpoint is only accessible through the following ips when unauthenticated but requires authentication for the any other ips:

* `127.0.0.1`,
* `InetAddress.getLocalHost().getHostAddress()`,
* One additional configurable ip, kindly check below `metrics.additional_ip_allowed`

Sample responses from the metrics endpoint are as follows:
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>opensrp-server-web</artifactId>
<packaging>war</packaging>
<version>2.8.39-SNAPSHOT</version>
<version>2.8.40-SNAPSHOT</version>
<name>opensrp-server-web</name>
<description>OpenSRP Server Web Application</description>
<url>https://github.com/OpenSRP/opensrp-server-web</url>
Expand All @@ -25,8 +25,8 @@
<redis.lettuce.version>5.2.2.RELEASE</redis.lettuce.version>
<opensrp.updatePolicy>always</opensrp.updatePolicy>
<nexus-staging-maven-plugin.version>1.5.1</nexus-staging-maven-plugin.version>
<opensrp.core.version>2.12.18-SNAPSHOT</opensrp.core.version>
<opensrp.connector.version>2.3.2-SNAPSHOT</opensrp.connector.version>
<opensrp.core.version>2.12.19-SNAPSHOT</opensrp.core.version>
<opensrp.connector.version>2.3.3-SNAPSHOT</opensrp.connector.version>
<opensrp.interface.version>2.0.1-SNAPSHOT</opensrp.interface.version>
<opensrp.common.version>2.0.3-SNAPSHOT</opensrp.common.version>
<powermock.version>2.0.5</powermock.version>
Expand Down Expand Up @@ -386,7 +386,7 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-log4j2</artifactId>
<version>4.3.0</version>
<version>5.5.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/io.lettuce/lettuce-core -->
Expand All @@ -413,17 +413,17 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.7.5</version>
<version>1.8.1</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ protected void configure(HttpSecurity http) throws Exception {
.access(metricsPermitAll ? "permitAll()" :
" ( isAuthenticated()"
+ " or hasIpAddress('127.0.0.1') "
+ " or hasIpAddress('"+ InetAddress.getLocalHost().getHostAddress() +"') "
+ (StringUtils.isBlank(metricsAdditionalIpAllowed) ? "" : String.format(" or hasIpAddress('%s')",metricsAdditionalIpAllowed)) + ")")
.mvcMatchers("/").permitAll()
.mvcMatchers("/logout.do").permitAll()
Expand Down

0 comments on commit 92de93f

Please sign in to comment.