Truststore override for delegates
Learn how to customize delegate truststores to limit trusted certificates and meet enterprise security protocols while maintaining Harness connectivity.
Harness Delegates perform most Harness tasks. Delegates make outbound TLS/SSL connections to the Harness SaaS platform to obtain these task assignments. The TLS/SSL connection from the delegate to Harness requires a trusted certificate.
Harness Delegate ships with a Java Runtime Environment (JRE) that includes a default trusted certificate in its truststore (located at /etc/pki/java/cacerts). This truststore uses multiple trusted certificates. You can limit the number you use based on your company security protocols.
The JRE truststore must include the certificate that delegates require to establish trust with Harness (app.harness.io).
This topic describes how to limit the truststore used with Harness Delegates and ensure the trusted certificate Harness requires is included in the delegate truststore.
Before you begin
Required: Harness trusted certificate
TLS/SSL communication between the Harness Delegate and Harness SaaS uses a certificate from the DigiCert Global Root CA:

For delegates to communicate with Harness, this root CA certificate must be installed in the delegate truststore.
The public CA for the certificate is available for download:
This topic describes how to import this certificate into a new truststore.
Third-party certificates
Harness Delegate also connects to the third-party tools you use with Harness. You should also include those certificates in the delegate truststore.
For example, to pull a Docker image from an artifact server like Nexus or DockerHub, the truststore must include the certificates that those tools require.
Step 1: Stop the delegate
You don't need to stop the Kubernetes delegate. You can run kubectl apply after you update the Kubernetes delegate YAML file.
Step 2: Create truststore with the Harness trusted certificate
Let's walk through the steps of creating a new truststore and importing the Harness trusted certificate.
Copy the following public CA to a file and save it.
In this example, we'll name the file DigiCertGlobalRootCA.pem.
Run the following command to create a truststore:
The above command will ask for a password. You can choose your own password.
This command creates a file named trustStore.jks and imports DigiCert global root CA certificate.
Note where the trustStore.jks file is located. You will provide this path to the delegate as an environment variable.
Step 3: Add third-party certificates to the truststore
You should import any certificates required by the third-party tools you use with Harness.
In most cases, you can navigate to the third-party tool's website portal and download the certificate using a Copy or Export button in the browser. Save the certificate as a PEM (.pem) file and import it into the truststore.
To add multiple certificates in the trustStore.jks file you created, run the keytool -import command multiple times with the different aliases and certificate PEM files for the certificates you are importing.
Step 4: Update the delegate JAVA_OPTS environment variable
Update the delegate JAVA_OPTS environment variable to point to the location of the new truststore file.
Kubernetes delegate
Edit the Kubernetes delegate YAML file. It's named harness-delegate.yaml.
Open the delegate YAML file in a text editor.
In the Deployment specification, locate the env field, and then find the JAVA_OPTS environment variable.
Here's what the default setting looks like:
Update the JAVA_OPTS environment variable with the location of the new trustStore.jks file and the password.
For example:
Next, you can apply the delegate YAML file, described in the next step.
Step 5: Start the delegate
Now that the JAVA_OPTS environment variable is updated, you can start the delegate.
Kubernetes delegate
Apply the Kubernetes delegate YAML file you edited:
The delegate starts and appears on the Harness Delegates page.
Last updated
Was this helpful?