mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-24 22:23:06 +00:00
auditd, sysctl, become tidy up
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
b934cbef3f
commit
4336bbf6b6
3 changed files with 49 additions and 57 deletions
25
tasks/auditd.yml
Normal file
25
tasks/auditd.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
- name: POST | AUDITD | Apply auditd template will for section 4.1.3 - only required rules will be added
|
||||
template:
|
||||
src: audit/99_auditd.rules.j2
|
||||
dest: /etc/audit/rules.d/99_auditd.rules
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
register: audit_rules_updated
|
||||
notify: restart auditd
|
||||
|
||||
- name: POST | AUDITD | Discover if auditd immutable - Set reboot required if auditd immutable
|
||||
block:
|
||||
- name: POST | AUDITD | Discover if auditd immutable - will require reboot if auditd template applied
|
||||
shell: grep -c "^-e 2" /etc/audit/rules.d/99_auditd.rules
|
||||
changed_when: false
|
||||
register: auditd_immutable_check
|
||||
|
||||
- name: POST | AUDITD | Set reboot required if auditd immutable
|
||||
debug:
|
||||
msg: "Reboot required for auditd to apply new rules as immutable set"
|
||||
notify: change_requires_reboot
|
||||
when:
|
||||
- auditd_immutable_check.stdout == '1'
|
||||
when:
|
||||
- audit_rules_updated.changed
|
||||
Loading…
Add table
Add a link
Reference in a new issue