Skip to content

Commit

Permalink
Merge pull request #436 from ansible-lockdown/Nov24_logic_updates
Browse files Browse the repository at this point in the history
Nov24 logic updates
  • Loading branch information
uk-bolly authored Dec 3, 2024
2 parents d1bf968 + ca8dd72 commit 89166c3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
1 change: 0 additions & 1 deletion tasks/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- name: POST | Perform DNF package cleanup
ansible.builtin.dnf:
autoremove: true
changed_when: false

- name: POST | flush handlers
ansible.builtin.meta: flush_handlers
Expand Down
52 changes: 29 additions & 23 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,30 +193,10 @@
check_mode: false
register: prelim_sudoers_files

- name: "PRELIM | AUDIT | Check authselect package versions"
tags:
- always
- authselect
vars:
warn_control_id: 'authselect_pkg_version_too_low'
authselect_pkg_version: 1.2.6
block:
- name: "PRELIM | AUDIT | Check authselect package versions | set fact"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '>=')
ansible.builtin.set_fact:
authselect_version: OK

- name: "PRELIM | WARNING | Check authselect package versions | Warning"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '<')
ansible.builtin.debug:
msg: "Warning!! Authselect controls won't run as authselect pkg version too low"

- name: "PRELIM | WARNING | Check authselect package versions | Warning"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '<')
ansible.builtin.import_tasks:
file: warning_facts.yml

- name: "PRELIM | AUDIT | Check pam package versions"
when:
- "'pam' in ansible_facts.packages"
- rhel8cis_rule_4_4_1_1
tags:
- always
vars:
Expand Down Expand Up @@ -245,6 +225,32 @@
ansible.builtin.import_tasks:
file: warning_facts.yml

- name: "PRELIM | AUDIT | Check authselect package versions"
when:
- "'authselect' in ansible_facts.packages"
- rhel8cis_rule_4_4_1_2
tags:
- always
- authselect
vars:
warn_control_id: 'authselect_pkg_version_too_low'
authselect_pkg_version: 1.2.6
block:
- name: "PRELIM | AUDIT | Check authselect package versions | set fact"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '>=')
ansible.builtin.set_fact:
authselect_version: OK

- name: "PRELIM | WARNING | Check authselect package versions | Warning"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '<')
ansible.builtin.debug:
msg: "Warning!! Authselect controls won't run as authselect pkg version too low"

- name: "PRELIM | WARNING | Check authselect package versions | Warning"
when: ansible_facts.packages.authselect[0].version is version(authselect_pkg_version, '<')
ansible.builtin.import_tasks:
file: warning_facts.yml

- name: "PRELIM | AUDIT | Interactive User accounts home directories"
tags:
- always
Expand Down
2 changes: 2 additions & 0 deletions tasks/section_4/cis_4.4.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- name: "4.4.1.1 | PATCH | Ensure latest version of pam is installed"
when:
- rhel8cis_rule_4_4_1_1
- pam_version is not defined or pam_version != 'OK'
tags:
- level1-server
- level1-workstation
Expand All @@ -18,6 +19,7 @@
when:
- rhel8cis_rule_4_4_1_2
- rhel8cis_authselect_pkg_update
- authselect_version is not defined or authselect__version != 'OK'
tags:
- level1-server
- level1-workstation
Expand Down

0 comments on commit 89166c3

Please sign in to comment.