mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-27 15:33:06 +00:00
Add SSH Variables the proper way, condition entries correct.
Signed-off-by: root@DERVISHx <nuno.carvalho@siemens.com>
This commit is contained in:
parent
aa4c427c54
commit
5ab4a1c0ed
2 changed files with 11 additions and 2 deletions
|
|
@ -354,14 +354,14 @@
|
||||||
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Add line in sshd_config for ClientAliveInterval"
|
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Add line in sshd_config for ClientAliveInterval"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ rhel9_cis_sshd_config_file }}"
|
path: "{{ rhel9_cis_sshd_config_file }}"
|
||||||
regexp: '^ClientAliveInterval'
|
regexp: '^ClientAliveInterval|^#ClientAliveInterval'
|
||||||
line: "ClientAliveInterval {{ rhel9cis_sshd['clientaliveinterval'] }}"
|
line: "ClientAliveInterval {{ rhel9cis_sshd['clientaliveinterval'] }}"
|
||||||
validate: sshd -t -f %s
|
validate: sshd -t -f %s
|
||||||
|
|
||||||
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Ensure SSH ClientAliveCountMax set to <= 3"
|
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Ensure SSH ClientAliveCountMax set to <= 3"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ rhel9_cis_sshd_config_file }}"
|
path: "{{ rhel9_cis_sshd_config_file }}"
|
||||||
regexp: '^ClientAliveCountMax'
|
regexp: '^ClientAliveCountMax|^#ClientAliveCountMax'
|
||||||
line: "ClientAliveCountMax {{ rhel9cis_sshd['clientalivecountmax'] }}"
|
line: "ClientAliveCountMax {{ rhel9cis_sshd['clientalivecountmax'] }}"
|
||||||
validate: sshd -t -f %s
|
validate: sshd -t -f %s
|
||||||
when:
|
when:
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,12 @@
|
||||||
|
|
||||||
os_gpg_key_pubkey_name: gpg-pubkey-fd431d51-4ae0493b
|
os_gpg_key_pubkey_name: gpg-pubkey-fd431d51-4ae0493b
|
||||||
os_gpg_key_pubkey_content: "Red Hat, Inc. (release key 2) <security@redhat.com> fd431d51"
|
os_gpg_key_pubkey_content: "Red Hat, Inc. (release key 2) <security@redhat.com> fd431d51"
|
||||||
|
|
||||||
|
rhel9cis_sshd:
|
||||||
|
clientalivecountmax: 3
|
||||||
|
clientaliveinterval: 900
|
||||||
|
logingracetime: 60
|
||||||
|
# allowusers:
|
||||||
|
allowgroups: root sshd wheel
|
||||||
|
# denyusers:
|
||||||
|
# denygroups:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue