RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2073605 - FIPS mode detection in SSHD role is wrong
Summary: FIPS mode detection in SSHD role is wrong
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rhel-system-roles
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.1
Assignee: Rich Megginson
QA Contact: Jakub Haruda
Jan Fiala
URL:
Whiteboard: role:sshd
Depends On:
Blocks: 2075338 2077475
TreeView+ depends on / blocked
 
Reported: 2022-04-08 22:04 UTC by Jakub Jelen
Modified: 2022-11-15 11:23 UTC (History)
10 users (show)

Fixed In Version: rhel-system-roles-1.18.0-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2075338 2077475 (view as bug list)
Environment:
Last Closed: 2022-11-15 10:23:26 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pkettman: needinfo+
pkettman: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github willshersystems ansible-sshd pull 179 0 None open Unbreak FIPS detection and stabilize failing tests and GH actions 2022-04-11 12:31:58 UTC
Red Hat Issue Tracker RHELPLAN-118451 0 None None None 2022-04-08 22:08:38 UTC
Red Hat Product Errata RHEA-2022:8117 0 None None None 2022-11-15 10:23:51 UTC

Description Jakub Jelen 2022-04-08 22:04:39 UTC
Description of problem:
This is a follow-up from the bug #2029634 and #2029634, which implements the FIPS mode detection, but it is not correct because of two reasons:

 * any RHEL/Fedora configuration is detected as in FIPS mode
 * the templates are not modified to exclude the fips hostkeys (only the meta/10_top.j2 was modified, but the templates were not regenerated)

The result is that regardless the FIPS mode status, the ed25519 hostkeys
are not generated and checked:
```
TASK [ansible-sshd : Make sure hostkeys are available] **************************************************************
ok: [localhost] => (item=/etc/ssh/ssh_host_rsa_key) => {...}
ok: [localhost] => (item=/etc/ssh/ssh_host_ecdsa_key) => {...}
```
but they are included in the configuration file:
```
[root@5c5bfece6a22 tests]# cat /etc/ssh/sshd_config
[...]
HostKey /etc/ssh/ssh_host_ed25519_key
```

This is handled on non-fips systems by the systemd service which probably generates the keys and sshd stars ok in real systems (I tested only in containers so far). On FIPS systems, it might fail to start the service.

Version-Release number of selected component (if applicable):
rhel-system-roles-1.11.0-1.el8
rhel-system-roles-1.11.0-1.el9

How reproducible:
always

Steps to Reproduce:
1. set system into fips mode on RHEL8
2. run sshd role with default parameters

Actual results:
 * the ed25519 key is listed in configuration file in FIPS mode
 * the ed25519 key is NOT checked/created by the role out of FIPS mode

Expected results:
 * the ed25519 key is NOT listed in configuration file in FIPS mode
 * the ed25519 key is checked/created by the role out of FIPS mode


Additional info:
on RHEL9, this will not demonstrate as there are no default hostkeys in configuration file as the drop-in directory is used.

Comment 1 Jakub Jelen 2022-04-08 22:12:42 UTC
The fix for this is first couple of commits in https://github.com/willshersystems/ansible-sshd/pull/178 which I started putting together while working on other feature. I will probably split them into separate PR to simplify things, but most of the changes are needed to unbreak the CI anyway.

Comment 2 Jakub Jelen 2022-04-11 12:31:59 UTC
The current patch-set to unbreak FIPS detection including tests:

https://github.com/willshersystems/ansible-sshd/pull/179

I would be glad for review/comments either in this or previous PR.

We talked with David that we might want to relase these changes as part of the 0day (8.6 and 9.0), but it will depend on how much risky the changes and the bug itself will be considered.

Comment 15 Fedora Update System 2022-05-11 01:18:53 UTC
FEDORA-2022-2da3a47337 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2022-05-11 01:25:01 UTC
FEDORA-2022-d6e6c7c37c has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2022-05-11 01:35:23 UTC
FEDORA-2022-671a5d63e6 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 26 errata-xmlrpc 2022-11-15 10:23:26 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 (rhel-system-roles 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/RHEA-2022:8117


Note You need to log in before you can comment on or make changes to this bug.