forked from ansible-lockdown/RHEL9-CIS
lint updates
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
3ead0d63ac
commit
acf0104f7a
34 changed files with 199 additions and 213 deletions
|
|
@ -84,7 +84,7 @@
|
|||
regexp: "^AllowUsers"
|
||||
line: "AllowUsers {{ rhel9cis_sshd['allowusers'] }}"
|
||||
validate: sshd -t -f %s
|
||||
notify: restart sshd
|
||||
notify: Restart sshd
|
||||
when: "rhel9cis_sshd['allowusers']|default('') | length > 0"
|
||||
|
||||
- name: "5.2.4 | PATCH | Ensure SSH access is limited | Add line to sshd_config for allowgroups"
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
regexp: "^AllowGroups"
|
||||
line: "AllowGroups {{ rhel9cis_sshd['allowgroups'] }}"
|
||||
validate: sshd -t -f %s
|
||||
notify: restart sshd
|
||||
notify: Restart sshd
|
||||
when: "rhel9cis_sshd['allowgroups']|default('') | length > 0"
|
||||
|
||||
- name: "5.2.4 | PATCH | Ensure SSH access is limited | Add line to sshd_config for denyusers"
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
regexp: "^DenyUsers"
|
||||
line: "DenyUsers {{ rhel9cis_sshd['denyusers'] }}"
|
||||
validate: sshd -t -f %s
|
||||
notify: restart sshd
|
||||
notify: Restart sshd
|
||||
when: "rhel9cis_sshd['denyusers']|default('') | length > 0"
|
||||
|
||||
- name: "5.2.4 | PATCH | Ensure SSH access is limited | Add line to sshd_config for denygroups"
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
regexp: "^DenyGroups"
|
||||
line: "DenyGroups {{ rhel9cis_sshd['denygroups'] }}"
|
||||
validate: sshd -t -f %s
|
||||
notify: restart sshd
|
||||
notify: Restart sshd
|
||||
when: "rhel9cis_sshd['denygroups']|default('') | length > 0"
|
||||
when:
|
||||
- rhel9cis_rule_5_2_4
|
||||
|
|
@ -267,7 +267,7 @@
|
|||
|
||||
- name: "5.2.14 | PATCH | Ensure system-wide crypto policy is not over-ridden"
|
||||
ansible.builtin.shell: sed -ri "s/^\s*(CRYPTO_POLICY\s*=.*)$/# \1/" /etc/sysconfig/sshd
|
||||
notify: restart sshd
|
||||
notify: Restart sshd
|
||||
when: ssh_crypto_discovery.stdout | length > 0
|
||||
when:
|
||||
- rhel9cis_rule_5_2_14
|
||||
|
|
|
|||
|
|
@ -52,19 +52,19 @@
|
|||
register: rhel9cis_5_6_1_4_inactive_settings
|
||||
|
||||
- name: "5.6.1.4 | PATCH | Ensure inactive password lock is 30 days or less | Set default inactive setting"
|
||||
ansible.builtin.command: useradd -D -f {{ rhel9cis_inactivelock.lock_days }}
|
||||
ansible.builtin.shell: useradd -D -f {{ rhel9cis_inactivelock.lock_days }}
|
||||
when: rhel9cis_5_6_1_4_inactive_settings.stdout | length == 0
|
||||
|
||||
- name: "5.6.1.4 | AUDIT | Ensure inactive password lock is 30 days or less | Getting user list"
|
||||
ansible.builtin.shell: "awk -F: '/^[^#:]+:[^\\!\\*:]*:[^:]*:[^:]*:[^:]*:[^:]*:(\\s*|-1|3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):[^:]*:[^:]*\\s*$/ {print $1}' /etc/shadow"
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
register: rhel_8_5_6_1_4_user_list
|
||||
register: rhel9cis_5_6_1_4_user_list
|
||||
|
||||
- name: "5.6.1.4 | PATCH | Ensure inactive password lock is 30 days or less | Apply Inactive setting to existing accounts"
|
||||
ansible.builtin.command: chage --inactive {{ rhel9cis_inactivelock.lock_days }} "{{ item }}"
|
||||
ansible.builtin.shell: chage --inactive {{ rhel9cis_inactivelock.lock_days }} "{{ item }}"
|
||||
with_items:
|
||||
- "{{ rhel_8_5_6_1_4_user_list.stdout_lines }}"
|
||||
- "{{ rhel9cis_5_6_1_4_user_list.stdout_lines }}"
|
||||
when:
|
||||
- rhel9cis_rule_5_6_1_4
|
||||
tags:
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
- not rhel9cis_futurepwchgdate_autofix
|
||||
|
||||
- name: "5.6.1.5 | PATCH | Ensure all users last password change date is in the past | Fix accounts with pw change in the future"
|
||||
ansible.builtin.command: passwd --expire {{ item }}
|
||||
ansible.builtin.shell: passwd --expire {{ item }}
|
||||
when:
|
||||
- rhel9cis_5_6_1_5_user_list.stdout | length > 0
|
||||
- rhel9cis_futurepwchgdate_autofix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue