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 2145026 - 'Include /etc/ssh/sshd_config.d/*.conf' in /etc/ssh/sshd_config subjected to accidential removals
Summary: 'Include /etc/ssh/sshd_config.d/*.conf' in /etc/ssh/sshd_config subjected to ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssh
Version: 9.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Dmitry Belyavskiy
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-22 23:48 UTC by Robert Scheck
Modified: 2023-02-20 08:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-29 14:06:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-8903 0 None None None 2022-11-29 14:12:49 UTC
Red Hat Issue Tracker RHELPLAN-140227 0 None None None 2022-11-22 23:51:15 UTC

Description Robert Scheck 2022-11-22 23:48:31 UTC
Description of problem:
As of writing, the configuration file /etc/ssh/sshd_config contains the line 'Include /etc/ssh/sshd_config.d/*.conf' due to the patch https://gitlab.com/redhat/centos-stream/rpms/openssh/-/blob/c9s/openssh-7.7p1-redhat.patch. While I personally enjoy the possibilities of /etc/ssh/sshd_config.d/*.conf, this configuration option is, at least from my point of view, subjected to accidential removals (e.g. by reusing an old ansible playbook or role, which does not (yet) contain the Include option) - and practically nobody will notice the absence, except until you maybe start wondering during a security review why /etc/crypto-policies/back-ends/opensshserver.config doesn't get applied applied (or other settings in /etc/ssh/sshd_config.d/*.conf.

Version-Release number of selected component (if applicable):
openssh-8.7p1-24.el9

How reproducible:
Silently remove 'Include /etc/ssh/sshd_config.d/*.conf' from /etc/ssh/sshd_config (and wait until somebody else notices the consequences).

Actual results:
'Include /etc/ssh/sshd_config.d/*.conf' in /etc/ssh/sshd_config subjected to accidential removals.

Expected results:
Turn 'Include /etc/ssh/sshd_config.d/*.conf' from configuration file into C code (the directory likely needs to be configurable via a ./configure option) that is built-in directly into the OpenSSH binary.

Additional info:
Indeed, normally the 'Include /etc/ssh/sshd_config.d/*.conf' line shouldn't be absent and administrators need to pay attention, however I personally treat it as risky, because it might disable the crypto-policies completely, and most likely nobody will notice this absence.

Comment 1 Robert Scheck 2022-11-23 10:15:40 UTC
Cross-filed case #03368892 at the Red Hat customer portal.

Comment 2 Dmitry Belyavskiy 2022-11-29 14:06:23 UTC
It doesn't look like a OpenSSH bug to me. Yes, accidental change of the config may cause problems, but I don't see how to prevent it.

Comment 3 Robert Scheck 2022-11-29 19:34:40 UTC
Yes, it isn't an OpenSSH upstream bug, it's IMHO an issue caused by packaging on Red Hat side as a downstream. Instead of leveraging the 'Include' directive, a more nice but especially robust upstream solution could have been created by implementing something like a hardcoded include directly in the OpenSSH ELF binaries (as already mentioned in the last paragraph of my initial description).

Comment 7 Alexander Sosedkin 2023-02-07 18:32:41 UTC
Opting out of crypto-policies is a supported scenario, described in, say
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening
Going for a hardcoded include would go against that,
or at the very least, make the procedure more complicated than it should be.

IMO, in general, making software hard to misconfigure is a rather futule goal.
And when performed downstream-only,
it becomes an extra source of confusion and frustration.
A distribution is supposed to configure OpenSSH
by leveraging the existing configuration facilities,
not hardcoding secret downstream ones with unclear interplay with the upstream ones.


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