Hi Kompromittiert,
First of all, thank you for using Wazuh. Regarding your query, I have been testing your scenario, and followed these steps:
- First of all, I have created a CDB list, called test2, using the Kibana UI. To do so, you will have to go to Management -> CDB lists -> Add new lists file (right top side of the screen). Set a name for your CDB list and add keys and values (optional). Remember that it is not possible to set two different keys.
- Once I have done that, I restarted the Wazuh manager to apply the changes. Using this event: "Sep 4 23:58:33 junction sshd[9351]: Accepted password for root from 1.1.1.1 port 1066 ssh2", I started to test your rules. With the first one, everything worked as expected, but with the second one, I realized that, in fact, regardless of the srcip value, every pasted event was triggered as 10001.
- After this, I came back to
this guide to make sure that the rule syntax was correct and the CDB list was properly configured and realized that I had missed
this step. Basically, is adding this new list to the
ossec.conf configuration. Not sure if you have done this, but right after I included the missing lines and restarted the manager, the rule started to work as expected:
root@pop-os:/var/ossec/etc/lists# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.2.1
Type one log per line
Sep 4 23:58:33 junction sshd[9351]: Accepted password for root from 192.168.10.1 port 1066 ssh2
**Phase 1: Completed pre-decoding.
full event: 'Sep 4 23:58:33 junction sshd[9351]: Accepted password for root from 192.168.10.1 port 1066 ssh2'
timestamp: 'Sep 4 23:58:33'
hostname: 'junction'
program_name: 'sshd'
**Phase 2: Completed decoding.
name: 'sshd'
parent: 'sshd'
dstuser: 'root'
srcip: '192.168.10.1'
**Phase 3: Completed filtering (rules).
id: '10001'
level: '16'
description: 'SSH login outside from LAN.'
groups: '['local', 'syslog', 'sshd']'
firedtimes: '1'
mail: 'True'
**Alert to be generated.
Sep 4 23:58:33 junction sshd[9351]: Accepted password for root from 1.1.1.1 port 1066 ssh2
**Phase 1: Completed pre-decoding.
full event: 'Sep 4 23:58:33 junction sshd[9351]: Accepted password for root from 1.1.1.1 port 1066 ssh2'
timestamp: 'Sep 4 23:58:33'
hostname: 'junction'
program_name: 'sshd'
**Phase 2: Completed decoding.
name: 'sshd'
parent: 'sshd'
dstuser: 'root'
srcip: '1.1.1.1'
**Phase 3: Completed filtering (rules).
id: '5715'
level: '3'
description: 'sshd: authentication success.'
groups: '['syslog', 'sshd', 'authentication_success']'
firedtimes: '1'
gdpr: '['IV_32.2']'
gpg13: '['7.1', '7.2']'
hipaa: '['164.312.b']'
mail: 'False'
mitre.tactic: '['Defense Evasion', 'Initial Access', 'Persistence', 'Privilege Escalation', 'Lateral Movement']'
mitre.technique: '['Valid Accounts', 'Remote Services']'
nist_800_53: '['AU.14', 'AC.7']'
pci_dss: '['10.2.5']'
tsc: '['CC6.8', 'CC7.2', 'CC7.3']'
**Alert to be generated.
Check your /var/ossec/etc/ossec.conf file and let me know if you missed that section too. If you are going to make any changes, do not forget to restart the manager afterwards.
If you already had that configuration, please, send me the exact log that you are using to do these tests, so I can go further in the investigation.
Hope this helps. Let me know if you need anything else.
Regards,
Yana.