Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect system wide minimum TLS version #709

Closed
ekohl opened this issue Jan 5, 2024 · 2 comments · Fixed by #710
Closed

Respect system wide minimum TLS version #709

ekohl opened this issue Jan 5, 2024 · 2 comments · Fixed by #710

Comments

@ekohl
Copy link
Contributor

ekohl commented Jan 5, 2024

It is possible to have a system wide crypto policy for OpenSSL, and Red Hat based distros (Fedora, RHEL & friends) do this out of the box. As far as I can see, the way this is done is in /etc/pki/tls/openssl.cnf:

# Load default TLS policy configuration

openssl_conf = default_modules

[ default_modules ]

ssl_conf = ssl_module

[ ssl_module ]

system_default = crypto_policy

[ crypto_policy ]

.include /etc/crypto-policies/back-ends/opensslcnf.config

Then in /etc/crypto-policies/back-ends/opensslcnf.config there is:

CipherString = @SECLEVEL=2:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8
Ciphersuites = TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256
TLS.MinProtocol = TLSv1.2
TLS.MaxProtocol = TLSv1.3
DTLS.MinProtocol = DTLSv1.2
DTLS.MaxProtocol = DTLSv1.2
SignatureAlgorithms = ECDSA+SHA256:ECDSA+SHA384:ECDSA+SHA512:ed25519:ed448:rsa_pss_pss_sha256:rsa_pss_rsae_sha256:rsa_pss_pss_sha384:rsa_pss_rsae_sha384:rsa_pss_pss_sha512:rsa_pss_rsae_sha512:RSA+SHA256:RSA+SHA384:RSA+SHA512:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1

Note how there's a TLS.MinProtocol. This is not respected by Ruby, and I think it's because of this bit:

:min_version => OpenSSL::SSL::TLS1_VERSION,

It doesn't appear to be possible to set this to nil and I don't see any constant that tells it to use the system default.

When I comment the line out, it does respect the system wide default. This appears to be done for ciphers already.

@ekohl
Copy link
Contributor Author

ekohl commented Jan 5, 2024

And Debian (checked on Debian Bullseye (11)) has:

openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=2

@rhenium
Copy link
Member

rhenium commented Jan 8, 2024

OpenSSL::SSL::SSLContext#set_params overrides the minimum protocol version based on the discussion in https://bugs.ruby-lang.org/issues/9424. In short, the latest OpenSSL version at that time (1.0.1) still allowed SSL 3.0 and SSL 2.0 by default, and we wanted to disable them.

PR #710 seems reasonable to me.

wbclark added a commit to wbclark/katello that referenced this issue Mar 11, 2024
This was originally added to allow downgrading the CDN connection
SSL version for compatibility with much older proxy servers. That
should be less of a concern now.

We do still set a value of TLS v1.2 for the min_version, but only
because ruby/openssl#709 prevents using
the system-wide crypto policy for now. In the future, that can be
removed as well, restoring control to the user at the OS level.
wbclark added a commit to Katello/katello that referenced this issue Mar 13, 2024
This was originally added to allow downgrading the CDN connection
SSL version for compatibility with much older proxy servers. That
should be less of a concern now.

We do still set a value of TLS v1.2 for the min_version, but only
because ruby/openssl#709 prevents using
the system-wide crypto policy for now. In the future, that can be
removed as well, restoring control to the user at the OS level.
qcjames53 pushed a commit to qcjames53/katello that referenced this issue Mar 19, 2024
This was originally added to allow downgrading the CDN connection
SSL version for compatibility with much older proxy servers. That
should be less of a concern now.

We do still set a value of TLS v1.2 for the min_version, but only
because ruby/openssl#709 prevents using
the system-wide crypto policy for now. In the future, that can be
removed as well, restoring control to the user at the OS level.

(cherry picked from commit 78fcba9)
qcjames53 added a commit to Katello/katello that referenced this issue Mar 19, 2024
* Refs #37148 - Remove removed_widgets override (#10927)

(cherry picked from commit 40a70ce)

* Fixes #35215 - Handle cloned hostgroups in hosts_and_hostgroups_helper (#10894)

(cherry picked from commit e3d46c6)

* Fixes #36979 - Remove cdn_ssl_version setting

This was originally added to allow downgrading the CDN connection
SSL version for compatibility with much older proxy servers. That
should be less of a concern now.

We do still set a value of TLS v1.2 for the min_version, but only
because ruby/openssl#709 prevents using
the system-wide crypto policy for now. In the future, that can be
removed as well, restoring control to the user at the OS level.

(cherry picked from commit 78fcba9)

* Fixes #37277 - Fix ACS randomly failing VCR tests (#10941)

(cherry picked from commit 6d93801)

* Fixes #37240 - Fix CCV duplicate repo warning (#10928)

(cherry picked from commit 02fc313)

---------

Co-authored-by: Jeremy Lenz <jlenz@redhat.com>
Co-authored-by: William Bradford Clark <wclark@redhat.com>
Co-authored-by: Ian Ballou <ianballou67@gmail.com>
Co-authored-by: Markus Bucher <bucher@atix.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants