Skip to content

Commit

Permalink
add more conditionals to when auditd show be hardened
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
  • Loading branch information
Sebastian Gumprich committed Jul 15, 2022
1 parent 862edbb commit 26e37ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roles/os_hardening/tasks/minimize_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@
opts: '{{ os_mnt_var_log_audit_options }}'
state: present
register: varlogauditmount
when: os_mnt_var_log_audit_enabled | bool
when:
- os_mnt_var_log_audit_enabled | bool
- var_log_audit_exists.stat.exists | bool
- os_auditd_enabled | bool

- name: Harden permissions for /var/log/audit directory
file:
Expand All @@ -230,6 +233,7 @@
group: 'root'
mode: '{{ os_mnt_var_log_audit_dir_mode }}'
when:
- os_mnt_var_log_audit_enabled | bool
- var_log_audit_exists.stat.exists | bool
- os_auditd_enabled | bool

Expand Down

0 comments on commit 26e37ca

Please sign in to comment.