Open dhoppe opened 4 years ago
I am not sure if this module should be able to configure /etc/crypto-policies/back-ends/opensshserver.config
or just add the module camptocamp/puppet-systemd
to get rid of the variable $CRYPTO_POLICY
.
Looking at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening#examples-of-opting-out-of-system-wide-crypto-policies_using-the-system-wide-cryptographic-policies the proper way of opting out of system-wide crypto policies is to set CRYPTO_POLICIES
in /etc/sysconfig/sshd
As far as I can see, system-wide crypto policies started from RedHat 8 on.
@dhoppe Can you check and confirm that, before I start working on this?
I already did. If I comment out the entry in /etc/sysconfig/sshd
, the values from /etc/ssh/sshd_config
are applied correctly.
There is another way to turn off crypto polices if removing the CRYPTO_POLICY in the " /usr/lib/systemd/system/sshd.service" doesn't work.
It appears the crypto polices are loaded from a file called: "/etc/ssh/ssh_config.d/05-redhat.conf" which is new with Centos8.
It seems the line "include /etc/crypto-policies/back-ends/openssh.conf" overrides the settings in /etc/ssh/sshd_config.
Commenting the line seems to prevent the system cyrpto policies from being applied.
I'm no CentOS expert at all, but I'm happy to accept any PR or comment with the proper way to handle this issue :-)
I would disagree that this module should manage crypto policies on EL8+. The file /etc/crypto-policies/back-ends/openssh.conf is managed by update-crypto-policies command, so this module should not modify it, and managing crypto policies in general affects more than just openssh, so it is really beyond the scope of what this module should do.
What this module should not do is break the mechanism used to manage openssh crypto policies on EL8+, which is what has happened on EL9 when managing openssh server crypto policies (and I assume openssh client crypto policies on EL8). I submitted pull request #390 to address the issue with EL9 and openssh server crypto policies.
I've merged #390. Please let me know, if this resolves the issue and if something's still missing.
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The configuration has been changed, but has no effect at all.
What behaviour did you expect instead
The OpenSSH server should not use weak algorithms.
Any additional information you'd like to impart