Hello,
The link that you mentioned is for executing commands in the agents remotely from the manager.
What we do is monitor system calls using auditd. For example, these auditd rules will audit all commands run by a user who has admin privileges:
- auditctl -a exit,always -F euid=0 -F arch=b64 -S execve -k audit-wazuh-c
- auditctl -a exit,always -F euid=0 -F arch=b32 -S execve -k audit-wazuh-c
The command is logged in /var/log/audit/audit.log and the Wazuh agent reads that file. Then, the manager will trigger an alert based on the corresponding decoders/rules.
Check the documentation for more information.
I hope it helps.