2022-01-07 09:06:18 +00:00
|
|
|
---
|
|
|
|
|
|
2022-04-05 10:24:47 +01:00
|
|
|
# The CIS Control wants IPv6 disabled if not in use.
|
2022-03-30 11:22:30 +01:00
|
|
|
# We are using the rhel9cis_ipv6_required to specify if you have IPv6 in use
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified"
|
2022-06-20 17:03:18 +01:00
|
|
|
block:
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | refresh"
|
2023-01-12 13:38:50 +00:00
|
|
|
ansible.builtin.set_fact:
|
2023-03-01 09:17:38 +00:00
|
|
|
rhel9cis_sysctl_update: true
|
|
|
|
|
rhel9cis_flush_ipv6_route: true
|
2022-06-20 17:03:18 +01:00
|
|
|
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.1 | PATCH | Ensure IPv6 status is identified | disable"
|
2023-01-12 13:38:50 +00:00
|
|
|
ansible.builtin.debug:
|
2022-06-20 17:03:18 +01:00
|
|
|
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-disable_ipv6.conf"
|
2022-01-07 09:06:18 +00:00
|
|
|
when:
|
2022-03-30 11:22:30 +01:00
|
|
|
- not rhel9cis_ipv6_required
|
2022-01-07 09:06:18 +00:00
|
|
|
- rhel9cis_rule_3_1_1
|
|
|
|
|
tags:
|
|
|
|
|
- level1-server
|
|
|
|
|
- level1-workstation
|
2022-03-30 11:22:30 +01:00
|
|
|
- manual
|
2022-01-07 09:06:18 +00:00
|
|
|
- patch
|
2022-03-30 11:22:30 +01:00
|
|
|
- ipv6
|
|
|
|
|
- networking
|
2022-01-07 09:06:18 +00:00
|
|
|
- rule_3.1.1
|
|
|
|
|
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled"
|
2022-03-30 11:22:30 +01:00
|
|
|
block:
|
2023-09-21 14:57:25 +01:00
|
|
|
- name: "3.1.2 | AUDIT | Ensure wireless interfaces are disabled | Check if nmcli command is available | if wlan exists"
|
2023-01-13 12:10:18 +00:00
|
|
|
ansible.builtin.shell: rpm -q NetworkManager
|
2022-03-30 11:22:30 +01:00
|
|
|
changed_when: false
|
|
|
|
|
failed_when: false
|
2022-09-16 11:19:01 +01:00
|
|
|
check_mode: false
|
2023-01-24 11:02:32 +00:00
|
|
|
register: rhel_09_nmcli_available
|
2022-03-30 11:22:30 +01:00
|
|
|
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.2 | AUDIT | Ensure wireless interfaces are disabled | Check if wifi is enabled"
|
2023-01-13 12:10:18 +00:00
|
|
|
ansible.builtin.shell: nmcli radio wifi
|
2023-01-24 11:02:32 +00:00
|
|
|
register: rhel_09_wifi_enabled
|
|
|
|
|
changed_when: rhel_09_wifi_enabled.stdout != "disabled"
|
2022-03-30 11:22:30 +01:00
|
|
|
failed_when: false
|
2023-01-24 11:02:32 +00:00
|
|
|
when: rhel_09_nmcli_available.rc == 0
|
2022-03-30 11:22:30 +01:00
|
|
|
|
2023-01-10 11:18:45 +00:00
|
|
|
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled | Disable wifi if enabled"
|
2023-01-13 12:10:18 +00:00
|
|
|
ansible.builtin.shell: nmcli radio all off
|
2022-03-30 11:22:30 +01:00
|
|
|
changed_when: false
|
|
|
|
|
failed_when: false
|
2023-07-26 16:50:48 +01:00
|
|
|
when: rhel_09_wifi_enabled is changed # noqa no-handler
|
2022-03-30 11:22:30 +01:00
|
|
|
when:
|
2023-01-10 11:18:45 +00:00
|
|
|
- rhel9cis_rule_3_1_2
|
2023-09-21 14:57:25 +01:00
|
|
|
- "'wlan' in ansible_facts.interfaces"
|
2022-03-30 11:22:30 +01:00
|
|
|
tags:
|
|
|
|
|
- level1-server
|
|
|
|
|
- patch
|
|
|
|
|
- wireless
|
2023-01-10 11:18:45 +00:00
|
|
|
- rule_3.1.2
|
|
|
|
|
|
|
|
|
|
- name: "3.1.3 | PATCH | Ensure TIPC is disabled"
|
2023-01-19 11:28:53 +00:00
|
|
|
block:
|
|
|
|
|
- name: "3.1.3 | PATCH | Ensure TIPC is disabled"
|
|
|
|
|
ansible.builtin.template:
|
|
|
|
|
src: "etc/modprobe.d/modprobe.conf.j2"
|
|
|
|
|
dest: "/etc/modprobe.d/{{ item }}.conf"
|
|
|
|
|
mode: "0600"
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
2023-01-25 11:36:12 +00:00
|
|
|
loop:
|
2023-01-26 12:10:10 +00:00
|
|
|
- tipc
|
|
|
|
|
# note the item used in the template
|
2023-01-19 11:28:53 +00:00
|
|
|
|
|
|
|
|
- name: "3.1.3 | PATCH | Ensure TIPC is disabled | blacklist"
|
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
|
path: /etc/modprobe.d/blacklist.conf
|
|
|
|
|
regexp: "^(#)?blacklist tipc(\\s|$)"
|
|
|
|
|
line: "blacklist tipc"
|
|
|
|
|
create: true
|
2023-09-21 16:25:59 +01:00
|
|
|
mode: '0600'
|
2023-01-10 11:18:45 +00:00
|
|
|
when:
|
|
|
|
|
- rhel9cis_rule_3_1_3
|
|
|
|
|
tags:
|
|
|
|
|
- level2-server
|
|
|
|
|
- level2-workstation
|
|
|
|
|
- patch
|
|
|
|
|
- tipc
|
|
|
|
|
- rule_3.1.3
|