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/18209

Item Details

Category: AUDIT AND ACCOUNTABILITY

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

Plugin: Unix

Control ID: 3faf4a80cfa3216a51623c97a53066c915797d776aace82296329561449857d4