Hi
bodyboader_SV!
I hope you are doing fine!
Add following custom rule into
/var/ossec/etc/rules/local_rules.xml <rule id="100080" level="10">
<if_sid>4806</if_sid>
<regex type="pcre2">firewall.*? pri\=6\s+.*? m\=745\s+</regex>
<description>SonicWall custom rule.</description>
</rule>Then restart the manager service to update ruleset.
Success caseThe event contains the following description
pri=6 and
m=745Event to test
id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=745 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"
Test
/var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.4.0
Type one log per line
id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=745 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"
**Phase 1: Completed pre-decoding.
full event: 'id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=745 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"'
**Phase 2: Completed decoding.
name: 'sonicwall'
action: 'User login denied - LDAP authentication failure'
dstip: '172.10.21.3'
dstport: '0'
protocol: 'tcp'
srcip: '212.212.212.20'
srcport: '0'
status: '6'
**Phase 3: Completed filtering (rules).
id: '100080'
level: '10'
description: 'SonicWall custom rule.'
groups: '['local', 'syslog', 'sshd']'
firedtimes: '1'
mail: 'False'
**Alert to be generated.An aler will be generated.
Failure caseEvent without
pri=6 or
m=745
Event to test
id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=7 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"
Test
/var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.4.0
Type one log per line
id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=7 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"
**Phase 1: Completed pre-decoding.
full event: 'id=firewall sn=XPTOXPTO time="2023-06-12 16:28:09 UTC" fw=199.99.999.1 pri=6 c=16 m=7 msg="User login denied - LDAP authentication failure" src=212.212.212.20:0:X1 dst=172.10.21.3:0:X1 usr="teste.teste" proto=tcp sess="sslvpnc" note="teste.teste" n=188 fw_action="NA"'
**Phase 2: Completed decoding.
name: 'sonicwall'
action: 'User login denied - LDAP authentication failure'
dstip: '172.10.21.3'
dstport: '0'
protocol: 'tcp'
srcip: '212.212.212.20'
srcport: '0'
status: '6'
**Phase 3: Completed filtering (rules).
id: '4806'
level: '0'
description: 'SonicWall informational message.'
groups: '['syslog', 'sonicwall']'
firedtimes: '1'
mail: 'False'
Let me know if that works for you!
Regards.