Remove tailing single quote from audit.res #412
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The auditd decoder field 'audit.res' includes an unwanted tailing single quote when it is defined inside a msg='...' construct as is normal with current Redhat/CentOS. For the below log, audit.res is extracted as
success'
instead of
success
type=USER_LOGIN msg=audit(1559060902.765:1916): pid=23239 uid=0 auid=0 ses=8 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=login id=0 exe="/usr/sbin/sshd" hostname=name.host.addr=43.45.126.244 terminal=/dev/pts/0 res=success'
In the final decoder section of /var/ossec/ruleset/decoders/0040-auditd_decoders.xml, changing the regex from res=(\S+) to res=(\w+) seems to fix this issue cleanly. I think it is safe as I am not aware of any non-alphanumeric values being valid for this field. I have only ever seen audit.res values of success, failed, 0, or 1.