Chapter 2. Adding trusted certificate authorities
Learn how to add custom trusted certificate authorities to Red Hat Advanced Cluster Security for Kubernetes.
2.1. Overview of adding trusted CAs Copy linkLink copied to clipboard!
If you are using an enterprise certificate authority (CA) on your network, or self-signed certificates, you must add the CA’s root certificate to Red Hat Advanced Cluster Security for Kubernetes as a trusted root CA.
Adding trusted root CAs allows:
- Central and Scanner to trust remote servers when you integrate with other tools.
- Sensor to trust custom certificates you use for Central.
You can add additional CAs during the installation or on an existing deployment.
You must first configure your trusted CAs in the cluster where you have deployed Central and then propagate the changes to Scanner and Sensor.
2.2. Configuring additional CAs Copy linkLink copied to clipboard!
You can add custom certificate authorities (CAs) to Red Hat Advanced Cluster Security for Kubernetes by using the ca-setup.sh script to configure single or multiple CA certificates.
Procedure
Download the
ca-setup.shscript.Note-
If you are doing a new installation, you can find the
ca-setup.shscript in thescriptsdirectory atcentral-bundle/central/scripts/ca-setup.sh. -
You must run the
ca-setup.shscript in the same terminal from which you logged into your OpenShift Container Platform cluster.
-
If you are doing a new installation, you can find the
Make the
ca-setup.shscript executable:$ chmod +x ca-setup.shAdd the certificates by using one of the following options:
To add a single certificate, use the
-foption to specify the certificate file:$ ./ca-setup.sh -f <certificate>Note- You must use a PEM-encoded certificate file. The file can have any extension.
-
To update a certificate that you added before, use the
-uoption along with the-foption.
To add many certificates at once, move all the certificates into a directory, and then use the
-doption to specify that directory:$ ./ca-setup.sh -d <directory_name>Note-
You must use PEM-encoded certificate files with a
.crtor.pemextension. - Each file must contain only a single certificate.
-
To update certificates that you added before, use the
-uoption along with the-doption.
-
You must use PEM-encoded certificate files with a
2.3. Propagating changes to services Copy linkLink copied to clipboard!
After you configure trusted CAs, you must make Red Hat Advanced Cluster Security for Kubernetes services trust them.
- If you have configured trusted CAs after the installation, you must restart Central.
- Additionally, if you are also adding certificates for integrating with image registries, you must restart both Central and Scanner.
2.3.1. Restarting the Central container Copy linkLink copied to clipboard!
You can restart the Central container by deleting the Central pod.
If you use Kubernetes, enter kubectl instead of oc.
Procedure
To delete the Central pod, run the following command:
$ oc -n stackrox delete pod -lapp=central
2.3.2. Restarting the Scanner container Copy linkLink copied to clipboard!
You can restart the Scanner container by deleting the pod.
Procedure
Run the following command to delete the Scanner pod:
On OpenShift Container Platform:
$ oc delete pod -n stackrox -l app=scannerOn Kubernetes:
$ kubectl delete pod -n stackrox -l app=scanner
2.3.3. Post-configuration notes for Sensor deployments Copy linkLink copied to clipboard!
New Sensor deployment bundles automatically include the trusted CAs that you added, but an existing Sensor or a Sensor that you deploy by using the sensor.sh script requires additional action.
After you have added trusted CAs and configured Central, any new Sensor deployment bundles that you create include the CAs.
- If an existing Sensor reports problems while connecting to Central, you must generate a Sensor deployment YAML file and update existing clusters.
If you are deploying a new Sensor using the
sensor.shscript, run the following command before you run thesensor.shscript:$ ./ca-setup-sensor.sh -d ./additional-cas/- If you are deploying a new Sensor using Helm, you do not have to run any additional scripts.