QA fixes and rollback of audit_only logic

Signed-off-by: Frederick Witty <frederick.witty@gotyto.com>
This commit is contained in:
Frederick Witty 2026-02-11 14:54:30 -05:00
parent 11becb32c5
commit 71206432be
No known key found for this signature in database
GPG key ID: 0CFA99C02DE4D8C3
6 changed files with 9 additions and 37 deletions

View file

@ -86,9 +86,6 @@ audit_max_concurrent: 50
## Only run Audit do not remediate ## Only run Audit do not remediate
audit_only: false audit_only: false
### As part of audit_only ###
# Path to copy the files to will create dir structure in audit_only mode
audit_capture_files_dir: /some/location to copy to on control node
############################# #############################
# How to retrieve audit binary # How to retrieve audit binary
@ -385,7 +382,6 @@ rhel9cis_rule_5_3_3_2_4: true
rhel9cis_rule_5_3_3_2_5: true rhel9cis_rule_5_3_3_2_5: true
rhel9cis_rule_5_3_3_2_6: true rhel9cis_rule_5_3_3_2_6: true
rhel9cis_rule_5_3_3_2_7: true rhel9cis_rule_5_3_3_2_7: true
rhel9cis_rule_5_3_3_2_8: true
# 5.3.3.3 Configure pam_pwhistory module # 5.3.3.3 Configure pam_pwhistory module
# These are added as part of 5.3.2.4 using jinja2 template # These are added as part of 5.3.2.4 using jinja2 template
rhel9cis_rule_5_3_3_3_1: true rhel9cis_rule_5_3_3_3_1: true

View file

@ -7,30 +7,6 @@
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: fetch_audit_output.yml file: fetch_audit_output.yml
- name: Audit_only | Capture audit files to control node
when:
- audit_only
- audit_capture_files_dir is defined
- audit_capture_files_dir | length > 0
block:
- name: Audit_only | Ensure capture directory exists
ansible.builtin.file:
path: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}"
state: directory
mode: 'u=rwx,go=rx'
become: false
delegate_to: localhost
- name: Audit_only | Copy audit files to capture directory
ansible.builtin.fetch:
src: "{{ item }}"
dest: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}/"
flat: true
failed_when: false
loop:
- "{{ pre_audit_outfile }}"
- "{{ post_audit_outfile }}"
- name: Audit_only | Show Audit Summary - name: Audit_only | Show Audit Summary
when: audit_only when: audit_only
ansible.builtin.debug: ansible.builtin.debug:

View file

@ -214,15 +214,15 @@
block: block:
- name: "PRELIM | AUDIT | Discover is wireless adapter on system" - name: "PRELIM | AUDIT | Discover is wireless adapter on system"
ansible.builtin.command: find /sys/class/net/*/ -type d -name wireless ansible.builtin.command: find /sys/class/net/*/ -type d -name wireless
register: discover_wireless_adapters register: prelim_wireless_adapters
changed_when: false changed_when: false
check_mode: false check_mode: false
failed_when: discover_wireless_adapters.rc not in [ 0, 1 ] failed_when: prelim_wireless_adapters.rc not in [ 0, 1 ]
- name: "PRELIM | PATCH | Install Network-Manager | if wireless adapter present" - name: "PRELIM | PATCH | Install Network-Manager | if wireless adapter present"
when: when:
- rhel9cis_install_network_manager - rhel9cis_install_network_manager
- discover_wireless_adapters.rc == 0 - prelim_wireless_adapters.rc == 0
- "'NetworkManager' not in ansible_facts.packages" - "'NetworkManager' not in ansible_facts.packages"
ansible.builtin.package: ansible.builtin.package:
name: NetworkManager name: NetworkManager

View file

@ -44,7 +44,7 @@
- name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled" - name: "3.1.2 | PATCH | Ensure wireless interfaces are disabled"
when: when:
- rhel9cis_rule_3_1_2 - rhel9cis_rule_3_1_2
- discover_wireless_adapters.rc == 0 - prelim_wireless_adapters.rc == 0
tags: tags:
- level1-server - level1-server
- patch - patch

View file

@ -195,7 +195,7 @@
register: discovered_rsyslog_remote_host register: discovered_rsyslog_remote_host
notify: Restart rsyslog notify: Restart rsyslog
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote client" - name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote client"
when: rhel9cis_rule_6_2_3_7 when: rhel9cis_rule_6_2_3_7
tags: tags:
- level1-server - level1-server
@ -208,7 +208,7 @@
- NIST800-53R5_AU-12 - NIST800-53R5_AU-12
- NIST800-53R5_CM-6 - NIST800-53R5_CM-6
block: block:
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote client. | When not log host" - name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote client. | When not log host"
when: not rhel9cis_system_is_log_server when: not rhel9cis_system_is_log_server
ansible.builtin.replace: ansible.builtin.replace:
path: /etc/rsyslog.conf path: /etc/rsyslog.conf
@ -221,7 +221,7 @@
- '^(module\(load="imtcp"\))' - '^(module\(load="imtcp"\))'
- '^(input\(type="imtcp")' - '^(input\(type="imtcp")'
- name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to recieve logs from a remote clients. | When log host" - name: "6.2.3.7 | PATCH | Ensure rsyslog is not configured to receive logs from a remote clients. | When log host"
when: rhel9cis_system_is_log_server when: rhel9cis_system_is_log_server
ansible.builtin.replace: ansible.builtin.replace:
path: /etc/rsyslog.conf path: /etc/rsyslog.conf

View file

@ -206,7 +206,6 @@ rhel9cis_rule_2_4_2_1: {{ rhel9cis_rule_2_4_2_1 }}
rhel9cis_rule_3_1_1: {{ rhel9cis_rule_3_1_1 }} rhel9cis_rule_3_1_1: {{ rhel9cis_rule_3_1_1 }}
rhel9cis_rule_3_1_2: {{ rhel9cis_rule_3_1_2 }} rhel9cis_rule_3_1_2: {{ rhel9cis_rule_3_1_2 }}
rhel9cis_rule_3_1_3: {{ rhel9cis_rule_3_1_3 }} rhel9cis_rule_3_1_3: {{ rhel9cis_rule_3_1_3 }}
rhel9cis_ipv6_disable_method: {{ rhel9cis_ipv6_disable_method }}
## Network Kernel Modules ## Network Kernel Modules
rhel9cis_rule_3_2_1: {{ rhel9cis_rule_3_2_1 }} rhel9cis_rule_3_2_1: {{ rhel9cis_rule_3_2_1 }}
@ -293,7 +292,6 @@ rhel9cis_rule_5_3_3_2_4: {{ rhel9cis_rule_5_3_3_2_4 }}
rhel9cis_rule_5_3_3_2_5: {{ rhel9cis_rule_5_3_3_2_5 }} rhel9cis_rule_5_3_3_2_5: {{ rhel9cis_rule_5_3_3_2_5 }}
rhel9cis_rule_5_3_3_2_6: {{ rhel9cis_rule_5_3_3_2_6 }} rhel9cis_rule_5_3_3_2_6: {{ rhel9cis_rule_5_3_3_2_6 }}
rhel9cis_rule_5_3_3_2_7: {{ rhel9cis_rule_5_3_3_2_7 }} rhel9cis_rule_5_3_3_2_7: {{ rhel9cis_rule_5_3_3_2_7 }}
rhel9cis_rule_5_3_3_2_8: {{ rhel9cis_rule_5_3_3_2_8 }}
# 5.3.3.3 Configure pam_pwhistory module # 5.3.3.3 Configure pam_pwhistory module
# This are added as part of 5.3.2.4 using jinja2 template # This are added as part of 5.3.2.4 using jinja2 template
rhel9cis_rule_5_3_3_3_1: {{ rhel9cis_rule_5_3_3_3_1 }} rhel9cis_rule_5_3_3_3_1: {{ rhel9cis_rule_5_3_3_3_1 }}
@ -532,6 +530,8 @@ rhel9cis_bluetooth_mask: {{ rhel9cis_bluetooth_mask }}
## 3.1 IPv6 requirement toggle ## 3.1 IPv6 requirement toggle
# This variable governs whether ipv6 is enabled or disabled. # This variable governs whether ipv6 is enabled or disabled.
rhel9cis_ipv6_required: {{ rhel9cis_ipv6_required }} rhel9cis_ipv6_required: {{ rhel9cis_ipv6_required }}
# rhel9cis_ipv6_disable defines the method of disabling IPv6, sysctl vs kernel
rhel9cis_ipv6_disable_method: {{ rhel9cis_ipv6_disable_method }}
# 3.3 System network parameters (host only OR host and router) # 3.3 System network parameters (host only OR host and router)
# This variable governs whether specific CIS rules # This variable governs whether specific CIS rules