Kerberos proxy authentication
Configure Harness Delegate to authenticate to a Kerberos-enabled proxy using SPNEGO/Negotiate authentication.
If your outbound HTTP proxy requires Kerberos/SPNEGO (Negotiate) authentication instead of Basic authentication, the delegate can authenticate to it using a Kerberos keytab you provide. No PROXY_USER or PROXY_PASSWORD is needed.
For standard proxy configuration with Basic authentication, go to Proxy configuration guide.
What you will learn from this topic
This topic covers the following:
Understand the scope of Kerberos proxy authentication in this release
How to configure environment variables for Kerberos authentication
How to author a JAAS login configuration file
How to configure Kerberos settings in
krb5.confHow to deploy a delegate with Kerberos proxy authentication using a complete Kubernetes manifest
How to rotate keytabs without restarting the delegate
How to troubleshoot common authentication failures
Before you begin
Before you configure Kerberos proxy authentication, ensure you have the following:
Kubernetes cluster: You need kubectl access to deploy and configure the delegate. For more information, go to Delegate installation options.
Delegate installed: A Harness Delegate must be installed in your Kubernetes cluster. For more information, go to Delegate overview and Delegate system requirements.
Kerberos keytab: Obtain a keytab file for the delegate principal from your Kerberos administrator.
Kerberos configuration: Your organization's
krb5.confconfiguration file with realm and KDC (Key Distribution Center) details.Network access: The delegate pod must be able to reach your KDC over the network.
Proxy configuration: A proxy server configured to accept Kerberos/Negotiate authentication (not just Basic auth). For Basic authentication proxy setup, go to Proxy configuration guide.
Scope
Kerberos proxy authentication in this release covers delegate-to-Harness Manager traffic only:
REST API calls (heartbeat, task polling, task acknowledgement)
WebSocket tunnel connections
Everything else continues to use Basic authentication (PROXY_USER/PROXY_PASSWORD), for example:
Shell script tasks that run locally on the delegate or over SSH/WinRM
Outbound calls to third-party systems (Terraform Cloud, Jira, Jenkins, HTTP pipeline steps)
Set up Kerberos proxy authentication
Setting up Kerberos proxy authentication requires no UI configuration, no API toggle, and no additional volumes rendered by Harness. You configure everything directly in the delegate manifest yourself.
Perform the following steps to set up Kerberos proxy authentication:
Set the standard proxy environment variables in your delegate manifest (these are the same as for Basic auth):
PROXY_HOST,PROXY_PORT, andPROXY_SCHEME.Set
PROXY_AUTH_TYPE=KERBEROSon the delegate container to enable Kerberos authentication.Provide your own
krb5.conffile and pointKRB5_CONFIGto its path.Author a JAAS login config file (defining a
HarnessKrb5entry) and pointKRB5_JAAS_CONFIGto its path.Ensure the delegate pod can reach your KDC, and that your proxy is configured to accept Kerberos/Negotiate authentication (not just Basic).
The following sections provide detailed configuration instructions for each component.
Environment variables
Configure the following environment variables in your delegate manifest:
PROXY_HOST
Yes
Proxy hostname or IP address. Go to Select PROXY_HOST value for Kerberos-specific guidance.
PROXY_PORT
Yes
Proxy port number (for example, 3128).
PROXY_SCHEME
Yes
Proxy scheme (http or https).
PROXY_AUTH_TYPE
Yes
Set to KERBEROS to enable Kerberos authentication.
PROXY_MANAGER
Yes
Set to true to route Manager traffic through the proxy.
KRB5_CONFIG
Yes
Path to your krb5.conf file (for example, /etc/harness/kerberos/krb5.conf).
KRB5_JAAS_CONFIG
Yes
Path to your JAAS login config file (for example, /etc/harness/kerberos/jaas/jaas.conf).
NO_PROXY
No
Comma-separated list of hosts or domains to bypass the proxy.
JAAS login configuration
Create a JAAS login config file that defines a HarnessKrb5 entry. This file specifies the keytab location and principal to use for authentication.
The entry must be named HarnessKrb5 exactly:
Replace the following values with your actual configuration:
keyTab: Path where your keytab is mounted in the container.
principal: Your delegate's Kerberos principal (must match an entry in the keytab).
Kerberos configuration
Your krb5.conf file defines the Kerberos realm, KDC location, and domain mappings. Here is a recommended configuration:
The following are key settings to understand:
dns_canonicalize_hostname = falseandrdns = falseprevent hostname rewriting before deriving the service principal.dns_lookup_realm = falseanddns_lookup_kdc = falsedisable DNS-based KDC discovery.Do not set
default_keytab_name. The keytab path is specified in your JAAS config.
Select PROXY_HOST value
The Service Principal Name (SPN) sent to the KDC is HTTP/<X>@<realm>, where <X> depends on your PROXY_HOST value and krb5.conf DNS settings.
The following table shows how different PROXY_HOST values and DNS settings affect the SPN hostname:
proxy.example.com
false
false
proxy.example.com (verbatim)
proxy.example.com
false
true
Forward DNS canonical name
proxy.example.com
true
any
PTR record of resolved IP
10.2.204.25
false
any
10.2.204.25 (rarely registered at KDC)
10.2.204.25
true
any
PTR record of that IP
Recommendation: Use the proxy hostname in PROXY_HOST and set rdns = false and dns_canonicalize_hostname = false in your krb5.conf. This ensures the SPN matches what your KDC administrator registered.
Example manifest
The following is a complete Kubernetes manifest example that demonstrates how to configure a delegate with Kerberos proxy authentication.
This example uses the standard Harness Delegate image. If you need to customize the delegate image with additional tools or configurations, go to Build custom delegate images using Dockerfile.
Rotate keytabs
If you rotate keytabs periodically (for example, using a sidecar container), the delegate picks up the new keytab automatically on the next proxy challenge. No restart is required.
Use a sidecar for rotation
You can share the keytab between containers using an emptyDir volume. The following example shows how to configure a keytab rotation sidecar:
In this configuration:
The sidecar writes the keytab to the shared volume.
The delegate reads the keytab from the shared volume.
If the keytab is not yet present when the delegate starts, authentication attempts fail and log a warning, but subsequent attempts succeed once the sidecar has written the keytab.
Troubleshooting
Additional considerations
In-cluster Kubernetes delegate
If the delegate runs in-cluster and needs to access Kubernetes APIs, add the cluster master IP to NO_PROXY to bypass the proxy for in-cluster connections.
The following example shows how to configure NO_PROXY:
mTLS support
Harness supports mTLS authentication on a case-by-case basis. Contact Harness Support to enable it.
Next steps
Continue with the following related topics:
Go to Proxy configuration guide to learn how to configure proxy settings with Basic authentication.
Go to Delegate overview to understand delegate architecture, lifecycle, and operational capabilities.
Last updated
Was this helpful?