forked from ansible-lockdown/RHEL9-CIS
renamed variables
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
c58c4eb4e8
commit
14d038e8eb
14 changed files with 113 additions and 113 deletions
|
|
@ -114,24 +114,24 @@
|
|||
ansible.builtin.shell: grep -is 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* | cut -d":" -f1 | uniq | sort
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: rhel9cis_5_2_6_timeout_files
|
||||
register: discovered_sudo_timeout_files
|
||||
|
||||
- name: "5.2.6 | PATCH | Ensure sudo authentication timeout is configured correctly | Set value if no results"
|
||||
when: discovered_sudo_timeout_files.stdout | length == 0
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/sudoers
|
||||
regexp: 'Defaults timestamp_timeout='
|
||||
line: "Defaults timestamp_timeout={{ rhel9cis_sudo_timestamp_timeout }}"
|
||||
validate: '/usr/sbin/visudo -cf %s'
|
||||
when: rhel9cis_5_2_6_timeout_files.stdout | length == 0
|
||||
|
||||
- name: "5.2.6 | PATCH | Ensure sudo authentication timeout is configured correctly | Set value if has results"
|
||||
when: discovered_sudo_timeout_files.stdout | length > 0
|
||||
ansible.builtin.replace:
|
||||
path: "{{ item }}"
|
||||
regexp: 'timestamp_timeout=(\d+)'
|
||||
replace: "timestamp_timeout={{ rhel9cis_sudo_timestamp_timeout }}"
|
||||
validate: '/usr/sbin/visudo -cf %s'
|
||||
loop: "{{ rhel9cis_5_2_6_timeout_files.stdout_lines }}"
|
||||
when: rhel9cis_5_2_6_timeout_files.stdout | length > 0
|
||||
loop: "{{ discovered_sudo_timeout_files.stdout_lines }}"
|
||||
|
||||
- name: "5.2.7 | PATCH | Ensure access to the su command is restricted"
|
||||
when:
|
||||
|
|
@ -149,7 +149,7 @@
|
|||
ansible.builtin.group:
|
||||
name: "{{ rhel9cis_sugroup }}"
|
||||
state: present
|
||||
register: rhel9cis_5_2_7_sugroup
|
||||
register: discovered_sugroup
|
||||
|
||||
- name: "5.2.7 | PATCH | Ensure access to the su command is restricted | remove users from group"
|
||||
ansible.builtin.lineinfile:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue