Hello Kazim,
A very helpful tool in analyzing this type of issue is to see what you are receiving on the manager.
In order to do so you may temporarily configure the <logall> option in /var/ossec/etc/ossec.conf to yes.
This will save every log message received in /var/ossec/logs/archive/archives.log
Note that this will add a timestamp, source and destination information before the message, so the actual message will come after this.
If the original message is:
[Tue Sep 30 11:30:13.262255 2014] [core:error] [pid 20101] [client 99.47.227.95:34567] AH00037: Symbolic link not allowed or link target not accessible: /usr/share/awstats/icon/mime/document.png
Then in /var/ossec/logs/archive/archives.log you should see:
2019 Mar 29 08:13:37 (agent) 192.168.1.20->/var/log/apache.log [Tue Sep 30 11:30:13.262255 2014] [core:error] [pid 20101] [client 99.47.227.95:34567] AH00037: Symbolic link not allowed or link target not accessible: /usr/share/awstats/icon/mime/document.png
If you're not seeing the message, verify that other messages from the agent are
reaching the manager, and that the agent is indeed reading the log. If the agent is connected and has the log open, on
the agent side you may change the variable logcollector.debug to 2 in /var/ossec/etc/ossec.conf and each time a log message is collected the file /var/ossec/logs/ossec.log will get a line similar to:
2019/03/29 08:31:54 ossec-logcollector[28208] read_syslog.c:119 at read_syslog(): DEBUG: Read 1 lines from /var/log/apache.log
Otherwise, if you are seeing the log message on the manager then it means the means the agent is correctly relaying the information to the manager.
You can then verify if this log message would trigger an alert by using the /var/ossec/bin/ossec-logtest utility, I personally prefer to pipe the message to it:
echo '[Tue Sep 30 11:30:13.262255 2014] [core:error] [pid 20101] [client 99.47.227.95:34567] AH00037: Symbolic link not allowed or link target not accessible: /usr/share/awstats/icon/mime/document.png' | /var/ossec/bin/ossec-logtest
In order for the message to generate an alert the output of this must end with:
**Alert to be generated.If the message is correctly decoded and triggers a rule but it doesn't state that then it means that rule does not generate an alert.
Certain errors like the one I have used as an example will not generate an alert in order to reduce noise in the system. The criteria for this decision may vary, so you may use a custom child rule or overwrite that one with a custom rule if you wish, for that we recommend you read this section of our documentation:
https://documentation.wazuh.com/current/user-manual/ruleset/custom.htmlFinally, if you consider that your custom rule is of general interest we encourage the community to contribute to
Wazuh (which is an open source project) by either opening an issue or submitting a Pull Request to the ruleset repository:
Don't forget to change back the logall and logcollector.debug variables in order to avoid using unnecessary disk space.
Best Regards,
Juan Carlos tello