How to set up rsyslog to handle Vault Syslog
93
Created On 11/10/26 11:03 AM - Last Modified 11/10/26 12:58 PM
Objective
When rsyslog receives a message, it parses it into an internal 'msg' field, which is what is logged to file by default:
https://www.rsyslog.com/doc/v8-stable/configuration/properties.html#message-properties
The issue with this format is that it manipulates Idira logs in a bad way, breaking the format and thus invalidating regex written to parse these messages.
You can see the correct message format here:
2019-05-28T14:17:02Z WIN2016-TEMPLATE CEF:0|Cyber-Ark|Vault|10.6.0000|51|Retrieve File|5|act="Retrieve File" suser=PasswordManager fname=Root\Policies\Policy-WinDomTest.ini dvc= shost=XXXX dhost= duser= externalId= app= reason= cs1Label="Affected User Name" cs1= cs2Label="Safe Name" cs2="PasswordManagerShared" cs3Label="Device Type" cs3= cs4Label="Database" cs4= cs5Label="Other info" cs5= cn1Label="Request Id" cn1= cn2Label="Ticket Id" cn2= msg=
And the rsyslog manipulated message here:
2019-05-28T14:17:02Z WIN2016-TEMPLATE CEF:0|Cyber-Ark|Vault|10.6.0000|51|Retrieve[File|5|act="Retrieve] suser=PasswordManager fname=Root\Policies\Policy-WinDomTest.ini dvc= shost=XXXX dhost= duser= externalId= app= reason= cs1Label="Affected User Name" cs1= cs2Label="Safe Name" cs2="PasswordManagerShared" cs3Label="Device Type" cs3= cs4Label="Database" cs4= cs5Label="Other info" cs5= cn1Label="Request Id" cn1= cn2Label="Ticket Id" cn2= msg=
This issue is most commonly seen when rsyslog is used as a syslog forwarder/filter.
Environment
9.7;9.8;9.9;9.9.5;9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;10.9;10.10
Procedure
There is a property 'rawmsg' which allows us to bypass this problem, as rsyslog does preserve the original log.
Adding it to a custom template (https://www.rsyslog.com/doc/v8-stable/configuration/templates.html) allows rsyslog to send a specific log flow's raw logs to the log file specified.
An example in rsyslog.conf:
$template test,"%rawmsg%" *.* /var/log/testlogs;testThis sends all logs *.* to /var/log/testlogs using the template test which has the format "%rawmsg%".
This can be customized/narrowed down to a deployment specific configuration, but will enable rsyslog to log the raw Idira vault format, unedited and ready to be forwarded on to the SIEMs and parsed with traditional regex.