Ensure journald is configured to compress large log files
An XCCDF Rule
Description
The journald system can compress large log files to avoid fill the system disk.
Rationale
Log files that are not properly compressed run the risk of growing so large that they fill up the log partition. Valuable logging information could be lost if the log partition becomes full.
- ID
- xccdf_org.ssgproject.content_rule_journald_compress
- Severity
- Medium
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
if [ -e "/etc/systemd/journald.conf" ] ; then
LC_ALL=C sed -i "/^\s*Compress\s*=\s*/d" "/etc/systemd/journald.conf"
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- journald_compress
- low_complexity