Skip to content

Verify Permissions on the system journal

An XCCDF Rule

Description

Verify all files in the /run/log/journal and /var/log/journal directories have permissions set to "640" or less permissive by using the following command:

$ sudo find /run/log/journal /var/log/journal  -type f -exec stat -c "%n %a" {} \;
If any output returned has a permission set greater than "640", this is a finding.

Rationale

Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization.

ID
xccdf_org.ssgproject.content_rule_file_permissions_system_journal
Severity
Medium
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - DISA-STIG-UBTU-22-232027
  - configure_strategy

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}
' 'kernel' 2>/dev/null | grep -q installed; then

TMPFILES_CONF="/usr/lib/tmpfiles.d/systemd.conf"