From 6e9247bde306d5c2bf5bc36a0426e13afc973166 Mon Sep 17 00:00:00 2001 From: Maximilian Praeger Date: Fri, 22 Jan 2021 06:45:37 +0100 Subject: [PATCH] added: support for HostCertificate in sshd conf file Signed-off-by: Maximilian Praeger --- roles/ssh_hardening/templates/opensshd.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/ssh_hardening/templates/opensshd.conf.j2 b/roles/ssh_hardening/templates/opensshd.conf.j2 index 299f5f1f..3b227243 100644 --- a/roles/ssh_hardening/templates/opensshd.conf.j2 +++ b/roles/ssh_hardening/templates/opensshd.conf.j2 @@ -38,6 +38,12 @@ ListenAddress {{ address }} HostKey {{ key }} {% endfor %} +{% if ssh_host_certificates -%} +{% for certificate in ssh_host_certificates -%} +HostCertificate {{ certificate }} +{% endfor -%} +{% endif -%} + # Host key algorithms that the server offers. {% if sshd_version is version('5.8', '>=') %} {{ "HostKeyAlgorithms " ~ ssh_host_key_algorithms|join(',') if ssh_host_key_algorithms else "HostKeyAlgorithms"|comment }}