6.2.3.4 Ensure rsyslog log file creation mode is configured

Information

rsyslog will create logfiles that do not already exist on the system.

The $FileCreateMode parameter allows you to specify the creation mode with which rsyslog creates new files. If not specified, the value 0644 is used (which retains backward-compatibility with earlier releases). The value given must always be a 4-digit octal number, with the initial digit being zero.

Please note that the actual permission depend on rsyslogd's process umask.

$FileCreateMode may be specified multiple times. If so, it specifies the creation mode for all selector lines that follow until the next $FileCreateMode parameter. Order of lines is vitally important.

It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected.

Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if systemd-journald is used.

Solution

Edit either /etc/rsyslog.conf or a dedicatedconf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive:

$FileCreateMode 0640

Restart the service:

# systemctl restart rsyslog

See Also

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

Item Details

Category: ACCESS CONTROL, AUDIT AND ACCOUNTABILITY, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|AU-2, 800-53|AU-7, 800-53|AU-12, 800-53|MP-2, CSCv7|5.1, CSCv7|6.2, CSCv7|6.3

Plugin: Unix

Control ID: f1c6fbfbbcb75d883d68e59f12c3c8c168f315bdba50b097b99b54c6c436bfcd