Skip to content

Use SecureTLSConfig() everywhere #15671

@tiran

Description

@tiran

The function SecureTLSConfig() of the name github.com/openshift/origin/pkg/cmd/server/crypto is used in several places to set safe and sane default settings of crypto/tls.TLSConfig. The default TLS version is only 1.2 instead of TLS 1.0, 1.1, and 1.2. Since PR #15400 SecureTLSConfig() also disables cipher suites with 3DES.

A couple of places in Origin's code base do not use the function, for example https://github.com/openshift/origin/blob/master/pkg/auth/ldaputil/client.go#L21 and https://github.com/openshift/origin/blob/master/pkg/cmd/server/kubernetes/master/master_config.go#L514 . To make it easier to apply a common policy for TLS settings and to increase security, Origin should use SecureTLSConfig() all over the place.

In order to apply default settings to all tls.Config structs, some refactoring is required. Otherwise we'd end up with a dependency cycle between pkg/cmd/util and cmd/server/crypto. IMHO cmd/util/crypto.go is a good place for SecureTLSConfig() and a couple of other functions. After all the are used outside the cmd/server namespace or just used by SecureTLSConfig():

  • TLSVersion
  • ValidTLSVersions
  • DefaultTLSVersion
  • CipherSuite
  • ValidCipherSuites
  • DefaultCiphers
  • SecureTLSConfig

I found out about the issue while I was working on openshift/openshift-docs#4946 / https://trello.com/c/a9egV9TF/62-1-sccfsi-publicly-document-the-key-configurations-and-crypto-levels-in-openshifts-default-configuration

CC @openshift/sig-security

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/securityhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/P2sig/security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions