Fix rsyslog file and directory permissions

This commit is contained in:
Ryan Cavicchioni 2019-11-27 16:09:22 -06:00
parent 134fd61d6b
commit f292c531db
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
3 changed files with 21 additions and 1 deletions

View File

@ -24,4 +24,12 @@ template(
type="omfile"
dynafile="FilePerDay"
template="RSYSLOG_FileFormat"
fileCreateMode="{{ rsyslog_file_create_mode }}"
dirCreateMode="{{ rsyslog_dir_create_mode }}"
createDirs="{{ rsyslog_create_dirs | ternary('on', 'off') }}"
fileOwner="{{ rsyslog_file_owner }}"
fileGroup="{{ rsyslog_file_group }}"
dirOwner="{{ rsyslog_file_owner }}"
dirGroup="{{ rsyslog_file_group }}"
umask="{{ rsyslog_umask }}"
)

View File

@ -27,9 +27,18 @@ $FileOwner {{ rsyslog_file_owner }}
{% if rsyslog_file_group is defined %}
$FileGroup {{ rsyslog_file_group }}
{% endif %}
{% if rsyslog_dir_owner is defined %}
$FileOwner {{ rsyslog_dir_owner }}
{% endif %}
{% if rsyslog_dir_group is defined %}
$FileGroup {{ rsyslog_dir_group }}
{% endif %}
{% if rsyslog_file_create_mode is defined %}
$FileCreateMode {{ rsyslog_file_create_mode }}
{% endif %}
{% if rsyslog_create_dirs is defined %}
CreateDirs {{ rsyslog_create_dirs | ternary('on', 'off') }}
{% endif %}
{% if rsyslog_dir_create_mode is defined %}
$DirCreateMode {{ rsyslog_dir_create_mode }}
{% endif %}

View File

@ -1,8 +1,11 @@
---
rsyslog_file_owner: syslog
rsyslog_file_group: adm
rsyslog_file_create_mode: "0644"
rsyslog_dir_owner: syslog
rsyslog_dir_group: adm
rsyslog_file_create_mode: "0640"
rsyslog_dir_create_mode: "0755"
rsyslog_create_dirs: yes
rsyslog_umask: "0022"
rsyslog_priv_drop_to_user: syslog
rsyslog_priv_drop_to_group: syslog