Hello again!
Well, in that case, it is possible. I have tested it in a Debian host, but the steps are the same.
For example, we can monitor the output of some commands and check if there is a difference with a
Generic Diff:- First, add the host your going to monitor with this command. Check if the SSH connection works from the manager to client to discard any network issue
- Then, create a new section in your ossec.conf file with the desired commands and restart the Manager
<agentless>
<type>ssh_generic_diff</type>
<frequency>20000</frequency>
<host>wazuh@example_address.com</host>
<state>periodic_diff</state>
<arguments>ls -la /etc; cat /etc/passwd</arguments>
</agentless> - You should see some entries in your ossec.log file that confirm everything is working
...
2021/01/21 20:15:52 ossec-agentlessd: INFO: Test passed for 'ssh_generic_diff'.
2021/01/21 20:16:53 ossec-agentlessd: INFO: ssh_generic_diff: wa...@192.168.0.88: Started.
2021/01/21 20:16:53 ossec-agentlessd: INFO: ssh_generic_diff: wa...@192.168.0.88: Starting.
2021/01/21 20:16:53 ossec-agentlessd: INFO: ssh_generic_diff: wa...@192.168.0.88: Finished. ...
- If something changes in these folders, you'll see an alert like this one (extracted from alerts.log)
2021 Jan 21 20:17:54 (ssh_generic_diff) wa...@192.168.0.88->agentless
Rule: 555 (level 7) -> 'Integrity checksum for agentless device changed.'
ossec: agentless: Change detected:
If you have any problem with this configuration, don't hesitate contacting us again.
Regards.