Change TLS settings between application and CRDP
Note
It is recommended to keep your registration token and certificates in secret.
It is recommended to keep your secrets in a safe vault.
Steps to enable TLS with mandatory client authentication
Create a secret, if it doesn't exist.
kubectl create secret generic <crdp secret name> --from-file=cert=<certificate file path> --from-file=key=<key file path> --from-file=ca=<ca certificate path>In the CRDP deployment file (for example,
<crdp-deployment.yaml>), add/update the below lines in theenvsection.env: - name: SERVER_MODE value: "tls-cert" - name: CERT_VALUE valueFrom: secretKeyRef: name: <crdp secret name> key: cert - name: KEY_VALUE valueFrom: secretKeyRef: name: <crdp secret name> key: key - name: TRUSTED_CA valueFrom: secretKeyRef: name: <crdp secret name> key: caUpgrade your CRDP deployment.
helm upgrade <release-name> <path of helm chart/chart-name> .Example
helm upgrade crdp <path of helm chart/chart-name> .
Create a secret, if it doesn't exist.
kubectl create secret generic <crdp secret name> --from-file=cert=<certificate file path> --from-file=key=<key file path> --from-file=ca=<ca certificate path> --from-literal=regtoken=<registration token>Note
If your secret already exists with
<registration token>:Update the values of
cert,key, andcain the secret, ORCreate a new secret using the
kubectl create secretcommand as described above
In the CRDP deployment file (for example,
<crdp-deployment.yaml>), add/update the below lines in theenvsection.env: - name: SERVER_MODE value: "tls-cert" - name: CERT_VALUE valueFrom: secretKeyRef: name: <crdp secret name> key: cert - name: KEY_VALUE valueFrom: secretKeyRef: name: <crdp secret name> key: key - name: TRUSTED_CA valueFrom: secretKeyRef: name: <crdp secret name> key: caUpdate your CRDP deployment.
kubectl replace -f <deployment_filename>
Stop the existing container.
Start the container with the updated configuration, as below.
docker run -e KEY_MANAGER_HOST=<IP address or host name> -e REGISTRATION_TOKEN=<registration token> -p <host port>:<CRDP_port> -e SERVER_MODE=tls-cert -e CERT_VALUE="<certificate value>" -e KEY_VALUE="<key value>" -e TRUSTED_CA="<trusted ca>" <crdp image name>In the command,
SERVER_MODEistls-certCERT_VALUE: Value of the client certificate.KEY_VALUE: Value of the key associated with the client certificate.TRUSTED_CA: Value of the CA certificate.
Now, CRDP will verify the certificate presented by the client.
Steps to enable TLS without client authentication
In the
values.yamlfile, underconfiguration, update the value ofservermodetotls-cert-opt.In the CRDP deployment file (for example,
<crdp-deployment.yaml>), add the below lines to thedatasection ofkind:Secret.data: server.crt: {{.Values.configuration.servercrt}} server.key: {{.Values.configuration.serverkey}}Upgrade your CRDP deployment.
helm upgrade <helm chart name> <path of helm chart>
In the CRDP deployment file (for example,
<crdp-deployment.yaml>), in thedatasection ofConfigMap, setSERVER_MODEtotls-cert-opt.Add the following lines to the
datasection ofkind:Secret.data: server.crt: {{.Values.configuration.servercrt}} server.key: {{.Values.configuration.serverkey}} trustedca: {{.Values.configuration.trustedca}}Update your CRDP deployment.
kubectl replace -f <deployment_filename>
Stop the existing container.
In the environment variable, set the
SERVER_MODEfield totls-cert-opt.Specify the environment variables:
CERT_VALUE: Value of the client certificate.KEY_VALUE: Value of the key associated with the client certificate.
Start the container.
docker run -e KEY_MANAGER_HOST=<IP address or host name> -e REGISTRATION_TOKEN=<registration token> -p <host port>:<CRDP_port> -e SERVER_MODE=tls-cert-opt -e CERT_VALUE="<certificate value>" -e KEY_VALUE="<key value>" <crdp image name>
Steps to disable TLS
In the
values.yamlfile, underconfiguration, update the value ofservermodetono-tls.Upgrade your CRDP deployment.
helm upgrade <helm chart name> <path of helm chart>
In your deployment file, in the
datasection ofConfigMap, setSERVER_MODEtono-tls.Update your CRDP deployment.
kubectl replace -f <deployment_filename>
Stop the existing container.
In the environment variable, set the
SERVER_MODEfield tono-tls.Start the container.
docker run -e KEY_MANAGER_HOST=<IP address or host name> -e REGISTRATION_TOKEN=<registration token> -p <host port>:<CRDP_port> -e SERVER_MODE=no-tls <crdp image name>