Skip to content

Commit 751fac8

Browse files
Merge pull request #368 from ansible-lockdown/devel
July 25 Release to main
2 parents 25b4bb7 + feb1835 commit 751fac8

9 files changed

Lines changed: 464 additions & 284 deletions

File tree

defaults/main.yml

Lines changed: 438 additions & 276 deletions
Large diffs are not rendered by default.

tasks/auditd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
dest: /etc/audit/rules.d/99_auditd.rules
2626
owner: root
2727
group: root
28-
mode: 'u-x,go-wx'
28+
mode: 'u-x,g-wx,o-rwx'
2929
diff: "{{ discovered_auditd_rules_file.stat.exists }}" # Only run diff if not a new file
3030
register: discovered_auditd_rules_template_updated
3131
notify:

tasks/section_1/cis_1.1.2.6.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
- name: "1/.1 | PATCH | Ensure /var/log is a separate partition"
3+
- name: "1.1.2.6.1 | PATCH | Ensure /var/log is a separate partition"
44
when:
55
- rhel9cis_rule_1_1_2_6_1
66
- required_mount not in prelim_mount_names

tasks/section_1/cis_1.1.2.7.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
- name: "1/.1 | PATCH | Ensure /var/log/audit is a separate partition"
3+
- name: "1.1.2.7.1 | PATCH | Ensure /var/log/audit is a separate partition"
44
when:
55
- rhel9cis_rule_1_1_2_7_1
66
- required_mount not in prelim_mount_names

tasks/section_1/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
file: cis_1.2.2.x.yml
4242

4343
- name: "SECTION | 1.3.1 | Configure SELinux"
44-
ansible.builtin.include_tasks:
44+
ansible.builtin.import_tasks:
4545
file: cis_1.3.1.x.yml
4646

4747
- name: "SECTION | 1.4 | Configure Bootloader"

tasks/section_3/cis_3.3.x.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@
240240
- rule_3.3.9
241241
- NIST800-53R5_AU-3
242242
block:
243-
- name: "3.3.4 | PATCH | Ensure suspicious packets are logged | Set Fact"
243+
- name: "3.3.9 | PATCH | Ensure suspicious packets are logged | Set Fact"
244244
ansible.builtin.set_fact:
245245
rhel9cis_sysctl_update: true
246246
rhel9cis_flush_ipv4_route: true
247247

248-
- name: "3.3.4 | PATCH | Ensure suspicious packets are logged"
248+
- name: "3.3.9 | PATCH | Ensure suspicious packets are logged"
249249
ansible.builtin.debug:
250250
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv4_sysctl.conf"
251251

tasks/section_5/cis_5.4.2.x.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
- level1-server
6262
- level1-workstation
6363
- patch
64-
- rule_5.4.2.2
64+
- rule_5.4.2.3
6565
- user
6666
- system
6767
- NIST800-53R5_CM-1
@@ -135,6 +135,22 @@
135135
ansible.builtin.set_fact:
136136
root_paths: "{{ discovered_root_paths.stdout }}"
137137

138+
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for presence of non-dirs"
139+
ansible.builtin.stat:
140+
path: "{{ item }}"
141+
loop: "{{ discovered_root_paths_split.stdout_lines }}"
142+
register: paths_stat
143+
144+
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Create dirs for some paths that are not dirs"
145+
ansible.builtin.file:
146+
path: "{{ item.item }}"
147+
state: directory
148+
owner: root
149+
group: root
150+
mode: 'go-w'
151+
loop: "{{ paths_stat.results }}"
152+
when: not item.stat.exists
153+
138154
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for empty dirs"
139155
when: discovered_root_paths is defined
140156
ansible.builtin.shell: 'echo {{ root_paths }} | grep -q "::" && echo "roots path contains a empty directory (::)"'

tasks/section_6/cis_6.3.4.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
- level2-workstation
2828
- patch
2929
- auditd
30-
- rule_6.3.4.1
3130
- rule_6.3.4.2
3231
- rule_6.3.4.3
32+
- rule_6.3.4.4
3333
- NIST800-53R5_AU-3
3434
ansible.builtin.file:
3535
path: "{{ prelim_auditd_logfile.stdout }}"

templates/audit/99_auditd.rules.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
-w /etc/issue -p wa -k system-locale
5757
-w /etc/issue.net -p wa -k system-locale
5858
-w /etc/hosts -p wa -k system-locale
59+
-w /etc/hostname -p wa -k system-locale
5960
-w /etc/sysconfig/network -p wa -k system-locale
6061
-w /etc/sysconfig/network-scripts -p wa -k system-locale
62+
-w /etc/NetworkManager -p wa -k system-locale
6163
{% endif %}
6264
{% if rhel9cis_rule_6_3_3_6 %}
6365
{% for proc in discovered_priv_procs.stdout_lines -%}

0 commit comments

Comments
 (0)