Set-OPS — moteur d'ecosystemes numeriques souverains (Alliance Boreale)

This commit is contained in:
Alliance Boreale 2026-06-24 20:17:46 -04:00
commit 3dd3f43ad8
308 changed files with 13649 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# Rôle ssh_hardening
Ajoute des réglages SSH plus stricts.

View 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"

View 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

View 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

View 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