diff --git a/tasks/section_4/cis_4.5.x.yml b/tasks/section_4/cis_4.5.x.yml index 9f851614..cc89671b 100644 --- a/tasks/section_4/cis_4.5.x.yml +++ b/tasks/section_4/cis_4.5.x.yml @@ -75,14 +75,13 @@ - name: "4.5.4 | PATCH | Ensure default user umask is 027 or more restrictive" ansible.builtin.lineinfile: - path: "{{ item }}" - regexp: '(?i)(umask\s*)' - line: '\g<1>{{ ubtu20cis_bash_umask }}' - backrefs: true + path: "{{ item.path }}" + regexp: '(?i)(umask\s*\d\d\d)' + line: '{{ item.line }} {{ ubtu22cis_bash_umask }}' with_items: - - /etc/bash.bashrc - - /etc/profile - - /etc/login.defs + - { path: '/etc/bash.bashrc', line: 'umask' } + - { path: '/etc/profile', line: 'umask' } + - { path: '/etc/login.defs', line: 'UMASK' } - name: "4.5.4 | PATCH | Ensure default user umask is 027 or more restrictive" ansible.builtin.lineinfile: