-
Notifications
You must be signed in to change notification settings - Fork 173
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
Wrong format of the syslog messages #230
Comments
@thl-cmk Would you comment some implementations which cannot parse current syslog? AFAIK, most log management or siem products have regex or grok configurations for syslog parsing. I agree with your opinion that it's worth complying with the RFC, but most security devices use pri header only. I saw 100+ log formats over 15 years as a SIEM developer.. |
@xeraph At the moment I am only awere of one specific syslog implementation, it's CHECKMK, the monitoring system where I am integrating your scanner with. There is some automatic stuff going on begore one can access the massage (for futher filtering) and in this process the message is broken. Looks like this A second implementation, that expects an RFC conform syslog message is filebeat for Elasticsearch or Logstash. This also expects rfc3164 or rfc5424 messages. https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-syslog.html |
@thl-cmk Would you test v2.7.0? Use |
@xeraph Great work :-) I certainly will test it. I was in the process of closing this, as after more digging the issue with the syslog implementaion of CHECKMK is not only because of the non rfc5424 formating. Guess I have to check this with the tribe29 guys anyway :-( and now I will test all the new options :-) |
I think ther is still a little issue with the rfc5424 formating, At the moment I guess the app name sould be so this needs to be changed into |
That is exactly what I intended :) |
Ok, and process-id should be LOG4J2-SCAN? At the moment the Skipping broken jar messages are all gone in syslog, is this also intended? |
Yes. Process name RFC5424 6.2.6
If CVE-2021-44228-Scanner/src/main/java/com/logpresso/scanner/LogGenerator.java Lines 144 to 157 in 8ca2110
|
Oops.. I found typo from attached image.. I will fix it later.. |
this is specified but i recive no debug messages :-( Scanned 68698 directories and 389080 files and the corosponding output from the tcpdump on the syslog side ` only the MITIGATED messge is send, the |
Oh.. callback invocation is missing. I will fix it in 30min.. |
very nice working with you 👍 |
works again. Perfect! |
@thl-cmk Would you test v2.7.1? |
@thl-cmk You were ahead.. good! |
@xeraph I think this can be cosed :-) (your typo is also gone) |
Your syslog message looks at the moment like this
<133>{"time": "2022-01-01 19:35:25+0100", "hostname": "checkmk", "path": "/usr/bin/pycharm/pycharm-community-2021.1.3/lib/log4j.jar", "entry": "", "product": "Log4j 1", "version": "1.2.17.2", "cve": "CVE-2021-4104", "status": "MITIGATED", "fixed": false}
Acording to RFC5424 the header (the stuff before the STRUCTURED-DATA/MESSAGE) should look like this
PRI VERSION SP TIMESTAMP SP HOSTNAME SP APP-NAME SP PROCID SP MSGID
followed by
SP STRUCTURED-DATA [SP MSG]
(structured data must always be encoded in UTF-8). If theMESSAGE
is UTF-8 encoded it must start with the BOM (BOM = %xEF.BB.BF).You are using only the PRI (Facility/Severity) field (
<133>
) and the Message. This causes problems with some syslog implementations as the expect the message to be like in the RFC.If you want to skip optional fileds you can use the NILVALUE (
-
).So your syslog message should look at least like this
<133> 1 - - - - - - {your message}
It would be nice to have the TIMESTAMP, HOSTNAME and APP-NAME populated like this (skipped PROCID, MSGID and STRUCTURED-DATA)
<133> 1 2022-01-01T23:20:50.52Z CHECKMK LOG4J-SCANNER - - - {your message}
The text was updated successfully, but these errors were encountered: