Objective
Configure Linux file and directory ACLs so Cribl Edge File Monitor can read the required log files on Red Hat Linux servers, including /var/log/messages and /var/log/audit/audit.log, and continue collecting audit.log after log rotation.
Environment
- Product: Cribl Edge
- Version: 4.16.1
- Source type: File Monitor
- Operating system: Linux Red Hat servers
- Typical symptom: the desired logs are not being collected because file permissions or ACLs prevent the
cribluser from reading them.
Procedure
- Review the current ACLs on the affected files and directories to confirm whether the
cribluser can read them. Example:getfacl /var/log/audit/audit.log - Check whether the ACL mask is blocking access. If the file shows
mask::---, the effective permissions for thecribluser are blocked even if a user ACL entry exists. - Reset or remove incorrect ACLs on the affected log paths before reapplying the required permissions.
- Apply default ACLs recursively on
/var/logso newly created files and directories inherit read and execute access for thecribluser.setfacl -Rdm -u:cribl:r-x /var/log - Grant read access to the current
/var/log/messagesfile.setfacl -m u:cribl:r-- /var/log/messages - Grant read access to the current
/var/log/audit/audit.logfile.setfacl -m u:cribl:r-- /var/log/audit/audit.log - Create a script to reapply the ACL on
audit.logafter rotation, because the case showed that auditd/log rotation can overwrite the ACLs on that file.Create
/usr/local/bin/fix_audit_acl.shwith the correct owner and mode, and add this to the file:setfacl -m u:cribl:r-- /var/log/audit/audit.log - Schedule the script in root’s crontab to run every minute so the ACL is restored quickly after rotation.
* * * * * /usr/local/bin/fix_audit_acl.sh - Configure File Monitor sources to target the required files only.
- Create an
auditlogsource:- Search path:
/var/log/audit - Max depth: 1
- Allow list:
/var/log/audit/audit.log
- Search path:
- Create a
varlogsource:- Search path:
/var/log - Max depth: 1
- Allow list includes:
/var/log/messages*/var/log/secure*/var/log/audit/audit.log/var/log/cron*/var/log/journal*/var/log/yum.log/var/log/dnf.log
- Search path:
- Create an
- Validate collection after the next log rotation to confirm that both the ACLs and File Monitor configuration persist as expected.
Last Validated
- Cribl Edge 4.16.1
Additional Information
- In this example,
audit.logstopped being collected after rotation because the ACL mask becamemask::---, which blocked the effective access for thecribluser. - Using
setfacl -m u:cribl:r /var/log/audit/*only sets read on existing files and does not address the need for inherited access on new files and directories. - If log rotation uses methods such as
copytruncateor recreates the file without preserving ACLs, default ACLs alone may not be sufficient; reapplying the ACL with a scheduled script can prevent collection gaps.
