Skip to content

Commit

Permalink
Update README.adoc (#13)
Browse files Browse the repository at this point in the history
added contributing guidelines and turned a list into a table
  • Loading branch information
ronja-ui authored Jan 23, 2024
1 parent 7ed8312 commit 4485df9
Showing 1 changed file with 69 additions and 38 deletions.
107 changes: 69 additions & 38 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
:opening-bracket: [
:closing-bracket: ]
# Log4j RELP Plugin
[![Build Status](https://scan.coverity.com/projects/23199/badge.svg)](https://scan.coverity.com/projects/jla_05)
= Log4j RELP Plugin

image::https://scan.coverity.com/projects/23199/badge.svg[Build Status, link="https://scan.coverity.com/projects/jla_05"]

Creates Log4j appender that uses RELP to ensure no events are lost.

See link:https://github.com/teragrep/jla_05/blob/master/src/main/resources/log4j.example.properties[log4j.example.properties] for example config
See https://github.com/teragrep/jla_05/blob/master/src/main/resources/log4j.example.properties[log4j.example.properties] for example config

== Please note

## Please note
Please note that regarding log4j version 1.2.17 following vulnerabilities exist and we recommend not to use these features:

https://nvd.nist.gov/vuln/detail/CVE-2020-9488[{opening-bracket}CVE-2020-9488{closing-bracket}] Improper validation of certificate with host mismatch in Apache Log4j SMTP appender.

https://nvd.nist.gov/vuln/detail/CVE-2019-17571[{opening-bracket}CVE-2019-17571{closing-bracket}] Included in Log4j 1.2 is a SocketServer class that is vulnerable to deserialization of untrusted data which can be exploited to remotely execute arbitrary code when combined with a deserialization gadget when listening to untrusted network traffic for log data.

## Property explanations
* log4j.appender.RELPAPPENDER.relpAddress
** Connection destination address
* log4j.appender.RELPAPPENDER.relpPort
** Connection destination port
* log4j.appender.RELPAPPENDER.appName
** Stream application identifier. Maximum length of 48 characters, limited by RFC5424
* log4j.appender.RELPAPPENDER.hostname
** Stream host identifier. Maximum length of 255 characters, limited by RFC5424
* log4j.appender.RELPAPPENDER.connectionTimeout
** Time to wait before timing out connection
* log4j.appender.RELPAPPENDER.writeTimeout
** Time to wait for destination to accept data
* log4j.appender.RELPAPPENDER.readTimeout
** Time to wait for destination to acknowledge sent data (low values cause duplicates)
* log4j.appender.RELPAPPENDER.reconnectInterval
** Time to wait between re-connection attempts
* log4j.appender.RELPAPPENDER.useSD
** Enables structured data containing uuid and source information

## Usage
* https://nvd.nist.gov/vuln/detail/CVE-2020-9488[CVE-2020-9488] Improper validation of certificate with host mismatch in Apache Log4j SMTP appender.
* https://nvd.nist.gov/vuln/detail/CVE-2019-17571[CVE-2019-17571] Included in Log4j 1.2 is a SocketServer class that is vulnerable to deserialization of untrusted data which can be exploited to remotely execute arbitrary code when combined with a deserialization gadget when listening to untrusted network traffic for log data.

== Property explanations

|===
|Property |Description

|log4j.appender.RELPAPPENDER.relpAddress
|Connection destination address

|log4j.appender.RELPAPPENDER.relpPort
|Connection destination port

|log4j.appender.RELPAPPENDER.appName
|Stream application identifier. Maximum length of 48 characters, limited by RFC5424

|log4j.appender.RELPAPPENDER.hostname
|Stream host identifier. Maximum length of 255 characters, limited by RFC5424

|log4j.appender.RELPAPPENDER.connectionTimeout
|Time to wait before timing out connection

|log4j.appender.RELPAPPENDER.writeTimeout
|Time to wait for destination to accept data

|log4j.appender.RELPAPPENDER.readTimeout
|Time to wait for destination to acknowledge sent data (low values cause duplicates)

|log4j.appender.RELPAPPENDER.reconnectInterval
|Time to wait between re-connection attempts

|log4j.appender.RELPAPPENDER.useSD
|Enables structured data containing uuid and source information
|===

== Usage

Pass log4j.properties file as property

Expand All @@ -53,7 +65,7 @@ logger.trace("Trace message");
LogManager.shutdown();
```

## Maven dependency definition
== Maven dependency definition

```
<dependency>
Expand All @@ -63,18 +75,37 @@ LogManager.shutdown();
</dependency>
```

## Configuring pre-built log4j application
== Configuring pre-built log4j application

First download wanted versions of jla_05, rlp_01 and rlo_14 from the following urls:

https://search.maven.org/artifact/com.teragrep/jla_05[jla_05]

https://search.maven.org/artifact/com.teragrep/rlp_01[rlp_01]

https://search.maven.org/artifact/com.teragrep/rlo_14[rlo_14]
* https://search.maven.org/artifact/com.teragrep/jla_05[jla_05]
* https://search.maven.org/artifact/com.teragrep/rlp_01[rlp_01]
* https://search.maven.org/artifact/com.teragrep/rlo_14[rlo_14]

Then run java while pointing classpath to the directory where you downloaded the jars to like:

```
java -cp "path/to/downloaded/jars/*:target/example.jar" com.teragrep.example.Main
```

== Contributing

// Change the repository name in the issues link to match with your project's name

You can involve yourself with our project by https://github.com/teragrep/jla_05/issues/new/choose[opening an issue] or submitting a pull request.

Contribution requirements:

. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.
. Security checks must pass
. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.
. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).

Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].

=== Contributor License Agreement

Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.

You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.

0 comments on commit 4485df9

Please sign in to comment.