Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JndiLookup class from shaded jar #621

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

leonardehrenfried
Copy link
Contributor

As per the recommendation by the log4j security team, removing the class is the best way to move forward: https://logging.apache.org/log4j/2.x/security.html

This filters out the class when building the shaded jar.

Before

zipinfo -1 target/photon-0.3.5.jar | grep Jndi
org/apache/logging/log4j/core/lookup/JndiLookup.class
org/apache/logging/log4j/core/net/JndiManager.class
org/apache/logging/log4j/core/net/JndiManager$JndiManagerFactory.class
org/apache/logging/log4j/core/selector/JndiContextSelector.class
org/apache/logging/log4j/core/net/JndiManager$1.class
org/apache/logging/log4j/core/util/JndiCloser.class
org/springframework/jdbc/datasource/lookup/JndiDataSourceLookup.class

After

zipinfo -1 target/photon-0.3.5.jar | grep Jndi
org/apache/logging/log4j/core/net/JndiManager.class
org/apache/logging/log4j/core/net/JndiManager$JndiManagerFactory.class
org/apache/logging/log4j/core/selector/JndiContextSelector.class
org/apache/logging/log4j/core/net/JndiManager$1.class
org/apache/logging/log4j/core/util/JndiCloser.class
org/springframework/jdbc/datasource/lookup/JndiDataSourceLookup.class

What this doesn't protect against is when someone doesn't use the compiled jar file, for example when doing local development.

Relates to #620

cc @hbruch

@lonvia lonvia merged commit 4343b9f into komoot:master Dec 13, 2021
@lonvia
Copy link
Collaborator

lonvia commented Dec 13, 2021

Many thanks.

@leonardehrenfried leonardehrenfried deleted the remove-jndi-lookup branch December 13, 2021 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants