Bug 2122464

Summary: crypto-policies RSAMinSize enforcement breaks ssh to overcloud nodes
Product: Red Hat OpenStack Reporter: Luca Miccini <lmiccini>
Component: openstack-tripleo-heat-templatesAssignee: Luca Miccini <lmiccini>
Status: CLOSED ERRATA QA Contact: Khomesh Thakre <kthakre>
Severity: high Docs Contact:
Priority: high    
Version: 17.1 (Wallaby)CC: bdobreli, bshephar, jpretori, kthakre, mburns, ramishra, rhos-maint
Target Milestone: gaKeywords: Triaged
Target Release: 17.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-14.3.1-1.20221005153721.8a205f8.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-16 01:12:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luca Miccini 2022-08-30 06:08:31 UTC
Description of problem:

During the undercloud install we check if the stack user already has a rsa ssh key, otherwise we create one:

https://github.com/openstack/tripleo-heat-templates/blob/master/extraconfig/post_deploy/undercloud_post.sh#L46

if [ ! -f $HOMEDIR/.ssh/id_rsa ]; then
    ssh-keygen -b 1024 -N '' -f $HOMEDIR/.ssh/id_rsa
fi

Unfortunately the latest crypto-policies rpm now enforces a minimum key size of 2048 via:

$ grep RSAMinSize /etc/crypto-policies/back-ends/openssh.config
RSAMinSize 2048

this breaks ssh to the overcloud nodes.

I proposed we let ssh-keygen pick a default based on the os policies here: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/854602 .

We should probably look into how we can prevent this change from breaking existing environments where the key needs to be rotated (maybe we can leverage https://bugzilla.redhat.com/show_bug.cgi?id=2025933 ?)

rpm version:

crypto-policies-20220815-1.git0fbe86f.el9.noarch

[root@undercloud-0 ~]# rpm -q --changelog crypto-policies-20220815-1.git0fbe86f.el9.noarch
* Mon Aug 15 2022 Alexander Sosedkin <asosedkin> - 20220815-1.git0fbe86f                                                                                                                                                                                                                                                                    
- openssh: add RSAMinSize option following min_rsa_size

Comment 1 Brendan Shephard 2022-09-01 05:01:10 UTC
Sounds reasonable. Let's back port it to Wallaby and ship it with 17.1

Comment 7 Lukas Svaty 2023-06-16 08:13:29 UTC
Bulk moving target milestone to GA after the release of Beta on 14th June '23.

Comment 15 errata-xmlrpc 2023-08-16 01:12:07 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 (Release of components for Red Hat OpenStack Platform 17.1 (Wallaby)), 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/RHEA-2023:4577