forked from ansible-lockdown/RHEL9-CIS
Updated passwd variable name
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
d136bfa381
commit
5dc2541731
3 changed files with 8 additions and 8 deletions
|
|
@ -7,11 +7,11 @@
|
||||||
ansible.builtin.shell: cat /etc/passwd | grep -v '^#'
|
ansible.builtin.shell: cat /etc/passwd | grep -v '^#'
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: false
|
check_mode: false
|
||||||
register: prelim_passwd_file_audit
|
register: prelim_capture_passwd_file
|
||||||
|
|
||||||
- name: "PRELIM | 5.5.2 | 6.2.7 | 6.2.8 | 6.2.20 | Split passwd entries"
|
- name: "PRELIM | 5.4.2 | 7.2.8 | Split passwd entries"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
rhel9cis_passwd: "{{ prelim_passwd_file_audit.stdout_lines | map('regex_replace', ld_passwd_regex, ld_passwd_yaml) | map('from_yaml') | list }}"
|
prelim_captured_passwd_data: "{{ prelim_capture_passwd_file.stdout_lines | map('regex_replace', ld_passwd_regex, ld_passwd_yaml) | map('from_yaml') | list }}"
|
||||||
loop: "{{ prelim_passwd_file_audit.stdout_lines }}"
|
loop: "{{ prelim_passwd_file_audit.stdout_lines }}"
|
||||||
vars:
|
vars:
|
||||||
ld_passwd_regex: >-
|
ld_passwd_regex: >-
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.id }}"
|
name: "{{ item.id }}"
|
||||||
shell: /usr/sbin/nologin
|
shell: /usr/sbin/nologin
|
||||||
loop: "{{ rhel9cis_passwd }}"
|
loop: "{{ prelim_captured_passwd_data }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.id }}"
|
label: "{{ item.id }}"
|
||||||
|
|
||||||
|
|
@ -235,6 +235,6 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.id }}"
|
name: "{{ item.id }}"
|
||||||
password_lock: true
|
password_lock: true
|
||||||
loop: "{{ rhel9cis_passwd }}"
|
loop: "{{ prelim_captured_passwd_data }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.id }}"
|
label: "{{ item.id }}"
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ item.id }}"
|
owner: "{{ item.id }}"
|
||||||
group: "{{ item.gid }}"
|
group: "{{ item.gid }}"
|
||||||
loop: "{{ rhel9cis_passwd | selectattr('uid', '>=', prelim_min_int_uid | int) | selectattr('uid', '<=', prelim_max_int_uid | int) | list }}"
|
loop: "{{ prelim_captured_passwd_data | selectattr('uid', '>=', prelim_min_int_uid | int) | selectattr('uid', '<=', prelim_max_int_uid | int) | list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.id }}"
|
label: "{{ item.id }}"
|
||||||
|
|
||||||
|
|
@ -315,6 +315,6 @@
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: '{{ item }}'
|
path: '{{ item }}'
|
||||||
mode: 'go-w'
|
mode: 'go-w'
|
||||||
owner: "{{ rhel9cis_passwd | selectattr('dir', 'in', prelim_interactive_users_raw.stdout_lines) | selectattr('dir', 'in', item) | map(attribute='uid') | last }}"
|
owner: "{{ prelim_captured_passwd_data | selectattr('dir', 'in', prelim_interactive_users_home.stdout_lines) | selectattr('dir', 'in', item) | map(attribute='uid') | last }}"
|
||||||
group: "{{ rhel9cis_passwd | selectattr('dir', 'in', prelim_interactive_users_raw.stdout_lines) | selectattr('dir', 'in', item) | map(attribute='gid') | last }}"
|
group: "{{ prelim_captured_passwd_data | selectattr('dir', 'in', prelim_interactive_users_home.stdout_lines) | selectattr('dir', 'in', item) | map(attribute='gid') | last }}"
|
||||||
with_items: "{{ discovered_homedir_hidden_files.stdout_lines }}"
|
with_items: "{{ discovered_homedir_hidden_files.stdout_lines }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue