Bug 1771356

Summary: Default client configuration breaks ssh in FIPS mode.
Product: Red Hat Enterprise Linux 7 Reporter: Florence Blanc-Renaud <frenaud>
Component: ipaAssignee: Florence Blanc-Renaud <frenaud>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.8CC: cheimes, ipa-qe, jjelen, ksiddiqu, pcech, rcritten, ssidhaye, ssorce, tscherf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.6-12.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1756432 Environment:
Last Closed: 2020-09-29 19:58:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1756432    
Bug Blocks:    

Description Florence Blanc-Renaud 2019-11-12 09:04:11 UTC
+++ This bug was initially created as a clone of Bug #1756432 +++

Description of problem:

Apparently by default (ssh_trust_dns option true) we set the HostKeyAlgorithms options for ssh in clients to a very restrictive set "ssh-rsa,ssh-dss".

this was done in 2012 to deal with an older version of ssh which did not properly support ecdsa keyex in the SSHFP checking case.

However this option ends up disabling all modern key exchanges (SHA-2/EC) and re-enables a key excahnge that is explicitly disabled in FIPS mode (DSA based).

The main issue though is that because of these options a RHEL-8 client (also RHEL-7) enrolled in IPA is unable to successfully SSH into a RHEL-8 server in FIPS mode, as there is no common set of algorithms left.

This is a high profile issue for any customers that want to use IDm client in a FIPS environment.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Jakub Jelen on 2019-09-27 15:50:42 UTC ---

I think this part of code was highly inspired by the bug report in Debian [1], which recommends these particular configuration options to be set as a workaround of old openssh versions in the frame between 5.7 and 6.1. Neither of these versions is available in neither of RHELs or Fedora anymore and as described above, they are even harmful since they reduce default security configuration of OpenSSH for all (!) connections in following ways:

 * ssh-dsa is disabled by default and no scripts should enable it this way. Using 1k DSA keys is purely wrong
 * ssh-rsa references to legacy RSA with SHA1, which is being slowly deprecated by rsa-sha2-256 and rsa-sha2-512, which are also disabled by your configuration
 * there are ecdsa and ED25519 key types that are being disabled this way also

Please, consider dropping this configuration change [2] from your install scripts.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698794
[2] https://github.com/freeipa/freeipa/blob/9c20641f5c8e9d4f813d0ba3e80b7ccc9df0ed15/ipaclient/install/client.py#L1111

--- Additional comment from Christian Heimes on 2019-09-27 15:52:18 UTC ---

The HostKeyAlgorithms setting is only added when ipa-client-install is invoked with --ssh-trust-dns. By default the internal flag trust_sshfp is False and the setting is not added to the global ssh config.

Should IPA use a different setting for HostKeyAlgorithms or not touch HostKeyAlgorithms at all?

--- Additional comment from Christian Heimes on 2019-09-27 16:02:10 UTC ---

Update from internal conversation with Simo and Rob:

It is sufficient to remove the problematic HostKeyAlgorithms stanza from the ssh config file. Since it only affects the global ssh client config file, it is not necessary to restart any service. A simple sed call might be good enough.

--- Additional comment from Christian Heimes on 2019-09-27 16:18:24 UTC ---

Upstream ticket:
https://pagure.io/freeipa/issue/8082

--- Additional comment from Christian Heimes on 2019-11-12 08:56:26 UTC ---

Upstream fixed proposed in https://github.com/freeipa/freeipa/pull/3887

Comment 2 Christian Heimes 2019-11-13 07:39:48 UTC
Fixed upstream
ipa-4-6:
https://pagure.io/freeipa/c/7cd1d565ac2b240eda697dbebb043a1a2885d23a

Comment 3 Florence Blanc-Renaud 2020-01-28 09:56:05 UTC
RHEL-7.8 is already near the end of a Development Phase and development is being wrapped up. This bug is being moved to RHEL 7.9.
If you believe this particular bug should be reconsidered for 7.8, please let us know.

Comment 6 Kaleem 2020-05-06 15:32:57 UTC
Verified with following scenarios

(1) Install scenario : HostKeyAlgorithms not added in /etc/ssh/ssh_config after ipa-client install
(2) Upgrade scenario : HostKeyAlgorithms is commented out in /etc/ssh/ssh_config after ipa-client install rpm upgrade.

[root@dhcp34-39 ~]# rpm -q ipa-client
ipa-client-4.6.8-2.el7.x86_64
[root@dhcp34-39 ~]# 


Please find the attached file for verification and output.

Comment 9 errata-xmlrpc 2020-09-29 19:58:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: ipa security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3936