diff --git a/ansible/playbooks/handlers/main.yml b/ansible/playbooks/handlers/main.yml index cca72d1..c4fed87 100644 --- a/ansible/playbooks/handlers/main.yml +++ b/ansible/playbooks/handlers/main.yml @@ -13,3 +13,12 @@ service: name: NetworkManager state: reloaded + +- name: regenerate_auditd_rules + command: /sbin/augenrules + +- name: restart_auditd + service: + name: auditd + state: restarted + diff --git a/ansible/playbooks/init-rocky-system-config.yml b/ansible/playbooks/init-rocky-system-config.yml index 254a27b..10b7e27 100644 --- a/ansible/playbooks/init-rocky-system-config.yml +++ b/ansible/playbooks/init-rocky-system-config.yml @@ -35,4 +35,7 @@ file: path: /var/log/ansible.run state: touch + mode: '0644' + user: root + group: root diff --git a/ansible/playbooks/tasks/harden.yml b/ansible/playbooks/tasks/harden.yml index dccbad7..264b1d1 100644 --- a/ansible/playbooks/tasks/harden.yml +++ b/ansible/playbooks/tasks/harden.yml @@ -21,6 +21,9 @@ - name: security limits copy: dest: "/etc/security/limits.d/cis.conf" + user: root + group: root + mode: '0644' content: | * hard core 0 @@ -109,27 +112,29 @@ state: present tags: - harden - + - name: Ensure auditd buffer is OK replace: path: /etc/audit/rules.d/audit.rules regexp: '-b \d+' replace: '-b {{ audit_buffer }}' notify: - - regenerate auditd rules - tags: - - harden - - - name: Ensure collection audit rules are available - template: - src: "etc/audit/rules.d/collection.rules.j2" - dest: "/etc/audit/rules.d/collection.rules" - owner: root - group: root - backup: yes - notify: - - regenerate auditd rules - - restart auditd + - regenerate_auditd_rules tags: - harden +# Leaving this out for now as we don't know the implications of the audit rules +# on build systems yet. +# - name: Ensure collection audit rules are available +# template: +# src: "etc/audit/rules.d/collection.rules.j2" +# dest: "/etc/audit/rules.d/collection.rules" +# owner: root +# group: root +# backup: yes +# notify: +# - regenerate_auditd rules +# - restart_auditd +# tags: +# - harden + diff --git a/ansible/playbooks/tasks/ssh-config.yml b/ansible/playbooks/tasks/ssh-config.yml index a320a19..3accb0a 100644 --- a/ansible/playbooks/tasks/ssh-config.yml +++ b/ansible/playbooks/tasks/ssh-config.yml @@ -23,6 +23,7 @@ dest: "/etc/rockybanner" owner: root group: root + mode: '0644' notify: restart_ssh - name: Remove dsa keys