forked from ansible-lockdown/RHEL9-CIS
consistent lineinfile usage
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
02d686f920
commit
82d1d18504
12 changed files with 41 additions and 76 deletions
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
- name: "4.1.2.1 | PATCH | Ensure audit log storage size is configured"
|
||||
lineinfile:
|
||||
dest: /etc/audit/auditd.conf
|
||||
path: /etc/audit/auditd.conf
|
||||
regexp: "^max_log_file( |=)"
|
||||
line: "max_log_file = {{ rhel9cis_max_log_file_size }}"
|
||||
state: present
|
||||
notify: restart auditd
|
||||
when:
|
||||
- rhel9cis_rule_4_1_2_1
|
||||
|
|
@ -19,10 +18,9 @@
|
|||
|
||||
- name: "4.1.2.2 | PATCH | Ensure audit logs are not automatically deleted"
|
||||
lineinfile:
|
||||
dest: /etc/audit/auditd.conf
|
||||
path: /etc/audit/auditd.conf
|
||||
regexp: "^max_log_file_action"
|
||||
line: "max_log_file_action = {{ rhel9cis_auditd['max_log_file_action'] }}"
|
||||
state: present
|
||||
notify: restart auditd
|
||||
when:
|
||||
- rhel9cis_rule_4_1_2_2
|
||||
|
|
@ -36,10 +34,9 @@
|
|||
|
||||
- name: "4.1.2.3 | PATCH | Ensure system is disabled when audit logs are full"
|
||||
lineinfile:
|
||||
dest: /etc/audit/auditd.conf
|
||||
path: /etc/audit/auditd.conf
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
state: present
|
||||
notify: restart auditd
|
||||
with_items:
|
||||
- { regexp: '^admin_space_left_action', line: 'admin_space_left_action = {{ rhel9cis_auditd.admin_space_left_action }}' }
|
||||
|
|
|
|||
|
|
@ -32,10 +32,9 @@
|
|||
# This is counter to control 4.2.2.5??
|
||||
- name: "4.2.1.3 | PATCH | Ensure journald is configured to send logs to rsyslog"
|
||||
lineinfile:
|
||||
dest: /etc/systemd/journald.conf
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: "^#ForwardToSyslog=|^ForwardToSyslog="
|
||||
line: ForwardToSyslog=yes
|
||||
state: present
|
||||
when:
|
||||
- rhel9cis_rule_4_2_1_3
|
||||
- rhel9cis_preferred_log_capture == "rsyslog"
|
||||
|
|
@ -48,7 +47,7 @@
|
|||
|
||||
- name: "4.2.1.4 | PATCH | Ensure rsyslog default file permissions configured"
|
||||
lineinfile:
|
||||
dest: /etc/rsyslog.conf
|
||||
path: /etc/rsyslog.conf
|
||||
regexp: '^\$FileCreateMode'
|
||||
line: '$FileCreateMode 0640'
|
||||
notify: restart rsyslog
|
||||
|
|
|
|||
|
|
@ -97,10 +97,9 @@
|
|||
|
||||
- name: "4.2.2.3 | PATCH | Ensure journald is configured to compress large log files"
|
||||
lineinfile:
|
||||
dest: /etc/systemd/journald.conf
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: "^#Compress=|^Compress="
|
||||
line: Compress=yes
|
||||
state: present
|
||||
when:
|
||||
- rhel9cis_rule_4_2_2_3
|
||||
tags:
|
||||
|
|
@ -113,10 +112,9 @@
|
|||
|
||||
- name: "4.2.2.4 | PATCH | Ensure journald is configured to write logfiles to persistent disk"
|
||||
lineinfile:
|
||||
dest: /etc/systemd/journald.conf
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: "^#Storage=|^Storage="
|
||||
line: Storage=persistent
|
||||
state: present
|
||||
when:
|
||||
- rhel9cis_rule_4_2_2_4
|
||||
tags:
|
||||
|
|
@ -130,10 +128,9 @@
|
|||
# This is counter to control 4.2.1.3??
|
||||
- name: "4.2.2.5 | PATCH | Ensure journald is not configured to send logs to rsyslog"
|
||||
lineinfile:
|
||||
dest: /etc/systemd/journald.conf
|
||||
path: /etc/systemd/journald.conf
|
||||
regexp: "^ForwardToSyslog="
|
||||
line: "#ForwardToSyslog=yes"
|
||||
state: present
|
||||
notify: restart systemd_journal_upload
|
||||
when:
|
||||
- rhel9cis_rule_4_2_2_5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue