Hi, team
I have a question regarding using syscheck and report_changes option.
The goal is to use realtime monitoring and report_changes for a specific directory which already exists.
Here is the wazuh agent configuration (shared config):
<agent_config os="Linux">
<!-- File integrity monitoring -->
<syscheck>
<disabled>no</disabled>
<!-- Frequency that syscheck is executed default every 12 hours -->
<frequency>43200</frequency>
<auto_ignore>no</auto_ignore>
<scan_on_start>yes</scan_on_start>
<!-- Directories to check (perform all possible verifications) -->
<directories check_all="yes" realtime="yes" report_changes="yes">/etc/httpd/conf.d</directories>
<!-- Files/directories to ignore -->
<ignore>/etc</ignore>
<ignore>/usr</ignore>
<!-- Check the file, but never compute the diff -->
<nodiff>/etc/ssl/private.key</nodiff>
<skip_nfs>yes</skip_nfs>
</syscheck>
</agent_config>
Here is the part of the log after the agent restart:
2018/02/21 00:13:30 ossec-syscheckd: INFO: Directory set for real time monitoring: '/etc/httpd/conf.d'.
2018/02/21 00:13:32 ossec-logcollector: INFO: Monitoring output of command(360): df -P
2018/02/21 00:13:32 ossec-logcollector: INFO: Monitoring full output of command(360): netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d
2018/02/21 00:13:32 ossec-logcollector: INFO: Monitoring full output of command(360): last -n 20
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/httpd/error_log'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/httpd/access_log'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/audit/audit.log'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/ossec/logs/active-responses.log'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/messages'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/secure'.
2018/02/21 00:13:32 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/maillog'.
2018/02/21 00:13:32 ossec-logcollector: INFO: Started (pid: 20753).
2018/02/21 00:14:02 ossec-syscheckd: INFO: Syscheck scan frequency: 43200 seconds
2018/02/21 00:14:32 ossec-syscheckd: INFO: Starting syscheck scan (forwarding database).
2018/02/21 00:14:32 ossec-syscheckd: INFO: Starting syscheck database (pre-scan).
2018/02/21 00:20:43 ossec-syscheckd: INFO: Initializing real time file monitoring engine.
2018/02/21 00:20:43 ossec-syscheckd: INFO: Real time file monitoring engine started.
2018/02/21 00:20:43 ossec-syscheckd: INFO: Finished creating syscheck database (pre-scan completed).
2018/02/21 00:20:53 ossec-syscheckd: INFO: Ending syscheck scan (forwarding database).
2018/02/21 00:21:13 rootcheck: INFO: Starting rootcheck scan.
2018/02/21 00:21:49 rootcheck: INFO: Ending rootcheck scan.
2018/02/21 00:21:49 ossec-syscheckd: INFO: Starting syscheck real-time monitoring.
However none of the diff files are created. /var/ossec/queue/diff/local/ directory is empty.
Diff file is only created when a new file is touched in the monitored directory.
How can existing files be monitored? I need to know what have changed inside the files of this directory.