4.1.2.1 Ensure journald is configured to compress large log files

Information

The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large.

Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts.

Solution

Edit the /etc/systemd/journald.conf file and add the following line:

Compress=yes

Reload the configuration to be effective.

# systemctl force-reload systemd-journald

/etc is stateless on Container-Optimized OS. Therefore, /etc cannot be used to make these changes persistent across reboots. The steps mentioned above needs to be performed after every boot.

See Also

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

Item Details

Category: AUDIT AND ACCOUNTABILITY

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

Plugin: Unix

Control ID: cd5b54013c6440fae4a20efa0c66d7ad896efbd54aed12568b388b967512d9f1