Skip to content

🗝 Improve the security of the SSH server beyond "National Security"

License

Notifications You must be signed in to change notification settings

playingfield/ansible_role_ssh

 
 

Repository files navigation

ansible_role_ssh

Improve the security settings of the OpenSSH SSH server.

Legal

The countries in which your servers currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

What does this role change?

This role is based on audit findings using ssh-audit. This role will improve the crypto of your ssh server to more secure and faster settings.

  • When crypto policies are available the configured policy is set and activated, although a reboot is recommended.
  • Crypto is configured in way that ssh-audit passes without warnings.
  • The Diffie Hellmann moduli size for sshd is adjusted to modern standards.
  • Host keys are re-configured from RSA to ED25519, this is faster and more secure. An RSA host key is now considered weak source.
  • RSA and ECDSA host keys are disabled in sshd.

Crypto Policies

Crypto policies were introduced in Fedora 21 and are also used in RHEL8, Centos Stream, Ubuntu 20. The STRICT policy template defines modern crypto for SSH and TLS that is stronger than FIPS:OSPP. The configured crypto policy will be system-wide for all applications. You can configure the policies present on your system too, but this role installs the STRICT crypto policy by default.

Possible crypto_policy values

crypto_policy: 'STRICT' Recommended for high-security systems.

crypto_policy: 'FUTURE' Recommended for modern systems.

crypto_policy: 'FIPS:OSPP' FIPS with OSPP policy modification (stricter than FIPS).

crypto_policy: 'FIPS' Required for (US) Federal Information Processing Standard.

crypto_policy: 'DEFAULT' What you get without this role, i.e. "export" quality.

crypto_policy: 'LEGACY' Weak, for compatibility with older systems.

Algorithm recommendations

The recommended crypto is configured in sshd_config when the STRICT crypto_policy is selected for a platform without crypto policy support, otherwise the STRICT policy is installed and configured with update-crypto-policy.

Default Variables

The recommended default is configured in defaults/main.yml. min_dh_size: '3072' Minimal Diffie Hellmann moduli size.

Hardening guides

Copyright 2022 Bas Meijer @bbaassssiie

About

🗝 Improve the security of the SSH server beyond "National Security"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • YAML 91.9%
  • Dockerfile 5.4%
  • Python 2.7%