Add SSH Variables the proper way, condition entries correct.

Signed-off-by: root@DERVISHx <nuno.carvalho@siemens.com>
This commit is contained in:
root@DERVISHx 2023-10-17 13:11:16 +01:00
parent aa4c427c54
commit 5ab4a1c0ed
No known key found for this signature in database
GPG key ID: C68B144D8E6CCC46
2 changed files with 11 additions and 2 deletions

View file

@ -354,14 +354,14 @@
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Add line in sshd_config for ClientAliveInterval"
ansible.builtin.lineinfile:
path: "{{ rhel9_cis_sshd_config_file }}"
regexp: '^ClientAliveInterval'
regexp: '^ClientAliveInterval|^#ClientAliveInterval'
line: "ClientAliveInterval {{ rhel9cis_sshd['clientaliveinterval'] }}"
validate: sshd -t -f %s
- name: "5.2.20 | PATCH | Ensure SSH Idle Timeout Interval is configured | Ensure SSH ClientAliveCountMax set to <= 3"
ansible.builtin.lineinfile:
path: "{{ rhel9_cis_sshd_config_file }}"
regexp: '^ClientAliveCountMax'
regexp: '^ClientAliveCountMax|^#ClientAliveCountMax'
line: "ClientAliveCountMax {{ rhel9cis_sshd['clientalivecountmax'] }}"
validate: sshd -t -f %s
when:

View file

@ -3,3 +3,12 @@
os_gpg_key_pubkey_name: gpg-pubkey-fd431d51-4ae0493b
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: