Configure Internal TLS communication between Harbor Component

By default, the internal communication between Harbor’s components (harbor-core, harbor-jobservice, proxy,harbor-portal, registry, registryctl, trivy_adapter, clair_adapter, chartmuseum) use the HTTP protocol, which might not be secure enough for production environments. Since Harbor v2.0, TLS can be used for this internal network. In production environments, using HTTPS is a recommended best practice.

This functionality is implemented using the internal_tls parameter in the harbor.yml file. To enable internal TLS, set enabled to true and set the dir value to the path of directory that contains the internal cert files.

You can generate certs using the prepare tool.

docker run -v /:/hostfs goharbor/prepare:v2.0 gencert -p /path/to/internal/tls/cert

You can also provide your own CA to generate the other certs. To do this, put the certificate and key of the CA on internal tls cert directory, and name them harbor_internal_ca.key and harbor_internal_ca.crt. You can also provide the certs for all components. However, there are some constraints for the certs:

  • All certs must be signed by a single unique CA
  • The filename of the internal cert and CN field on cert file must follow the conventions in the following table:
    nameusageCN
    harbor_internal_ca.keyca’s key file for internal TLSN/A
    harbor_internal_ca.crtca’s certificate file for internal TLSN/A
    core.keycore’s key fileN/A
    core.crtcore’s certificate filecore
    job_service.keyjob_service’s key fileN/A
    job_service.crtjob_service’s certificate filejobservice
    proxy.keyproxy’s key fileN/A
    proxy.crtproxy’s certificate fileproxy
    portal.keyportal’s key fileN/A
    portal.crtportal’s certificate fileportal
    registry.keyregistry’s key fileN/A
    registry.crtregistry’s certificate fileregistry
    registryctl.keyregistryctl’s key fileN/A
    registryctl.crtregistryctl’s certificate fileregistryctl
    notary_server.keynotary_server’s key fileN/A
    notary_server.crtnotary_server’s certificate filenotary-server
    notary_signer.keynotary_signer’s key fileN/A
    notary_signer.crtnotary_signer’s certificate filenotary-signer
    trivy_adapter.keytrivy_adapter.’s key fileN/A
    trivy_adapter.crttrivy_adapter.’s certificate filetrivy-adapter
    clair.keyclair’s key fileN/A
    clair.crtclair’s certificate fileclair
    clair_adapter.keyclair_adapter’s key fileN/A
    clair_adapter.crtclair_adapter’s certificate fileclair-adapter
    chartmuseum.keychartmuseum’s key fileN/A
    chartmuseum.crtchartmuseum’s certificate filechartmuseum