From 4b50ad4b4621f9eb20c68d60a47213213c250015 Mon Sep 17 00:00:00 2001 From: Vojtech Polasek Date: Fri, 29 Jan 2021 16:04:11 +0100 Subject: [PATCH] remove bogus output of ansible remediation for dir_perms_world_writable_root_owned --- .../ansible/shared.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/linux_os/guide/system/permissions/files/dir_perms_world_writable_root_owned/ansible/shared.yml b/linux_os/guide/system/permissions/files/dir_perms_world_writable_root_owned/ansible/shared.yml index 893bc9e713c..ec697f5b60e 100644 --- a/linux_os/guide/system/permissions/files/dir_perms_world_writable_root_owned/ansible/shared.yml +++ b/linux_os/guide/system/permissions/files/dir_perms_world_writable_root_owned/ansible/shared.yml @@ -47,9 +47,17 @@ recurse: yes register: found_dirs +- name: "Create list of world writable directories" + set_fact: + world_writable_dirs: "{{ found_dirs.files | selectattr('woth') | list }}" + +- name: "debug" + debug: + msg: "{{ world_writable_dirs }}" + - name: "Change owner to root on directories which are world writable" file: path: '{{ item.path }}' owner: root - loop: '{{ found_dirs.files }}' - when: item.woth + loop: '{{ world_writable_dirs }}' + ignore_errors: yes