How do I enable TLS and mTLS for telemetry and gNMI on_change support?
Purpose
To enable TLS communication between MDM and managed NEs, you must deploy a signed TLS certificate to each MDM-managed device that supports gRPC TLS, and import the CA certificates that allow MDM to validate that NE certificate. While it is possible to have more than one CA certificate added to each MDM truststore, to maintain network security it is preferable to limit the number of CA certificates to the minimum required.
You can also enable mutual TLS authentication ( mTLS) on the network mediation interface of the NSP clusters.
The following steps describe how to secure the following NSP communication with NEs by importing a TLS certificate:
CA certificates and certificate chains for gRPC TLS
In one-way TLS between NSP and the NE, the NE acts as the TLS server and MDM acts as the TLS client. MDM must trust the certificate chain presented by the NE: the truststore must contain every certificate required to build a certification path from the NE leaf certificate to a trusted anchor (PKIX validation).
If the NE leaf certificate is issued by an intermediate CA, importing only the root CA into the MDM truststore is often insufficient. Import the intermediate CA certificate (or certificates) as well as the root. You can concatenate intermediate and root PEM files into a single PEM file for placement under tls/telemetry, or place separate PEM files in that directory and import each certificate into the MDM truststore using a distinct keytool alias.
Before you import certificates into MDM, you can verify the chain against the NE certificate with OpenSSL; for example:
# openssl verify -CAfile root_CA.pem -untrusted intermediate_CA.pem node.pem ↵
where root_CA.pem is the trust anchor, intermediate_CA.pem is the issuing intermediate (add another -untrusted option for each additional intermediate), and node.pem is the NE TLS certificate.
When you run keytool -importcert on a PEM file, only the first certificate in the file is typically imported. If a PEM file contains multiple certificates, split the file or import each certificate from a separate PEM file using a separate alias.
Some deployments have required both a combined chain PEM file and the root CA PEM file to remain in tls/telemetry for nspdeployerctl install --config --deploy to process telemetry TLS material as expected. If certificate deployment or gRPC TLS fails after you add only a chain file, add the root CA PEM in the same directory and retry the deploy step, or contact Nokia technical support for your NSP release.
You must perform the procedure on each NSP cluster in a DR deployment.
The TLS certificates for gRPC mediation are separate from the certificates used for internal NSP component communication and NSP client communication.
release-ID in a file path has the following format:
R.r.p-rel.version
where
R.r.p is the NSP release, in the form MAJOR.minor.patch
version is a numeric value
Steps
1 |
Open a terminal session to the NSP deployer VM. |
2 |
Log in as the root or NSP admin user. |
3 |
Transfer the TLS certificate file, either to the following directory, or to another directory that you document for later steps: /opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/tls/telemetry You will require this path later in this procedure. Note: You must not modify or delete any existing file in the directory. |
4 |
Open the following file using a plain-text editor such as vi: /opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/config/nsp-config.yml |
5 |
In the telemetry—tls—gnmi section of the file, configure the caCertPath parameter with the path you used in Step Step 3. |
6 |
Save and close the file. |
7 |
Enter the following command to put the certificate change into effect in the local TLS truststore for each MDM server: # ./nspdeployerctl install --config --deploy. The command restarts each MDM pod in the cluster. |
8 |
Enter the following to update the mTLS Kubernetes server secret on the mediation interface: # ./nspdeployerctl secret -s mediation-mtls-key -n "nsp-psa-privileged" -f tls.key=mtlsKey -f tls.crt=mtlsClientCert -f ca.crt=mtlsCACert update # ./nspdeployerctl secret -s mediation-mtls-key -n "nsp-psa-restricted" -f tls.key=mtlsKey -f tls.crt=mtlsClientCert -f ca.crt=mtlsCACert update where mtlsKey is the full path of the client private key file mtlsClientCert is the full path of the client public certificate file mtlsCACert is the full path of the CA public certificate file Messages like the following are displayed as the server secret is updated: secret/mediation-mtls-key patched The following files may contain sensitive information. They are no longer required by NSP and may be removed. mtlsKey mtlsClientCert mtlsCACert |
9 |
When the redeployment is complete, close the console window. End of steps |