From d530f25ccc61efcb4af71e809430676cead0e435 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Wed, 2 Mar 2022 12:12:53 +0100
Subject: [PATCH] feat: disable insecure SSH algorithms (host key algos, KEX
 algos, ciphers)

---
 tasks/configure-ssh-hardening.yml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tasks/configure-ssh-hardening.yml b/tasks/configure-ssh-hardening.yml
index 1ce0dc2..cb01036 100644
--- a/tasks/configure-ssh-hardening.yml
+++ b/tasks/configure-ssh-hardening.yml
@@ -47,5 +47,14 @@
       MaxAuthTries 3
       TCPKeepAlive no
       {{ "PasswordAuthentication no" if ansible_os_family == "Debian" else "PasswordAuthentication yes" }}
+      # disable weak host key algorithm ssh-dss (Digital Signature Algorithm (DSA) / Digital Signature Standard (DSS))
+      # NVT OID: 1.3.6.1.4.1.25623.1.0.117687
+      HostKeyAlgorithms -ssh-dss
+      # disable weak KEX algorithms
+      # NVT OID: 1.3.6.1.4.1.25623.1.0.150713
+      KexAlgorithms -diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
+      # disable weak Ciphers (crypto algorithms)
+      # NVT OID: 1.3.6.1.4.1.25623.1.0.105611
+      Ciphers -3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc
   notify:
     - restart sshd
-- 
GitLab