Coder Social home page Coder Social logo

Comments (9)

jmanico avatar jmanico commented on May 29, 2024

from owasp-java-encoder.

jeremylong avatar jeremylong commented on May 29, 2024

Consider logging to a structured format such as JSON - then standard JSON encoding would be sufficient. Logging to JSON is often a good choice.

from owasp-java-encoder.

augustd avatar augustd commented on May 29, 2024

Hi @katyanton, The OWASP Security Logging Project includes an encoder for Logback, but for Log4J we recommend using the built-in encoder:

https://github.com/javabeanz/owasp-security-logging/wiki/Log-Forging

from owasp-java-encoder.

katyanton avatar katyanton commented on May 29, 2024

Hi @augustd - I'm aware of the encoding for Log4J, but this is available only in version 2, not version 1.

from owasp-java-encoder.

jmanico avatar jmanico commented on May 29, 2024

from owasp-java-encoder.

katyanton avatar katyanton commented on May 29, 2024

Hi @jeremylong - I hear what you're saying and makes sense.
The corresponding method in OWASP Encoder would be encode#forJavaScriptSource(String) .
It would be a bit counter intuitive for a developer to know to use that method though.

from owasp-java-encoder.

augustd avatar augustd commented on May 29, 2024

Unfortunately Log4J version 1 is somewhat lacking in the extensibility department (most of the classes are actually final). Is that a hard requirement? Ideally you should be moving towards Log4J2 -you will get many more features and better performance. Otherwise feel free to submit a feature request at OWASP Security Logging and we can look into adding an encoder for version 1.

For ESAPI I actually created a whole wrapper for the Log4JLogger which does the encoding, but then you have to use ESAPI's API, not Log4J's.

from owasp-java-encoder.

xeno6696 avatar xeno6696 commented on May 29, 2024

from owasp-java-encoder.

jmanico avatar jmanico commented on May 29, 2024

We politely do not think this library is the right place for logging functions. Please consider the OWASP Logging project for this request!

from owasp-java-encoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.