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

Remove tailing single quote from audit.res #412

Merged
merged 1 commit into from Jun 14, 2019

Conversation

branchnetconsulting
Copy link
Contributor

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.

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.
@Zenidd Zenidd added the rules Rules related issues label Jun 5, 2019
@Zenidd
Copy link
Contributor

Zenidd commented Jun 5, 2019

Hello @branchnetconsulting,

we will review your contribution and if possible we are adding it to Wazuh-ruleset. Thank you very much for helping the Wazuh project.

Best regards,

Juan Pablo Sáez

@Lopuiz Lopuiz added decoders Decoders related issues and removed rules Rules related issues labels Jun 5, 2019
@Lopuiz Lopuiz changed the base branch from 3.9 to 3.10 June 5, 2019 10:25
@Lopuiz Lopuiz self-requested a review June 5, 2019 10:48
@Lopuiz Lopuiz changed the base branch from 3.10 to 3.9 June 5, 2019 14:08
@bah07 bah07 added this to Under review in Wazuh 3.9.3 via automation Jun 14, 2019
@bah07 bah07 merged commit 34f25e8 into wazuh:3.9 Jun 14, 2019
Wazuh 3.9.3 automation moved this from Under review to Done Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community decoders Decoders related issues
Projects
No open projects
Wazuh 3.9.3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants