3

RHEL 8 overrides some sshd settings, so no matter what it has been set in /etc/ssh/sshd_config, the options listed in /etc/crypto-policies/back-ends/opensshserver.config takes precedence.

From my point of view, this decision has some (IMHO) severe drawbacks:

  1. Makes the command listed in ps output to be overly long and hard to parse
  2. 'Escapes' configuration testing using sshd -t or sshd -T
  3. Yet another file to configure/maintain -- since everything will be configured by SaltStack anyways, I honestly don't see why I have to split sshd configuration over several files

On RHEL 8, I can "opt out" from having sshd settings becoming overridden by that .config file by uncommenting the CRYPTO_POLICY= line in /etc/sysconfig/sshd, meaning that sshd will fully be configured by /etc/ssh/sshd_config.

What will be the drawbacks of "opting out" from letting RHEL 8's "security policies" to handle (some) sshd configuration? Or, the flip side, what benefits will I gain by using "security policies" rather than configuring everything from /etc/ssh/sshd_config?

1 Answer 1

2

System-wide crypto-policies were introduced to make ensuring compliance easier. RHEL8 comes with several policies to choose from, and your choice depends on the jurisdiction and its relation to the Wassenaar agreement.

If you decide to deviate from the built-in policies, for whatever reason, then adding a CRYPTO_POLICY= line in /etc/sysconfig/sshd would fail passing an audit with some tools.

RHEL8-CIS version 3 suggests to create a policy modification in /usr/share/crypto-policies/policies/modules/SSH.pmod,

You can then add the modification to the other settings

update-crypto-policies --set FIPS:OSPP:SSH

example policy modification:

# https://access.redhat.com/articles/3642912
# https://gitlab.com/redhat-crypto/fedora-crypto-policies
# This is a stricter policy than FIPS:OSPP

# message authentication code algorithms
# https://gitlab.com/redhat-crypto/fedora-crypto-policies/-/issues/48
mac@SSH = -*-64* -UMAC-128 -HMAC-SHA1
# Encrypt then MAC. Prioritize the etm over the non-etm macs
ssh_etm = 1

# key exchange algorithms
key_exchange = ECDHE RSA DHE DHE-RSA PSK DHE-PSK ECDHE-PSK ECDHE-GSS DHE-GSS
# Disable weak DH groups and NIST curves
group@SSH = +X25519 +X448 -FFDHE-2048 -SECP256R1 -SECP384R1 -SECP521R1
# Disabled diffie-hellman-group-exchange-sha256, enable for CIS-CAT Pro audit tool
arbitrary_dh_groups = 0

hash = -SHA1
sign = -*-SHA1
sign@SSH = -*-SHA1 +EDDSA-ED25519
min_rsa_size = 2048
min_dh_size = 3072

# encryption algorithms (ciphers) Terrapin workaround
cipher@SSH = -*-CBC -CHACHA20-POLY1305 +AES-192-CTR -AES*-GCM

# SSH Certificates
ssh_certs = 1

The above almost passes ssh-audit, you'll need RHEL9 to pass completely.

4
  • How do you ensure that the policies are compliant, though? Just like sshd_config, the files that make up the security policies are editable by root in /usr/share/crypto-policies. You still end up having to inspect the policies themselves to ensure they are compliant. So it's one more indirection that complicates things.
    – pepoluan
    Commented Jun 13 at 10:35
  • "adding a CRYPTO_POLICY= line in /etc/sysconfig/sshd would fail passing an audit with some tools" what tools have that braindead behavior? Please inform me so I can recommend to the C-level officers to stay away from those tools.
    – pepoluan
    Commented Jun 13 at 10:39
  • Reference: CIS Red Hat Enterprise Linux 8 Benchmark v3.0.0 - 10-30-2023 - Paragraph 1.6 Configure system wide crypto policy Commented Jun 13 at 11:46
  • You can use the python tool ssh-audit to validate the settings on the port of sshd. Commented Aug 15 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .