This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Este contenido no está disponible en el idioma seleccionado.
Chapter 9. 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, and OpenShift OAuth server. 
- the kubelet, when it acts as an HTTP server for the Kubernetes API server
9.1. Understanding TLS security profiles
You can use a TLS (Transport Layer Security) security profile 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 recommended configuration for the majority of clients. It 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  | 
| 
								 | 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  Note 
									In OpenShift Container Platform 4.6, 4.7, and 4.8, the  Important 
									The  | 
| 
								 | This profile allows you to define the TLS version and ciphers to use. Warning 
									Use caution when using a  Note 
									OpenShift Container Platform router enables Red Hat-distributed OpenSSL default set of TLS  | 
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.
9.2. 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.
The effective configuration of minimum TLS version and list of ciphers for a profile might differ between components.
Procedure
- View details for a specific TLS security profile: - oc explain <component>.spec.tlsSecurityProfile.<profile> - $ oc explain <component>.spec.tlsSecurityProfile.<profile>- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- 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.intermediate - $ oc explain apiserver.spec.tlsSecurityProfile.intermediate- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- View all details for the - tlsSecurityProfilefield of a component:- oc explain <component>.spec.tlsSecurityProfile - $ oc explain <component>.spec.tlsSecurityProfile- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- For<component>, specifyingresscontroller,apiserver, orkubeletconfig.
 - For example, to check all details for the - tlsSecurityProfilefield for the Ingress Controller:- oc explain ingresscontroller.spec.tlsSecurityProfile - $ oc explain ingresscontroller.spec.tlsSecurityProfile- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
9.3. 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.
			
Sample IngressController CR that configures the Old TLS security profile
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.
			
					The HAProxy Ingress Controller image does not support TLS 1.3 and because the Modern profile requires TLS 1.3, it is not supported. The Ingress Operator converts the Modern profile to Intermediate.
				
					The Ingress Operator also converts the TLS 1.0 of an Old or Custom profile to 1.1, and TLS 1.3 of a Custom profile to 1.2.
				
Prerequisites
- 
						You have access to the cluster as a user with the cluster-adminrole.
Procedure
- Edit the - IngressControllerCR in the- openshift-ingress-operatorproject to configure the TLS security profile:- oc edit IngressController default -n openshift-ingress-operator - $ oc edit IngressController default -n openshift-ingress-operator- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Add the - spec.tlsSecurityProfilefield:- Sample - IngressControllerCR for a- Customprofile- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Save the file to apply the changes.
Verification
- Verify that the profile is set in the - IngressControllerCR:- oc describe IngressController default -n openshift-ingress-operator - $ oc describe IngressController default -n openshift-ingress-operator- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
9.4. 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
				If a TLS security profile is not configured, the default TLS security profile is Intermediate.
			
The default TLS security profile for the Ingress Controller is based on the TLS security profile set for the API server.
Sample APIServer CR that configures the Old TLS security profile
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.
			
					The control plane does not support TLS 1.3 as the minimum TLS version; the Modern profile is not supported because it requires TLS 1.3.
				
Prerequisites
- 
						You have access to the cluster as a user with the cluster-adminrole.
Procedure
- Edit the default - APIServerCR to configure the TLS security profile:- oc edit APIServer cluster - $ oc edit APIServer cluster- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Add the - spec.tlsSecurityProfilefield:- Sample - APIServerCR for a- Customprofile- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Save the file to apply the changes.
Verification
- Verify that the TLS security profile is set in the - APIServerCR:- oc describe apiserver cluster - $ oc describe apiserver cluster- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
9.5. Configuring the TLS security profile for the kubelet
				To configure a TLS security profile for the kubelet when it is acting as an HTTP server, create 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 is Intermediate.
			
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.
Sample KubeletConfig CR that configures the Old TLS security profile on worker nodes
				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.
			
Prerequisites
- 
						You have access to the cluster as a user with the cluster-adminrole.
Procedure
- Create a - KubeletConfigCR to configure the TLS security profile:- Sample - KubeletConfigCR for a- Customprofile- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the TLS security profile type (Old,Intermediate, orCustom). The default isIntermediate.
- 2
- Specify the appropriate field for the selected type:- 
										old: {}
- 
										intermediate: {}
- 
										custom:
 
- 
										
- 3
- For thecustomtype, specify a list of TLS ciphers and minimum accepted TLS version.
- 4
- Optional: Specify the machine config pool label for the nodes you want to apply the TLS security profile.
 
- Create the - KubeletConfigobject:- oc create -f <filename> - $ oc create -f <filename>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Depending on the number of worker nodes in the cluster, wait for the configured nodes to be rebooted one by one. 
Verification
					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> - $ oc debug node/<node_name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Set - /hostas the root directory within the debug shell:- chroot /host - sh-4.4# chroot /host- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- View the - kubelet.conffile:- cat /etc/kubernetes/kubelet.conf - sh-4.4# cat /etc/kubernetes/kubelet.conf- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow