forked from ansible-lockdown/RHEL9-CIS
Merge pull request #368 from ansible-lockdown/devel
July 25 Release to main
This commit is contained in:
commit
751fac8a0c
9 changed files with 465 additions and 285 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -25,7 +25,7 @@
|
||||||
dest: /etc/audit/rules.d/99_auditd.rules
|
dest: /etc/audit/rules.d/99_auditd.rules
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 'u-x,go-wx'
|
mode: 'u-x,g-wx,o-rwx'
|
||||||
diff: "{{ discovered_auditd_rules_file.stat.exists }}" # Only run diff if not a new file
|
diff: "{{ discovered_auditd_rules_file.stat.exists }}" # Only run diff if not a new file
|
||||||
register: discovered_auditd_rules_template_updated
|
register: discovered_auditd_rules_template_updated
|
||||||
notify:
|
notify:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: "1/.1 | PATCH | Ensure /var/log is a separate partition"
|
- name: "1.1.2.6.1 | PATCH | Ensure /var/log is a separate partition"
|
||||||
when:
|
when:
|
||||||
- rhel9cis_rule_1_1_2_6_1
|
- rhel9cis_rule_1_1_2_6_1
|
||||||
- required_mount not in prelim_mount_names
|
- required_mount not in prelim_mount_names
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: "1/.1 | PATCH | Ensure /var/log/audit is a separate partition"
|
- name: "1.1.2.7.1 | PATCH | Ensure /var/log/audit is a separate partition"
|
||||||
when:
|
when:
|
||||||
- rhel9cis_rule_1_1_2_7_1
|
- rhel9cis_rule_1_1_2_7_1
|
||||||
- required_mount not in prelim_mount_names
|
- required_mount not in prelim_mount_names
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
file: cis_1.2.2.x.yml
|
file: cis_1.2.2.x.yml
|
||||||
|
|
||||||
- name: "SECTION | 1.3.1 | Configure SELinux"
|
- name: "SECTION | 1.3.1 | Configure SELinux"
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.import_tasks:
|
||||||
file: cis_1.3.1.x.yml
|
file: cis_1.3.1.x.yml
|
||||||
|
|
||||||
- name: "SECTION | 1.4 | Configure Bootloader"
|
- name: "SECTION | 1.4 | Configure Bootloader"
|
||||||
|
|
|
||||||
|
|
@ -240,12 +240,12 @@
|
||||||
- rule_3.3.9
|
- rule_3.3.9
|
||||||
- NIST800-53R5_AU-3
|
- NIST800-53R5_AU-3
|
||||||
block:
|
block:
|
||||||
- name: "3.3.4 | PATCH | Ensure suspicious packets are logged | Set Fact"
|
- name: "3.3.9 | PATCH | Ensure suspicious packets are logged | Set Fact"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
rhel9cis_sysctl_update: true
|
rhel9cis_sysctl_update: true
|
||||||
rhel9cis_flush_ipv4_route: true
|
rhel9cis_flush_ipv4_route: true
|
||||||
|
|
||||||
- name: "3.3.4 | PATCH | Ensure suspicious packets are logged"
|
- name: "3.3.9 | PATCH | Ensure suspicious packets are logged"
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv4_sysctl.conf"
|
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv4_sysctl.conf"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
- level1-server
|
- level1-server
|
||||||
- level1-workstation
|
- level1-workstation
|
||||||
- patch
|
- patch
|
||||||
- rule_5.4.2.2
|
- rule_5.4.2.3
|
||||||
- user
|
- user
|
||||||
- system
|
- system
|
||||||
- NIST800-53R5_CM-1
|
- NIST800-53R5_CM-1
|
||||||
|
|
@ -135,6 +135,22 @@
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
root_paths: "{{ discovered_root_paths.stdout }}"
|
root_paths: "{{ discovered_root_paths.stdout }}"
|
||||||
|
|
||||||
|
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for presence of non-dirs"
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ item }}"
|
||||||
|
loop: "{{ discovered_root_paths_split.stdout_lines }}"
|
||||||
|
register: paths_stat
|
||||||
|
|
||||||
|
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Create dirs for some paths that are not dirs"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item.item }}"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 'go-w'
|
||||||
|
loop: "{{ paths_stat.results }}"
|
||||||
|
when: not item.stat.exists
|
||||||
|
|
||||||
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for empty dirs"
|
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for empty dirs"
|
||||||
when: discovered_root_paths is defined
|
when: discovered_root_paths is defined
|
||||||
ansible.builtin.shell: 'echo {{ root_paths }} | grep -q "::" && echo "roots path contains a empty directory (::)"'
|
ansible.builtin.shell: 'echo {{ root_paths }} | grep -q "::" && echo "roots path contains a empty directory (::)"'
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@
|
||||||
- level2-workstation
|
- level2-workstation
|
||||||
- patch
|
- patch
|
||||||
- auditd
|
- auditd
|
||||||
- rule_6.3.4.1
|
|
||||||
- rule_6.3.4.2
|
- rule_6.3.4.2
|
||||||
- rule_6.3.4.3
|
- rule_6.3.4.3
|
||||||
|
- rule_6.3.4.4
|
||||||
- NIST800-53R5_AU-3
|
- NIST800-53R5_AU-3
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ prelim_auditd_logfile.stdout }}"
|
path: "{{ prelim_auditd_logfile.stdout }}"
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,10 @@
|
||||||
-w /etc/issue -p wa -k system-locale
|
-w /etc/issue -p wa -k system-locale
|
||||||
-w /etc/issue.net -p wa -k system-locale
|
-w /etc/issue.net -p wa -k system-locale
|
||||||
-w /etc/hosts -p wa -k system-locale
|
-w /etc/hosts -p wa -k system-locale
|
||||||
|
-w /etc/hostname -p wa -k system-locale
|
||||||
-w /etc/sysconfig/network -p wa -k system-locale
|
-w /etc/sysconfig/network -p wa -k system-locale
|
||||||
-w /etc/sysconfig/network-scripts -p wa -k system-locale
|
-w /etc/sysconfig/network-scripts -p wa -k system-locale
|
||||||
|
-w /etc/NetworkManager -p wa -k system-locale
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rhel9cis_rule_6_3_3_6 %}
|
{% if rhel9cis_rule_6_3_3_6 %}
|
||||||
{% for proc in discovered_priv_procs.stdout_lines -%}
|
{% for proc in discovered_priv_procs.stdout_lines -%}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue