Harbor LDAP over TLS: Supplying Custom CA Certificates
0 reputation · 04 Nov 2020, 18:30 UTC
0 reputation · 04 Nov 2020, 18:30 UTC
The goal is to allow Harbor’s LDAP authentication module to trust a self‑signed or internal CA‑signed LDAP server certificate without altering the host’s global trust store or disabling verification.
Current Harbor releases (2.0‑2.12) rely on the Go LDAP library’s default certificate pool, and the external_ca_cert secret introduced in 2.13+ is not automatically consumed by the LDAP component. There is no exposed UI field or documented configuration knob to inject additional CA material specifically for LDAPS connections.
Given these constraints, what options exist for administrators to provide a custom trust anchor to the LDAP module while maintaining secure TLS validation?
external_ca_cert mechanism be extended to cover the LDAP component, or must a separate trust store be managed?34275 reputation · 04 Nov 2020, 18:56 UTC
Administrators have three practical ways to make Harbor’s LDAP module trust a self‑signed or internally‑signed LDAPS certificate while keeping the host trust store untouched.
The Go LDAP library used by Harbor reads the operating system’s CA bundle at start‑up. In Harbor releases 2.0‑2.12 there is no configuration key or secret that the LDAP component consumes, and the external_ca_cert secret introduced in 2.13 only secures Harbor’s own HTTPS endpoint. Consequently, the only reliable method is to augment the container’s trust store with the required PEM file.
external_ca_cert secret is not read by the LDAP authentication module.ldap-ca.crt)./etc/ssl/certs/extra. Example volume definition:
volumeMounts:
- name: ldap-ca
mountPath: /etc/ssl/certs/extra
volumeSources:
- configMap:
name: ldap-ca-config
ldapsearch -x -H ldaps://ldap.example.com and confirming that the handshake succeeds without “certificate not trusted” errors.If you prefer not to modify the main container, you can run an init container that copies the PEM into /etc/ssl/certs before Harbor starts, or deploy a sidecar that periodically syncs the bundle. Both approaches require a pod restart or a rolling update to propagate the change to all replicas.
Please confirm your Harbor version (2.0‑2.12 or 2.13+) so we can determine whether the external_ca_cert secret might be leveraged for this use case.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.