From 876b5d350895296dd8b876b85764eca00f847833 Mon Sep 17 00:00:00 2001 From: Mark Bolwell Date: Thu, 12 Jan 2023 15:01:59 +0000 Subject: [PATCH] improved find Signed-off-by: Mark Bolwell --- tasks/section_4/cis_4.2.3.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/section_4/cis_4.2.3.yml b/tasks/section_4/cis_4.2.3.yml index 3fa195c..a7a623a 100644 --- a/tasks/section_4/cis_4.2.3.yml +++ b/tasks/section_4/cis_4.2.3.yml @@ -5,14 +5,17 @@ - name: "4.2.3 | AUDIT | Ensure permissions on all logfiles are configured | find files" ansible.builtin.find: paths: "/var/log" - type: file + file_type: file + recurse: true register: logfiles - name: "4.2.3 | AUDIT | Ensure permissions on all logfiles are configured | find files" ansible.builtin.file: - paths: "{{ item.path }}" + path: "{{ item.path }}" mode: 0640 - register: logfiles + loop: "{{ logfiles.files }}" + loop_control: + label: "{{ item.path }}" when: - rhel9cis_rule_4_2_3 tags: