Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final updates for v1.0.0 #251

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,35 +138,32 @@
- always

- name: "PRELIM | PATCH | Ensure auditd is installed"
block:
- name: "PRELIM | PATCH | Ensure auditd is installed"
ansible.builtin.package:
name: ['auditd', 'audispd-plugins']
state: present
when:
- "'auditd' not in ansible_facts.packages or
'auditd-plugins' not in ansible_facts.packages"

- name: "PRELIM | AUDIT | Audit conf and rules files | list files"
ansible.builtin.find:
path: /etc/audit/
file_type: file
recurse: true
patterns: '*.conf,*.rules'
register: auditd_conf_files

ansible.builtin.package:
name: ['auditd', 'audispd-plugins']
state: present
when:
- ubtu22cis_rule_4_1_1_1 or
ubtu22cis_rule_4_1_4_5 or
ubtu22cis_rule_4_1_4_6 or
ubtu22cis_rule_4_1_4_7
- "'auditd' not in ansible_facts.packages or
'auditd-plugins' not in ansible_facts.packages"
- ubtu22cis_rule_4_1_1_1
tags:
- level2-server
- level2-workstation
- patch
- auditd
- always

- name: "PRELIM | AUDIT | Audit conf and rules files | list files"
ansible.builtin.find:
path: /etc/audit/
file_type: file
recurse: true
patterns: '*.conf,*.rules'
register: auditd_conf_files
tags:
- patch
- auditd
- always

- name: "PRELIM | AUDIT | Check if auditd is immutable before changes"
ansible.builtin.shell: auditctl -l | grep -c '-e 2'
changed_when: false
Expand Down
2 changes: 2 additions & 0 deletions tasks/section_6/cis_6.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
owner: root
group: root
mode: '0644'
failed_when: discovered_file_exists.state not in '[ file, absent ]'
register: discovered_file_exists
when:
- ubtu22cis_rule_6_1_2
tags:
Expand Down