Syscheck: FAQ¶
How to force an immediate syscheck scan?¶
Run agent control tool to perform a integrity checking immediately (option -a to run on all the agents and -u to specify an agent id)
# /var/ossec/bin/agent_control -r -a # /var/ossec/bin/agent_control -r -u <agent_id>For more information see the agent_control documentation.
How to tell syscheck not to scan the system when OSSEC starts?¶
Set the option <scan_on_start> to “no” on ossec.conf
How to ignore a file that changes too often?¶
Set the file/directory name in the <ignore> option or create a simple local rule.
The following one will ignore files /etc/a and /etc/b and the directory /etc/dir for agents mswin1 and ubuntu-dns:
<rule id="100345" level="0" > <if_group>syscheck</if_group> <description>Changes ignored.</description> <match>/etc/a|/etc/b|/etc/dir</match> <hostname>mswin1|ubuntu-dns</hostname> </rule>
Why does OSSEC still scan a file even though it’s been ignored?¶
No idea. So if there are some directories you do not want scanned at all, make sure they are not included in a
<directories>configuration.
How to know when the syscheck scan ran?¶
Use the agent_control tool on the manager, to see this information.
More information see the agent_control documentation.
How to get detailed reporting on the changes?¶
Use the syscheck_control tool on the manager or the web ui for that.
More information see the syscheck_control documentation.
Syscheck not sending any file data to the server?¶
With ossec 1.3 and Fedora you may run into this problem:
You have named files you’d like ossec to monitor so you add:
<ossec_config>
<syscheck>
<directories check_all="yes">/var/named</directories>
to ossec.conf on the client. Fedora – at least as of version 7 – runs named in a chroot jail under /var/named/chroot. However, part of that chroot jail includes /var/named/chroot/proc. The contents of that directory are purely ephemeral; there is no value to checking their integrity. And, at least in ossec 1.3, your syscheck may stall trying to read those files.
The symptom is a syscheck database on the server that never grows beyond a file or two per restart of the client. The log monitoring continues to work, so you know it’s not a communication issue, and you will often see a slight increase in syscheck database file size after the client has restarted (in one case about 20 minutes after). But the database will never be completely built; there will only be a couple files listed in database.
The solution is to add an ignore clause to ossec.conf on the client:
<ossec_config>
<syscheck>
<ignore>/var/named/chroot/proc</ignore>
Why aren’t new files creating an alert?¶
By default OSSEC does not alert on new files.
To enable this functionality, <alert_new_files> must be set to yes inside the
<syscheck> section of the manager’s ossec.conf (agent-only config is ignored
for this option). Rule 554 already fires at level 5 when that is enabled; raise the
level with overwrite="yes" only if you want a stronger alert.
Alerting on new files does not work in realtime; a full scan is required.
See Realtime limitations.
Why don’t permission changes alert immediately with realtime enabled?¶
realtime="yes" uses filesystem event notifications to re-check files quickly, but only
content integrity changes (checksums/size) on existing files produce immediate alerts.
A chmod or ownership change on a monitored file is detected on the next scheduled
syscheck scan, not at the moment the permission is changed. See Realtime limitations.
Why does auto_ignore not suppress noisy realtime alerts?¶
auto_ignore is applied on the manager when handling events from scheduled scans. Alerts
from the realtime monitoring path are not subject to auto_ignore. Use <ignore> or a
local rule for files that change frequently in realtime directories.
Can OSSEC monitor Windows NTFS permissions (ACLs)?¶
Yes. Enable check_acl on the monitored directory (Windows agents only).
This is not part of check_all, and it is separate from Unix
check_perm (POSIX mode bits).
<syscheck>
<directories check_all="yes" check_acl="yes" realtime="yes">C:\\path\\to\\watch</directories>
</syscheck>
OSSEC stores a compact SID-stable digest in the integrity sum and attaches human-readable ACE details (including inheritance flags and Added/Removed/Modified sections) on change alerts. Account display-name renames without an ACL edit do not raise an alert.
The first scan after enabling check_acl may re-baseline those paths. Use FIM
maintenance mode or syscheck_control -u if you need a quiet transition.
How do I get alerts for new files?¶
Add the following to local_rules.xml only if you want a higher alert level than the default (5):
<rule id="554" level="10" overwrite="yes">
<category>ossec</category>
<decoded_as>syscheck_new_entry</decoded_as>
<description>File added to the system.</description>
<group>syscheck,</group>
</rule>
The <alert_new_files> entry should look something like this:
<syscheck>
<frequency>7200</frequency>
<alert_new_files>yes</alert_new_files>
<directories check_all="yes">/etc,/bin,/sbin</directories>
</syscheck>
Can OSSEC include information on who changed a file in the alert?¶
In short, no. OSSEC does not track this information. You could use your OS’s auditing facilities to track this information, and create a rule to alert when an appropriate log is created.
How do I stop syscheck alerts during system updates?¶
Use FIM maintenance mode on the manager so syscheck updates the integrity database for that agent without generating alerts. The manager and other agents keep running.
Canonical workflow (preferred):
# /var/ossec/bin/agent_control -M enable -u AGENT_ID
# … apply OS patches / package updates …
# /var/ossec/bin/agent_control -M end -u AGENT_ID
-M end marks the agent for pending end, restarts syscheck/rootcheck, and
clears maintenance automatically when the agent reports
syscheck-db-completed. That avoids disabling mid-scan or forgetting a scan
and getting a flood afterward.
While maintenance is enabled:
File modifications and new files update the syscheck DB as the new baseline and do not alert.
Silent accepts are appended to
logs/fim_maintenance.logon the manager.agent_control -lshowsMaint(orMaint(pending-end)) for agents in this mode.Leaving maintenance on for more than 24 hours produces a periodic manager WARN — keep windows short. Maintenance trusts FIM events (including malicious ones) for that agent.
Emergency: agent_control -M disable -u AGENT_ID clears the flag
immediately without waiting for a scan. Prefer end for routine patching.
Check detail with agent_control -M status -u AGENT_ID or
agent_control -i AGENT_ID.
The older workaround (stop the manager and run syscheck_control -u) is no
longer necessary for patch windows. Clearing the database with
syscheck_control -u remains available if you intentionally want a full
rebuild.