Skip to content

Ensure journald is configured to write log files to persistent disk

An XCCDF Rule

Description

The journald system may store log files in volatile memory or locally on disk. If the logs are only stored in volatile memory they will we lost upon reboot.

Rationale

Log files contain valuable data and need to be persistent to aid in possible investigations.

ID
xccdf_org.ssgproject.content_rule_journald_storage
Severity
Medium
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-91378-0
  - journald_storage

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel-default; then

found=false

# set value in all files if they contain section or key