This repository was archived by the owner on Dec 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 26
26
owner : ' {{ ssh_owner }}'
27
27
group : ' {{ ssh_group }}'
28
28
notify : restart sshd
29
- when : ssh_server_hardening
29
+ when : ssh_server_hardening | bool
30
30
31
31
- name : create sshd_config and set permissions to root/600
32
32
template :
37
37
group : ' {{ ssh_group }}'
38
38
validate : ' /usr/sbin/sshd -T -C user=root -C host=localhost -C addr=localhost -f %s'
39
39
notify : restart sshd
40
- when : ssh_server_hardening
40
+ when : ssh_server_hardening | bool
41
41
42
42
- name : create ssh_config and set permissions to root/644
43
43
template :
46
46
mode : ' 0644'
47
47
owner : ' {{ ssh_owner }}'
48
48
group : ' {{ ssh_group }}'
49
- when : ssh_client_hardening
49
+ when : ssh_client_hardening | bool
50
50
51
51
- name : Check if {{ sshd_moduli_file }} contains weak DH parameters
52
52
shell : awk '$5 < {{ sshd_moduli_minimum }}' {{ sshd_moduli_file }}
67
67
- name : include tasks to setup 2FA
68
68
include_tasks : 2fa.yml
69
69
when :
70
- - ssh_use_pam
71
- - ssh_challengeresponseauthentication
72
- - ssh_google_auth
70
+ - ssh_use_pam | bool
71
+ - ssh_challengeresponseauthentication | bool
72
+ - ssh_google_auth | bool
73
73
74
74
- name : include selinux specific tasks
75
75
include_tasks : selinux.yml
Original file line number Diff line number Diff line change 1
1
---
2
2
3
3
- include_tasks : hardening.yml
4
- when : ssh_hardening_enabled
4
+ when : ssh_hardening_enabled | bool
Original file line number Diff line number Diff line change 57
57
- name : install selinux policy
58
58
command : semodule -i {{ ssh_custom_selinux_dir }}/ssh_password.pp
59
59
60
- when : not ssh_use_pam and ssh_password_module.stdout.find('ssh_password') != 0
60
+ when : not ssh_use_pam | bool and ssh_password_module.stdout.find('ssh_password') != 0
61
61
62
62
# The following tasks only get executed when selinux is installed, UsePam is 'yes' and the ssh_password module is installed.
63
63
# See http://danwalsh.livejournal.com/12333.html for more info
64
64
- name : remove selinux-policy when Pam is used, because Allowing sshd to read the shadow file directly is considered a potential security risk
65
65
command : semodule -r ssh_password
66
- when : ssh_use_pam and ssh_password_module.stdout.find('ssh_password') == 0
66
+ when : ssh_use_pam | bool and ssh_password_module.stdout.find('ssh_password') == 0
You can’t perform that action at this time.
0 commit comments