From b2575a97d1db727713f8f09abc12555284de5ee5 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 10 Jan 2024 17:55:08 -0600 Subject: [PATCH] fix(auditd): add lint and debug --- .../tasks/type-files/redhat-7-type.yml | 17 +++++++++++++---- .../tasks/type-files/ubuntu-18-type.yml | 11 ++++++++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/roles/cis_security/tasks/type-files/redhat-7-type.yml b/roles/cis_security/tasks/type-files/redhat-7-type.yml index 20ee261..7a6e291 100644 --- a/roles/cis_security/tasks/type-files/redhat-7-type.yml +++ b/roles/cis_security/tasks/type-files/redhat-7-type.yml @@ -1616,12 +1616,21 @@ - {find: '^admin_space_left_action\s+=\s+((?!suspend).)*$', replace: 'admin_space_left_action = suspend'} # 4.1.1.2 notify: Restart auditd tags: - - 4.1.1.2 - - 4.1.1.3 + - 4.1.2.1 + - 4.1.2.2 + - 4.1.2.3 + + - name: 4.1.2.[1-2] - Get AuditD config + ansible.builtin.shell: cat /etc/audit/auditd.conf + register: auditd_conf + tags: + - 4.1.2.1 + - 4.1.2.2 + - 4.1.2.3 - - name: 4.1.2.[1-2] - Print new AuditD config + - name: 4.1.2.[1-2] - Print AutidD config ansible.builtin.debug: - msg: "{{ lookup('file', '/etc/audit/auditd.conf') }}" + msg: "{{ auditd_conf.stdout }}" tags: - 4.1.2.1 - 4.1.2.2 diff --git a/roles/cis_security/tasks/type-files/ubuntu-18-type.yml b/roles/cis_security/tasks/type-files/ubuntu-18-type.yml index 202df89..91815a7 100644 --- a/roles/cis_security/tasks/type-files/ubuntu-18-type.yml +++ b/roles/cis_security/tasks/type-files/ubuntu-18-type.yml @@ -1576,8 +1576,17 @@ - 4.1.2.2 - 4.1.2.3 - - name: 4.1.2.[1-2] - Print new AuditD config on remote host + - name: 4.1.2.[1-2] - Get AuditD config ansible.builtin.shell: cat /etc/audit/auditd.conf + register: auditd_conf + tags: + - 4.1.2.1 + - 4.1.2.2 + - 4.1.2.3 + + - name: 4.1.2.[1-2] - Print AutidD config + ansible.builtin.debug: + msg: "{{ auditd_conf.stdout }}" tags: - 4.1.2.1 - 4.1.2.2