File tree Expand file tree Collapse file tree 2 files changed +56
-3
lines changed
inventory/group_vars/cis-hardening Expand file tree Collapse file tree 2 files changed +56
-3
lines changed Original file line number Diff line number Diff line change 11---
2- - name : Security hardening
2+ - name : CIS - Ensure existing AIDE installation is cleaned
3+ hosts : cis-hardening
4+ become : true
5+ tags :
6+ - cis
7+ gather_facts : true
8+ tasks :
9+ - name : Gather package facts
10+ ansible.builtin.package_facts :
11+ manager : auto
12+
13+ - name : Check if AIDE cleanup has already run
14+ ansible.builtin.stat :
15+ path : /opt/kayobe/aide/aide_cleanup_complete.flag
16+ register : aide_cleanup_flag
17+
18+ - name : Cleanup existing AIDE config
19+ when :
20+ - " 'aide' in ansible_facts.packages"
21+ - not aide_cleanup_flag.stat.exists
22+ - ansible_facts.distribution == 'Ubuntu'
23+ block :
24+ - name : Ensure AIDE packages is removed
25+ ansible.builtin.apt :
26+ name :
27+ - aide
28+ - aide-common
29+ state : absent
30+ purge : true
31+
32+ - name : Ensure flag directory exists
33+ ansible.builtin.file :
34+ path : /opt/kayobe/aide
35+ state : directory
36+ mode : ' 0755'
37+ owner : stack
38+ group : stack
39+
40+ - name : Create flag file to prevent re-running cleanup
41+ ansible.builtin.file :
42+ path : /opt/kayobe/aide/aide_cleanup_complete.flag
43+ state : touch
44+ mode : ' 0644'
45+ owner : stack
46+ group : stack
47+
48+ - name : CIS - General Prerequisites
349 hosts : cis-hardening
450 become : true
551 tags :
3177 - " {{ kayobe_ansible_user }}"
3278 - " {{ kolla_ansible_user }}"
3379
80+ - name : Security hardening
81+ hosts : cis-hardening
82+ become : true
83+ tags :
84+ - cis
85+ tasks :
3486 - name : Run CIS hardening role (RHEL 9)
3587 ansible.builtin.include_role :
3688 name : ansible-lockdown.rhel9_cis
Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ ubtu24cis_syslog_service: journald
9898# Allow rsync server
9999ubtu24cis_rsync_server: true
100100
101+ # AIDE is very slow to init, especially on an AIO in CI
102+ ubtu24cis_aide_init_async: 1800
103+
101104# Do not change Chrony Time servers
102105ubtu24cis_rule_2_3_3_1: false
103106ubtu24cis_rule_2_3_3_2: false
@@ -152,8 +155,6 @@ ubtu24cis_ownership_adjust: false
152155ubtu24cis_no_world_write_adjust: false
153156ubtu24cis_suid_sgid_adjust: false
154157
155- # Prevent hardening from recursivley changing permissions on log files
156-
157158# Configure log rotation to prevent audit logs from filling the disk
158159ubtu24cis_auditd:
159160 action_mail_acct: root
You can’t perform that action at this time.
0 commit comments