You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/12/15 20:59:13 UTC
[I] Document Log4j security model (logging-log4j2)
ppkarwasz opened a new issue, #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100
We should document our security model on our [security page](https://logging.apache.org/log4j/2.x/security.html).
An example of such a description is the [Commons Security Model](https://commons.apache.org/security.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "grobmeier (via GitHub)" <gi...@apache.org>.
grobmeier commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858562038
I agree, one security model should match for all logging projects - maybe some extensions are necessary for Flume and Chainsaw
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz closed issue #2100: Document Log4j security model
URL: https://github.com/apache/logging-log4j2/issues/2100
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858567133
This [Commons discussion](https://lists.apache.org/thread/3z4p76oq8g1npvdxpv0zs0j7dqv45c1q) might be interesting.
When the document is ready, we might ask @raboof to proofread it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858593769
The [Securing Tomcat](https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html) page might also help as an example.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "jvz (via GitHub)" <gi...@apache.org>.
jvz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1869806222
Yes, I covered that point in
> Advanced methods of handling configuration (such as a refresh period for the config file, JMX remote management, or other remote methods for updating a config) must be protected by the programmer behind some form of authentication and authorization; it is beyond the scope of this library to hand wave away your identity solution or file permissions.
Though I suppose JMX in general could use a warning about using it properly, especially once it's been extracted into a standalone module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858540085
From the top of my head, our security model should relieve us from any responsibility for:
- CRLF injections if the user uses a line-oriented tool to parse logs,
- other kinds of data corruption if the user uses `PatternLayout` to generate JSON, XML or other structured formats,
Attacks that require access to a configuration file should not be considered vulnerabilities.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "jvz (via GitHub)" <gi...@apache.org>.
jvz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858589557
Some initial thoughts about this:
* Configuration files or configuration code have the ability to execute arbitrary code by using custom plugins; as such, configurations must be controlled by the programmer, not arbitrary users.
* Log message parameters are not evaluated for any sort of template strings like `{}`; template strings are limited to the non-parameter message argument. As such, log message parameters are not treated specially (such as with a prepared statement in SQL). When structure-preserving encoding is desired for things besides the log message as a whole, the `Message` API should be used for logging structured data rather than strings.
* Unstructured layouts shouldn't be used if any user-controlled data can be logged through them; this largely includes logging exceptions if said exceptions can contain user input (which is a common use case for exceptions).
* Code signing and verification is only performed at the artifact level (i.e., our jars, zips, and tarballs); we do not rely on jar signing to validate plugins or extensions (unlike, say, the Java cryptography APIs which require signed jars typically).
* Given the equivalence to the halting problem, we cannot generically support any form of log masking for sensitive data. While external plugins may support limited forms of masking (e.g., for credit card numbers or similar easily identifiable byte patterns), it is up to the programmer to explicitly mark sensitive data for masking.
* While the project goes to great lengths to minimize performance overhead along with options for minimizing latency or maximizing throughput, we cannot guarantee absolute availability of the system when using synchronous logging. If your application is writing log data faster than it can store it to disk, synchronous logging will affect the availability of your application. Using asynchronous logging can help to an extent here, though we do not support back pressure signals (this might be a patches welcome area; not sure if we need to define this in the security model).
* We do not support running in a Java `SecurityManager`; this API is being removed from Java anyways.
* Configurations can read system properties, environment variables, arguments to the main program, and any other data sources made available via `StrLookup` plugins (which includes some HTTP-related data if you use the `WebLookup` plugin).
Then we have some bits that are specific to various systems:
* When using JNDI for configuration files (as in a JavaEE/JakartaEE application server) or for use with dependency injection of shared server resources (such as JMS connection pools, JDBC connection pools, etc.), only the `java` scheme is supported. We do not support nor recommend use of other JNDI providers that interact with potentially untrusted remote data sources due to the weak security model of JNDI itself. Yes, that means we don't support LDAP, RMI, DNS, or any other `Context` providers.
* When using an unstructured layout, we cannot guarantee that user input cannot interfere with the output of the formatted log message. Within the pattern layout plugin specifically, we do offer various encoding methods to help address this for different use cases (such as encoding or escaping new lines or other special characters used in various formats), but they're all opt-in.
* When using a structured layout such as JsonTemplateLayout, XML, etc., log message input data is encoded appropriately to the target layout (e.g., a log message containing XML data will be properly escaped inside an XML layout).
* Advanced methods of handling configuration (such as a refresh period for the config file, JMX remote management, or other remote methods for updating a config) must be protected by the programmer behind some form of authentication and authorization; it is beyond the scope of this library to hand wave away your identity solution or file permissions.
* Use of string lookup plugins that can reference user-controlled data should not be used with unstructured layouts
* Use of PatternLayout is more of a developer convenience than a production-quality layout that can be reliably parsed by log collectors or other derivative systems. In that sense, any inline JSON, whitespace, XML, etc., are not treated differently as pattern layouts are fairly arbitrary. When a reliable format is needed for parsing the output of logs, a structured layout should be used.
* Any form of encryption or signatures used on log data directly from the library must use a proper key management system. Use of cryptography anywhere requires a properly designed key management system, and any plugins or extensions that offer to do so using a single static key (symmetric or asymmetric) are likely broken beyond repair.
* When using compression, if logs can contain user input, then the compressed log output must not be viewable directly or indirectly by the user if said logs are supposed to be private. This relates to the [CRIME attack](https://en.wikipedia.org/wiki/CRIME) which affects older versions of TLS.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Document Log4j security model (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #2100:
URL: https://github.com/apache/logging-log4j2/issues/2100#issuecomment-1858536271
@rm5248, @swebb2066, @fluffynuts and @grobmeier: maybe this could be a document shared by all the projects?
The security risks seems pretty much similar to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org