Hello Team,
I was trying to extend the default sshd rule by following ruleset:
<group name="syslog,sshd,"> <rule id="5700" level="0" noalert="1"> <decoded_as>sshd</decoded_as> <description>SSHD messages grouped.</description> </rule> <rule id="100010" level="1" noalert="1"> <if_sid>5700</if_sid> <!-- srcip>192.168.100.100</srcip-- > ### Tried with this as well <match>Did not receive identification string from 192.168.100.100</match> <description>sshd: insecure connection attempt (scan) from Scanner</description> <mitre> <id>T1021.004</id> </mitre> <group>gdpr_IV_35.7.d,gpg13_4.12,nist_800_53_SI.4,pci_dss_11.4,recon,tsc_CC6.1,tsc_CC6.8,tsc_CC7.2,tsc_CC7.3,</group> </rule>Motive was to suppress alerts generated by rule id - 5706 where srcip is 192.168.100.100. I have two more IPs for which same rule is created by looks like only this one is not working.
Sample Log:
Sep 5 01:37:50 agent-1 sshd[160547]: Did not receive identification string from 172.30.58.14 port 40930Can someone please help in this?
Regards,KS
Hello Ian,
Apparently wazuh-logtest has started giving following warnings :
Your help is appreciated!
Regards,KS
Greetings!
I checked other 2 IPs under Discover but could not see any alert there. However if use wazuh-logtest, it says **Alert to be generated.
About the rule id 5700, it is present under default rules. Here are the details -
Hope this answers!
Thanks,KS
Hello Ian,
I was calling the custom rules before /var/ossec/ruleset/rules/0095-sshd_rules.xml and hence it was not able to find the rule id 5700 (hope my understanding is correct). I changed the file name of the custom rules & the warning message disappeared.
Though the default rule is still getting triggered -
Thanks,
Hello Ian,
I tried modifying existing rule as well; but that did not work. I have 3 IPs which are to be whitelisted but that’s not working.
This one is the updated rule which now gives earlier warnings -
Updated Rule:
<group name="syslog,sshd,"> <rule id="5700" level="0" noalert="1"> <decoded_as>sshd</decoded_as> <description>SSHD messages grouped.</description> </rule> <rule id="5706" level="6" overwrite="yes"> <if_sid>5700</if_sid> <srcip>!192.168.100.100</srcip> <match>Did not receive identification string from</match> <description>sshd: insecure connection attempt (scan).</description> <mitre> <id>T1021.004</id> </mitre> <group>gdpr_IV_35.7.d,gpg13_4.12,nist_800_53_SI.4,pci_dss_11.4,recon,tsc_CC6.1,tsc_CC6.8,tsc_CC7.2,tsc_CC7.3,</group> </rule> </group>I am confused, why this is not working! :(
Thanks a lot!
This makes sense. It was working when I was on 4.3.10. Since I upgraded to 4.4.4, this is being observed. negate="yes" worked for me. Added 3 lines with different IPs.
:)
Regards,KS