Set-OPS — moteur d'ecosystemes numeriques souverains (Alliance Boreale)
This commit is contained in:
commit
3dd3f43ad8
308 changed files with 13649 additions and 0 deletions
3
roles/ssh_hardening/README.md
Normal file
3
roles/ssh_hardening/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Rôle ssh_hardening
|
||||
|
||||
Ajoute des réglages SSH plus stricts.
|
||||
9
roles/ssh_hardening/defaults/main.yml
Normal file
9
roles/ssh_hardening/defaults/main.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
ssh_hardening_port: 22
|
||||
ssh_hardening_password_authentication: "no"
|
||||
ssh_hardening_permit_root_login: "no"
|
||||
ssh_hardening_pubkey_authentication: "yes"
|
||||
ssh_hardening_client_alive_interval: 300
|
||||
ssh_hardening_client_alive_count_max: 2
|
||||
ssh_hardening_max_auth_tries: 3
|
||||
ssh_hardening_login_grace_time: "20s"
|
||||
11
roles/ssh_hardening/handlers/main.yml
Normal file
11
roles/ssh_hardening/handlers/main.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Valider la configuration SSH
|
||||
ansible.builtin.command: sshd -t
|
||||
changed_when: false
|
||||
listen: Validate and reload ssh
|
||||
|
||||
- name: Recharger SSH
|
||||
ansible.builtin.systemd:
|
||||
name: ssh
|
||||
state: reloaded
|
||||
listen: Validate and reload ssh
|
||||
9
roles/ssh_hardening/tasks/main.yml
Normal file
9
roles/ssh_hardening/tasks/main.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: Déployer le hardening SSH additionnel
|
||||
ansible.builtin.template:
|
||||
src: 20-setops-hardening.conf.j2
|
||||
dest: /etc/ssh/sshd_config.d/20-setops-hardening.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: Validate and reload ssh
|
||||
27
roles/ssh_hardening/templates/20-setops-hardening.conf.j2
Normal file
27
roles/ssh_hardening/templates/20-setops-hardening.conf.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Managed by Ansible — Set-OPS
|
||||
|
||||
Port {{ ssh_hardening_port }}
|
||||
PermitRootLogin {{ ssh_hardening_permit_root_login }}
|
||||
PubkeyAuthentication {{ ssh_hardening_pubkey_authentication }}
|
||||
PasswordAuthentication {{ ssh_hardening_password_authentication }}
|
||||
AuthenticationMethods publickey
|
||||
KbdInteractiveAuthentication no
|
||||
ChallengeResponseAuthentication no
|
||||
PermitEmptyPasswords no
|
||||
HostbasedAuthentication no
|
||||
IgnoreRhosts yes
|
||||
X11Forwarding no
|
||||
AllowTcpForwarding no
|
||||
AllowAgentForwarding no
|
||||
AllowStreamLocalForwarding no
|
||||
PermitTunnel no
|
||||
GatewayPorts no
|
||||
PermitUserEnvironment no
|
||||
PermitTTY yes
|
||||
TCPKeepAlive no
|
||||
ClientAliveInterval {{ ssh_hardening_client_alive_interval }}
|
||||
ClientAliveCountMax {{ ssh_hardening_client_alive_count_max }}
|
||||
MaxAuthTries {{ ssh_hardening_max_auth_tries }}
|
||||
LoginGraceTime {{ ssh_hardening_login_grace_time }}
|
||||
MaxSessions 2
|
||||
MaxStartups 5:30:20
|
||||
Loading…
Reference in a new issue