Ensure rsyslog Default File Permissions Configured
An XCCDF Rule
Description
rsyslog will create logfiles that do not already exist on the system. This settings controls what permissions will be applied to these newly created files.Rationale
It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected.
- ID
- xccdf_org.ssgproject.content_rule_rsyslog_filecreatemode
- Severity
- Medium
- References
- Updated
Remediation Templates
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- configure_strategy
- low_complexity
A 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
readarray -t targets < <(grep -H '^\s*$FileCreateMode' /etc/rsyslog.conf /etc/rsyslog.d/*)
# if $FileCreateMode set in multiple places