Skip to content

Commit 719efaf

Browse files
authored
Merge pull request #251 from ansible-lockdown/Oct_24
Final updates for v1.0.0
2 parents 0d3ffcd + 048d197 commit 719efaf

2 files changed

Lines changed: 20 additions & 21 deletions

File tree

tasks/prelim.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,35 +138,32 @@
138138
- always
139139

140140
- name: "PRELIM | PATCH | Ensure auditd is installed"
141-
block:
142-
- name: "PRELIM | PATCH | Ensure auditd is installed"
143-
ansible.builtin.package:
144-
name: ['auditd', 'audispd-plugins']
145-
state: present
146-
when:
147-
- "'auditd' not in ansible_facts.packages or
148-
'auditd-plugins' not in ansible_facts.packages"
149-
150-
- name: "PRELIM | AUDIT | Audit conf and rules files | list files"
151-
ansible.builtin.find:
152-
path: /etc/audit/
153-
file_type: file
154-
recurse: true
155-
patterns: '*.conf,*.rules'
156-
register: auditd_conf_files
157-
141+
ansible.builtin.package:
142+
name: ['auditd', 'audispd-plugins']
143+
state: present
158144
when:
159-
- ubtu22cis_rule_4_1_1_1 or
160-
ubtu22cis_rule_4_1_4_5 or
161-
ubtu22cis_rule_4_1_4_6 or
162-
ubtu22cis_rule_4_1_4_7
145+
- "'auditd' not in ansible_facts.packages or
146+
'auditd-plugins' not in ansible_facts.packages"
147+
- ubtu22cis_rule_4_1_1_1
163148
tags:
164149
- level2-server
165150
- level2-workstation
166151
- patch
167152
- auditd
168153
- always
169154

155+
- name: "PRELIM | AUDIT | Audit conf and rules files | list files"
156+
ansible.builtin.find:
157+
path: /etc/audit/
158+
file_type: file
159+
recurse: true
160+
patterns: '*.conf,*.rules'
161+
register: auditd_conf_files
162+
tags:
163+
- patch
164+
- auditd
165+
- always
166+
170167
- name: "PRELIM | AUDIT | Check if auditd is immutable before changes"
171168
ansible.builtin.shell: auditctl -l | grep -c '-e 2'
172169
changed_when: false

tasks/section_6/cis_6.1.x.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
owner: root
2222
group: root
2323
mode: '0644'
24+
failed_when: discovered_file_exists.state not in '[ file, absent ]'
25+
register: discovered_file_exists
2426
when:
2527
- ubtu22cis_rule_6_1_2
2628
tags:

0 commit comments

Comments
 (0)