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

auditd: add possibility to override config template #685

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions roles/os_hardening/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,13 @@ os_hardening_enabled: true

# Set to false to disable installing and configuring auditd.
os_auditd_enabled: true
os_auditd_template: etc/audit/auditd.conf.j2
os_auditd_flush: INCREMENTAL
os_auditd_freq: 20
os_auditd_max_log_file: 6
os_auditd_max_log_file_action: keep_logs
os_auditd_write_logs: true
os_auditd_log_file: /var/log/audit/audit.log
os_auditd_log_format: RAW
os_auditd_admin_space_left: 50
os_auditd_space_left: 75
Expand Down
2 changes: 1 addition & 1 deletion roles/os_hardening/tasks/auditd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- name: Configure auditd | package-08
ansible.builtin.template:
src: etc/audit/auditd.conf.j2
src: "{{ os_auditd_template }}"
dest: /etc/audit/auditd.conf
owner: root
group: root
Expand Down
5 changes: 3 additions & 2 deletions roles/os_hardening/templates/etc/audit/auditd.conf.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{{ ansible_managed | comment }}
# Generated by Ansible role {{ ansible_role_name }}

log_file = /var/log/audit/audit.log
write_logs = {{ os_auditd_write_logs | bool | ternary('yes', 'no') }}
log_file = {{ os_auditd_log_file }}
log_format = {{ os_auditd_log_format }}
log_group = {{ os_auditd_log_group }}
priority_boost = 4
flush = {{ os_auditd_flush }}
freq = 20
freq = {{ os_auditd_freq }}
num_logs = {{ os_auditd_num_logs }}
disp_qos = lossy
dispatcher = /sbin/audispd
Expand Down
Loading