Skip to content

Commit

Permalink
Only run harding if /var/log/audit exists
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
mego22 authored Jul 13, 2022
1 parent b6f3294 commit 9d6903e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/os_hardening/tasks/minimize_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@
group: 'root'
mode: '{{ os_mnt_var_log_dir_mode }}'

- name: Check if /var/log/audit exists
stat:
path: /var/log/audit
register: var_log_audit_exists

- name: Mount /var/log/audit with hardened options
mount:
path: /var/log/audit
Expand All @@ -224,6 +229,7 @@
owner: 'root'
group: 'root'
mode: '{{ os_mnt_var_log_audit_dir_mode }}'
when: var_log_audit_exists.stat.exists | bool

- name: Mount /var/tmp with hardened options
mount:
Expand Down

0 comments on commit 9d6903e

Please sign in to comment.