Skip to content
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

Missing headers, hostname and syslog tag validation can cause data to be ommited #10

Open
JPvRiel opened this issue Nov 16, 2022 · 0 comments

Comments

@JPvRiel
Copy link
Owner

JPvRiel commented Nov 16, 2022

When metadata processing is enabled and the advanced (now overly complicated) configuration applies a lot of conditionals and tricks to check if the syslog RFC3164 parser had to deal with a message that hasn't got a proper header. If it seems the message lacks a header, it will distrust the header properties the RFC 3164 parser module set. This helps avoid getting junk populated in as hostnames or app-names. From production experience, vulnerability scanners and Cisco network devices can cause a lot of bogus data to show up in the $hostname or $app-name properties.

While extra work is done to try remap or validate the properties, in certain circumstances, the $msg property used in templates will not include the distrusted content rsyslog found as part of the assumed syslogtag. Output templates using $msg will then possibly miss parts of the original message. Templates that include the $rawmsg property don't have to worry as much about this issue, e.g. TmplJSONRawMsg, but other templates, such as TmplRFC5424EndMetaShort might cut out "misinterpreted" pieces at the start of the message when it gets forwarded.

In 60-ruleset.conf.tmpl, there has been this placeholder:

      # If we wanted to correct a misaligned $msg due to a bad header... Failing to do this may swallow part of the malformed message where the parsed values were untrusted and discarded.
      #set $.msg = $rawmsg-after-pri;

However, it's performance impact could be significant and this hasn't been tested, so for now, it's left as a known concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant