mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2026-03-25 22:37:11 +00:00
Merge branch 'benchmark_v2.0.0' into interactive_user_update
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
commit
3197252611
7 changed files with 24 additions and 21 deletions
|
|
@ -1,15 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Audit_Only | Create local Directories for hosts
|
||||
when: fetch_audit_files
|
||||
ansible.builtin.file:
|
||||
mode: 'u+x,go-w'
|
||||
path: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}"
|
||||
recurse: true
|
||||
state: directory
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Audit_only | Show Audit Summary
|
||||
when: audit_only
|
||||
ansible.builtin.debug:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@
|
|||
success_msg: "This role is running a supported version of ansible {{ ansible_version.full }} >= {{ min_ansible_version }}"
|
||||
|
||||
- name: "Setup rules if container"
|
||||
when: ansible_connection == 'docker' or ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
|
||||
when:
|
||||
- ansible_connection == 'docker' or
|
||||
ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"
|
||||
tags:
|
||||
- container_discovery
|
||||
- always
|
||||
|
|
|
|||
|
|
@ -254,6 +254,14 @@
|
|||
mode: 'go-rwx'
|
||||
state: touch
|
||||
|
||||
- name: "PRELIM | PATCH | sshd_config.d/50-redhat.conf exists"
|
||||
when:
|
||||
- rhel9cis_rule_5_1_10 or
|
||||
rhel9cis_rule_5_1_11
|
||||
ansible.builtin.stat:
|
||||
path: /etc/ssh/sshd_config.d/50-redhat.conf
|
||||
register: discovered_sshd_50_redhat_file
|
||||
|
||||
- name: "PRELIM | AUDIT | Capture pam security related files"
|
||||
tags: always
|
||||
ansible.builtin.find:
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
warn_control_id: '3.1.2'
|
||||
block:
|
||||
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled | Check for network-manager tool"
|
||||
when: "'network-manager' in ansible_facts.packages"
|
||||
when: "rhel9cis_network_manager_package_name in ansible_facts.packages"
|
||||
ansible.builtin.command: nmcli radio wifi
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
|
@ -48,19 +48,19 @@
|
|||
|
||||
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled | Disable wireless if network-manager installed"
|
||||
when:
|
||||
- "'network-manager' in ansible_facts.packages"
|
||||
- "rhel9cis_network_manager_package_name in ansible_facts.packages"
|
||||
- "'enabled' in discovered_wifi_status.stdout"
|
||||
ansible.builtin.command: nmcli radio all off
|
||||
changed_when: discovered_nmcli_radio_off.rc == 0
|
||||
register: discovered_nmcli_radio_off
|
||||
|
||||
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled | Warn about wireless if network-manager not installed"
|
||||
when: "'network-manager' not in ansible_facts.packages"
|
||||
when: "rhel9cis_network_manager_package_name not in ansible_facts.packages"
|
||||
ansible.builtin.debug:
|
||||
msg: "Warning!! You need to disable wireless interfaces manually since network-manager is not installed"
|
||||
|
||||
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled | Set warning count"
|
||||
when: "'network-manager' not in ansible_facts.packages"
|
||||
when: "rhel9cis_network_manager_package_name not in ansible_facts.packages"
|
||||
ansible.builtin.import_tasks:
|
||||
file: warning_facts.yml
|
||||
|
||||
|
|
|
|||
|
|
@ -276,6 +276,7 @@
|
|||
notify: Restart sshd
|
||||
|
||||
- name: "5.1.10 | PATCH | Ensure sshd DisableForwarding is enabled | override"
|
||||
when: discovered_sshd_50_redhat_file.stat.exists
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config.d/50-redhat.conf
|
||||
regexp: ^(?i)(#|)\s*X11Forwarding
|
||||
|
|
@ -298,6 +299,7 @@
|
|||
- NIST800-53R5_IA-5
|
||||
block:
|
||||
- name: "5.1.11 | PATCH | Ensure sshd GSSAPIAuthentication is disabled | redhat file"
|
||||
when: discovered_sshd_50_redhat_file.stat.exists
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config.d/50-redhat.conf
|
||||
regexp: ^(?i)(#|)\s*GSSAPIAuthentication
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@
|
|||
- name: "7.2.7 | AUDIT | Ensure no duplicate group names exist | Print warning about users with duplicate group names"
|
||||
when: discovered_group_check.stdout | length > 0
|
||||
ansible.builtin.debug:
|
||||
msg: "Warning!! The following group names are duplicates: {{ discovered_group_group_check.stdout_lines }}"
|
||||
msg: "Warning!! The following group names are duplicates: {{ discovered_group_check.stdout_lines }}"
|
||||
|
||||
- name: "7.2.7 | AUDIT | Ensure no duplicate group names exist | Set warning count"
|
||||
when: discovered_group_check.stdout | length > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue