6.2.3.8 Ensure rsyslog logrotate is configured

Information

The system includes the capability of rotating log files regularly to avoid filling up the system with logs or making the logs unmanageably large. The file /etc/logrotate.d/rsyslog is the configuration file used to rotate log files created by rsyslog

By keeping the log files smaller and more manageable, a system administrator can easily archive these files to another system and spend less time looking through inordinately large log files.

Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if systemd-journald is used.

Solution

Edit /etc/logrotate.conf and /etc/logrotate.d/* to ensure logs are rotated according to site policy.

Example logrotate configuration that specifies log files be rotated weekly, keep 4 backlogs, compress old log files, ignores missing and empty log files, postrotate to reload rsyslog service after logs are rotated

/var/log/rsyslog/*.log {
weekly
rotate 4
compress
missingok
notifempty
postrotate
/usr/bin/systemctl reload rsyslog.service >/dev/null || true
endscript
}

See Also

https://workbench.cisecurity.org/benchmarks/18208

Item Details

Category: AUDIT AND ACCOUNTABILITY

References: 800-53|AU-4, CSCv7|6.4

Plugin: Unix

Control ID: dba5632bffa0ec0c0ea54ab513bac5eb72d8f761a2194402e040f73bd486a14f