apache / apache/logging-log4j2

Implement uniform password "encryption/decryption" mechanism

Open
#2,558 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

Many of Log4j components require a password attribute (e.g. `SslConfiguration`, `JdbcAppender`, etc.), but only [`BasicAuthorizationProvider`](https://logging.apache.org/log4j/2.x/javadoc/log4j-core/org/apache/logging/log4j/core/util/BasicAuthorizationProvider) uses a pluggable [`PasswordDecryptor`](https://logging.apache.org/log4j/2.x/javadoc/log4j-core/org/apache/logging/log4j/core/util/PasswordDecryptor) service to interpret the meaning of the password field.

I would propose to extend the usage of this service to all password fields and provide two implementations of `PasswordDecryptor`:

* one implementation that interprets the "password" as the path to a file that contains the password,
* one implementation that interprets the "password" as the name of an environment variable that contains the password.

This would allow us to deprecate configuration properties such as `log4j2.keyStorePasswordFile` and `log4j2.keyStorePasswordEnvironmentVariable`.

**Disclaimer**: I am fully aware that a real password encryption/decryption mechanism doesn't make sense, since configuration sources must be trusted anyway and I totally agree with the remarks about password encryption on [Tomcat's Wiki](https://cwiki.apache.org/confluence/display/TOMCAT/Password).

However some auditors and analysis tools might have problems with plain text passwords in configuration files and this feature will allow users to provide their own workarounds.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.