Hello,
I have a wazuh-manager-4.7.5-1.x86_64 and one wazuh-agent-4.7.5-1.x86_64.
When I install a package on the agent's linux server, I get in the manager an entry in /var/log/ossec/alerts/alerts.log with (pls disregard the prefix on the output as it comes from the log pipeline):
ossec-1 | ** Alert 1717766107.7671: - syslog,yum,config_changed,pci_dss_10.6.1,pci_dss_10.2.7,gpg13_4.10,gdpr_IV_35.7.d,hipaa_164.312.b,nist_800_53_AU.6,nist_800_53_AU.14,tsc_CC7.2,tsc_CC7.3,tsc_CC6.8,tsc_CC8.1,
ossec-1 | 2024 Jun 07 13:15:07 (amazoncontainer) 172.19.0.6->/var/log/messages
ossec-1 | Rule: 2932 (level 7) -> 'New Yum package installed.'
ossec-1 | Jun 7 13:15:06 22144f6fdb18 yum[1268]: Installed: gpm-libs-1.20.7-15.amzn2.0.2.x86_64
This demonstrates that the agent is registered in the manager and that logs (from /var/log/messages) are being shipped from the agent to the manager and processed correctly.
Now, in the agent I have a custom bash that writes the commands executed also to syslog and to /var/log/messages, so same file being shipped to the manager.
In the manager I have a custom decode and rule that should alert me when commands are executed.
If I execute /var/ossec/bin/wazuh-logtest with that string I get:
# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.7.5
Type one log per line
Dec 6 10:43:13 ip-10-2-6-192 -bash: (647) [ec2-user.ec2-user] |.| ps fax
**Phase 1: Completed pre-decoding.
full event: 'Dec 6 10:43:13 ip-10-2-6-192 -bash: (647) [ec2-user.ec2-user] |.| ps fax'
timestamp: 'Dec 6 10:43:13'
hostname: 'ip-10-2-6-192'
program_name: '-bash'
**Phase 2: Completed decoding.
name: 'bash'
**Phase 3: Completed filtering (rules).
id: '100201'
level: '7'
description: 'Shell command executed on system'
groups: '['syslog', 'bash']'
firedtimes: '1'
mail: 'False'
**Alert to be generated.
So, I should get the an alert in /var/log/ossec/alerts/alerts.log as well but I don't get any alert. I can see that when I execute a command and the entry is logged to /var/log/messages in the agent, network traffic flows to the manager but I don't get any alert.
Also tried setting analysisd.debug=2 but didn't show any real difference between a yum install triggering an alert and a command being executed not triggering any alert.
I'm somewhat lost on how to debug this further and would appreciate any help.
Best regards,
Nuno Fernandes