Configuring TLS security profiles
TLS security profiles provide a way for servers to regulate which ciphers a client can use when connecting to the server. This ensures that OpenShift Container Platform components use cryptographic libraries that do not allow known insecure protocols, ciphers, or algorithms.
Cluster administrators can choose which TLS security profile to use for each of the following components:
-
the Ingress Controller
-
the control plane
This includes the Kubernetes API server, Kubernetes controller manager, Kubernetes scheduler, OpenShift API server, OpenShift OAuth API server, OpenShift OAuth server, etcd, the Machine Config Operator, and the Machine Config Server.
-
the kubelet, when it acts as an HTTP server for the Kubernetes API server
Understanding TLS security profiles
You can use a TLS (Transport Layer Security) security profile, as described in this section, to define which TLS ciphers are required by various OpenShift Container Platform components.
The OpenShift Container Platform TLS security profiles are based on Mozilla recommended configurations.
You can specify one of the following TLS security profiles for each component:
| Profile | Description |
|---|---|
|
This profile is intended for use with legacy clients or libraries. The profile is based on the Old backward compatibility recommended configuration. The Note For the Ingress Controller, the minimum TLS version is converted from 1.0 to 1.1. |
|
This profile is the default TLS security profile for the Ingress Controller, kubelet, and control plane. The profile is based on the Intermediate compatibility recommended configuration. The Note This profile is the recommended configuration for the majority of clients. |
|
This profile is intended for use with modern clients that have no need for backwards compatibility. This profile is based on the Modern compatibility recommended configuration. The |
|
This profile allows you to define the TLS version and ciphers to use. Warning Use caution when using a |
Note
When using one of the predefined profile types, the effective profile configuration is subject to change between releases. For example, given a specification to use the Intermediate profile deployed on release X.Y.Z, an upgrade to release X.Y.Z+1 might cause a new profile configuration to be applied, resulting in a rollout.
Viewing TLS security profile details
You can view the minimum TLS version and ciphers for the predefined TLS security profiles for each of the following components: Ingress Controller, control plane, and kubelet.
Important
The effective configuration of minimum TLS version and list of ciphers for a profile might differ between components.
-
View details for a specific TLS security profile:
$ oc explain <component>.spec.tlsSecurityProfile.<profile>- For
<component>, specifyingresscontroller,apiserver, orkubeletconfig. For<profile>, specifyold,intermediate, orcustom.For example, to check the ciphers included for the
intermediateprofile for the control plane:$ oc explain apiserver.spec.tlsSecurityProfile.intermediateExample outputKIND: APIServer VERSION: config.openshift.io/v1 DESCRIPTION: intermediate is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29 and looks like this (yaml): ciphers: - TLS_AES_128_GCM_SHA256 - TLS_AES_256_GCM_SHA384 - TLS_CHACHA20_POLY1305_SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES256-GCM-SHA384 - ECDHE-RSA-AES256-GCM-SHA384 - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - DHE-RSA-AES128-GCM-SHA256 - DHE-RSA-AES256-GCM-SHA384 minTLSVersion: TLSv1.2
- For
-
View all details for the
tlsSecurityProfilefield of a component:$ oc explain <component>.spec.tlsSecurityProfile- For
<component>, specifyingresscontroller,apiserver, orkubeletconfig.For example, to check all details for the
tlsSecurityProfilefield for the Ingress Controller:$ oc explain ingresscontroller.spec.tlsSecurityProfileExample outputKIND: IngressController VERSION: operator.openshift.io/v1 RESOURCE: tlsSecurityProfile <Object> DESCRIPTION: ... FIELDS: custom <> custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic. An example custom profile looks like this: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: TLSv1.1 intermediate <> intermediate is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29 and looks like this (yaml): ... modern <> modern is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility and looks like this (yaml): ... NOTE: Currently unsupported. old <> old is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility and looks like this (yaml): ... type <string> ... - Lists ciphers and minimum version for the
intermediateprofile here. - Lists ciphers and minimum version for the
modernprofile here. - Lists ciphers and minimum version for the
oldprofile here.
- For
Configuring the TLS security profile for the Ingress Controller
To configure a TLS security profile for an Ingress Controller, edit the IngressController custom resource (CR) to specify a predefined or custom TLS security profile. If a TLS security profile is not configured, the default value is based on the TLS security profile set for the API server.
IngressController CR that configures the Old TLS security profileapiVersion: operator.openshift.io/v1
kind: IngressController
...
spec:
tlsSecurityProfile:
old: {}
type: Old
...
The TLS security profile defines the minimum TLS version and the TLS ciphers for TLS connections for Ingress Controllers.
You can see the ciphers and the minimum TLS version of the configured TLS security profile in the IngressController custom resource (CR) under Status.Tls Profile and the configured TLS security profile under Spec.Tls Security Profile. For the Custom TLS security profile, the specific ciphers and minimum TLS version are listed under both parameters.
Note
The HAProxy Ingress Controller image supports TLS 1.3 and the Modern profile.
The Ingress Operator also converts the TLS 1.0 of an Old or Custom profile to 1.1.
-
You have access to the cluster as a user with the
cluster-adminrole.
-
Edit the
IngressControllerCR in theopenshift-ingress-operatorproject to configure the TLS security profile:$ oc edit IngressController default -n openshift-ingress-operator -
Add the
spec.tlsSecurityProfilefield:SampleIngressControllerCR for aCustomprofileapiVersion: operator.openshift.io/v1 kind: IngressController ... spec: tlsSecurityProfile: type: Custom custom: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: VersionTLS11 ...- Specify the TLS security profile type (
Old,Intermediate, orCustom). The default isIntermediate. - Specify the appropriate field for the selected type:
-
old: {} -
intermediate: {} -
modern: {} -
custom:
-
- For the
customtype, specify a list of TLS ciphers and minimum accepted TLS version.
- Specify the TLS security profile type (
-
Save the file to apply the changes.
-
Verify that the profile is set in the
IngressControllerCR:$ oc describe IngressController default -n openshift-ingress-operatorExample outputName: default Namespace: openshift-ingress-operator Labels: <none> Annotations: <none> API Version: operator.openshift.io/v1 Kind: IngressController ... Spec: ... Tls Security Profile: Custom: Ciphers: ECDHE-ECDSA-CHACHA20-POLY1305 ECDHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-GCM-SHA256 Min TLS Version: VersionTLS11 Type: Custom ...
Configuring the TLS security profile for the control plane
To configure a TLS security profile for the control plane, edit the APIServer custom resource (CR) to specify a predefined or custom TLS security profile. Setting the TLS security profile in the APIServer CR propagates the setting to the following control plane components:
-
Kubernetes API server
-
Kubernetes controller manager
-
Kubernetes scheduler
-
OpenShift API server
-
OpenShift OAuth API server
-
OpenShift OAuth server
-
etcd
-
Machine Config Operator
-
Machine Config Server
If a TLS security profile is not configured, the default TLS security profile is Intermediate.
Note
The default TLS security profile for the Ingress Controller is based on the TLS security profile set for the API server.
APIServer CR that configures the Old TLS security profileapiVersion: config.openshift.io/v1
kind: APIServer
...
spec:
tlsSecurityProfile:
old: {}
type: Old
...
The TLS security profile defines the minimum TLS version and the TLS ciphers required to communicate with the control plane components.
You can see the configured TLS security profile in the APIServer custom resource (CR) under Spec.Tls Security Profile. For the Custom TLS security profile, the specific ciphers and minimum TLS version are listed.
-
You have access to the cluster as a user with the
cluster-adminrole.
-
Edit the default
APIServerCR to configure the TLS security profile:$ oc edit APIServer cluster -
Add the
spec.tlsSecurityProfilefield:SampleAPIServerCR for aCustomprofileapiVersion: config.openshift.io/v1 kind: APIServer metadata: name: cluster spec: tlsSecurityProfile: type: Custom custom: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: VersionTLS11- Specify the TLS security profile type (
Old,Intermediate, orCustom). The default isIntermediate. - Specify the appropriate field for the selected type:
-
old: {} -
intermediate: {} -
modern: {} -
custom:
-
- For the
customtype, specify a list of TLS ciphers and minimum accepted TLS version.
- Specify the TLS security profile type (
-
Save the file to apply the changes.
-
Verify that the TLS security profile is set in the
APIServerCR:$ oc describe apiserver clusterExample outputName: cluster Namespace: ... API Version: config.openshift.io/v1 Kind: APIServer ... Spec: Audit: Profile: Default Tls Security Profile: Custom: Ciphers: ECDHE-ECDSA-CHACHA20-POLY1305 ECDHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-GCM-SHA256 Min TLS Version: VersionTLS11 Type: Custom ... -
Verify that the TLS security profile is set in the
etcdCR:$ oc describe etcd clusterExample outputName: cluster Namespace: ... API Version: operator.openshift.io/v1 Kind: Etcd ... Spec: Log Level: Normal Management State: Managed Observed Config: Serving Info: Cipher Suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 Min TLS Version: VersionTLS12 ... -
Verify that the TLS security profile is set in the Machine Config Server pod:
$ oc logs machine-config-server-5msdv -n openshift-machine-config-operatorExample output# ... I0905 13:48:36.968688 1 start.go:51] Launching server with tls min version: VersionTLS12 & cipher suites [TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256] # ...
Configuring the TLS security profile for the kubelet
You can configure a TLS security profile for the kubelet when it is acting as an HTTP server by creating a KubeletConfig custom resource (CR) to specify a predefined or custom TLS security profile for specific nodes.
If a TLS security profile is not configured, the default TLS security profile, Intermediate, is used.
The kubelet uses its HTTP/GRPC server to communicate with the Kubernetes API server, which sends commands to pods, gathers logs, and run exec commands on pods through the kubelet.
KubeletConfig CR that configures the Old TLS security profile on worker nodesapiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
# ...
spec:
tlsSecurityProfile:
old: {}
type: Old
machineConfigPoolSelector:
matchLabels:
pools.operator.machineconfiguration.openshift.io/worker: ""
# ...
You can see the ciphers and the minimum TLS version of the configured TLS security profile in the kubelet.conf file on a configured node.
-
You are logged in to OpenShift Container Platform as a user with the
cluster-adminrole.
-
Create a
KubeletConfigCR to configure the TLS security profile:SampleKubeletConfigCR for aCustomprofileapiVersion: machineconfiguration.openshift.io/v1 kind: KubeletConfig metadata: name: set-kubelet-tls-security-profile spec: tlsSecurityProfile: type: Custom custom: ciphers: - ECDHE-ECDSA-CHACHA20-POLY1305 - ECDHE-RSA-CHACHA20-POLY1305 - ECDHE-RSA-AES128-GCM-SHA256 - ECDHE-ECDSA-AES128-GCM-SHA256 minTLSVersion: VersionTLS11 machineConfigPoolSelector: matchLabels: pools.operator.machineconfiguration.openshift.io/worker: "" #...where:
spec.tlsSecurityProfile.type-
Specifies the TLS security profile type (
Old,Intermediate, orCustom). The default isIntermediate. spec.tlsSecurityProfile.type.custom-
Specifies the appropriate field for the selected type:
-
old: {} -
intermediate: {} -
modern: {} -
custom:
-
spec.tlsSecurityProfile.type.custom-
For the
customtype, specifies a list of TLS ciphers and the minimum accepted TLS version. spec.machineConfigPoolSelector.matchLabels.custom-
Specifies the machine config pool label for the nodes you want to apply the TLS security profile. This parameter is optional.
-
Create the
KubeletConfigobject:$ oc create -f <filename>Depending on the number of worker nodes in the cluster, wait for the configured nodes to be rebooted one by one.
To verify that the profile is set, perform the following steps after the nodes are in the Ready state:
-
Start a debug session for a configured node:
$ oc debug node/<node_name> -
Set
/hostas the root directory within the debug shell:sh-4.4# chroot /host -
View the
kubelet.conffile:sh-4.4# cat /etc/kubernetes/kubelet.confExample output"kind": "KubeletConfiguration", "apiVersion": "kubelet.config.k8s.io/v1beta1", #... "tlsCipherSuites": [ "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" ], "tlsMinVersion": "VersionTLS12", #...