Bug 1656370

Summary: sshd.socket overrides Ciphers in /etc/ssh/sshd_config
Product: [Fedora] Fedora Reporter: Harald Reindl <h.reindl>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dwalsh, jfch, jjelen, lkundrak, mattias.ellert, plautrba, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-28 23:25:28 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 Harald Reindl 2018-12-05 11:00:51 UTC
The following weak client-to-server encryption algorithms are supported by the remote service:
aes128-cbc
aes256-cbc

i fixed that *years* ago but now switched from my sshd.service to socket-activation and "ExecStart=-/usr/sbin/sshd -i $OPTIONS $CRYPTO_POLICY" is nice BUT you have no business to override explicit settings by admins knowing what they are doing longer than crypto policy exists at all

Ciphers aes128-gcm,aes256-gcm,chacha20-poly1305,aes128-ctr,aes256-ctr

MACs umac-128-etm,hmac-sha2-512-etm,hmac-sha2-256-etm,hmac-sha2-512,hmac-sha2-256,hmac-sha1-etm,hmac-sha1

KexAlgorithmscurve25519-sha256,curve25519-sha256,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

Comment 1 Harald Reindl 2018-12-05 11:05:37 UTC
this is nonsense - explicit set options in ssd_config has to be optout enough

cat /etc/sysconfig/sshd
# Configuration file for the sshd service.

# The server keys are automatically generated if they are missing.
# To change the automatic creation, adjust sshd.service options for
# example using  systemctl enable sshd-keygen  to allow creation
# of DSA key or  systemctl mask sshd-keygen  to disable RSA key
# creation.

# System-wide crypto policy:
# To opt-out, uncomment the following line
# CRYPTO_POLICY=
[root@arrakis:~]$

Comment 2 Jakub Jelen 2018-12-05 12:11:00 UTC
First of all, the claim that aes256-cbc is week is at least arguable. It is indeed not recommended cipher but it can be useful as a fallback to talk with older clients.

The sysconfig file should be loaded also for the socket activated service so you should be able to opt out the same way for your new socket activated service.

Unfortunately, there is no better for sshd to load some policy file at this moment or to honor the crypto algorithms written in the configuration file, but if you have a better idea how to solve this problem, I would be glad to hear it.

If you believe the cbc ciphers should not be in the default policy, feel free to open an issue on upstream:

https://gitlab.com/redhat-crypto/fedora-crypto-policies

Comment 3 Harald Reindl 2018-12-05 12:14:10 UTC
sshd should simply weight explicit config values over global policies

Comment 4 Jakub Jelen 2018-12-05 12:26:17 UTC
If it would be that simple to achieve, it would be done. But unfortunately it is not possible without extensively patching sshd, preprocessing configuration file, modifying its location or something even worse affecting much more users.

Comment 5 Ben Cotton 2019-05-02 20:10:19 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2019-05-28 23:25:28 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.