Skip to content

About

A cert-manager Domain Chief webhook.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Artifact Hub Release CI

This webhook enables DNS01 validation with cert-manager when using Domain Chief hosted DNS.

Installation

cert-manager must be installed first, see the cert-manager installation docs.

Install the webhook into the same namespace as cert-manager:

helm install cert-manager-webhook-domainchief \
  oci://ghcr.io/chieftools/charts/cert-manager-webhook-domainchief \
  --namespace cert-manager

and upgrade it using:

helm upgrade cert-manager-webhook-domainchief \
  oci://ghcr.io/chieftools/charts/cert-manager-webhook-domainchief \
  --namespace cert-manager

Credentials

You need to supply the webhook with a Domain Chief API key. You can create a new API key here, select the team that owns your domains and ensure the token has only the domainchief:acme:write scope.

The domainchief:acme:write scope only allows publishing and deleting TXT records on _acme-challenge names, it cannot read your domains or change any other DNS record. Keep in mind that anyone holding the key can complete DNS01 challenges and obtain certificates for the domains in your team.

Store the API key in a Secret:

kubectl -n cert-manager create secret generic domainchief-api-key --from-literal=api-key=ctt_...

By default the webhook may only read the Secret named domainchief-api-key in the cert-manager namespace. For a ClusterIssuer the Secret must live in cert-manager's cluster resource namespace (usually cert-manager), for an Issuer it must live in the same namespace as the Issuer. Use the secretAccess.namespaces and secretAccess.secretNames chart values to change which Secrets the webhook may read.

Usage

Create a ClusterIssuer (or Issuer) that uses the webhook as DNS01 solver:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: [email protected]
    privateKeySecretRef:
      name: letsencrypt-account-key
    solvers:
      - dns01:
          webhook:
            groupName: acme.domain.chief.app
            solverName: domainchief
            config:
              apiKeySecretRef:
                name: domainchief-api-key
                key: api-key

And request a certificate, wildcards are supported:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: example-com
  namespace: default
spec:
  secretName: example-com-tls
  issuerRef:
    name: letsencrypt
    kind: ClusterIssuer
  dnsNames:
    - example.com
    - '*.example.com'

The domain must use Domain Chief hosted DNS. Challenge records are always published on the _acme-challenge name of the domain, so the cnameStrategy: Follow solver option is not supported.

A new challenge value takes one to three minutes to reach every hosted DNS nameserver. cert-manager only checks the nameservers it can reach, which can serve the value before the others do, so the webhook waits until Domain Chief reports that every nameserver serves it. A Kubernetes API request cannot take longer than a minute, so until then the challenge shows Error presenting challenge: challenge for … is not served by every hosted DNS nameserver yet and cert-manager presents it again. This is expected and resolves on its own.

Verifying signatures

Images and charts are signed with cosign using keyless signing from the release workflow. Verify them using:

cosign verify ghcr.io/chieftools/cert-manager-webhook-domainchief:<version> \
  --certificate-identity-regexp '^https://github\.com/chieftools/cert-manager-webhook-domainchief/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

cosign verify ghcr.io/chieftools/charts/cert-manager-webhook-domainchief:<version> \
  --certificate-identity-regexp '^https://github\.com/chieftools/cert-manager-webhook-domainchief/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Development

Run the unit tests:

make test

Run the cert-manager conformance suite against the real Domain Chief API, this requires a domain using hosted DNS and an API key with the domainchief:acme:write scope:

TEST_ZONE_NAME=example.com. DOMAINCHIEF_API_KEY=ctt_... make test-conformance

Releasing

Push a vX.Y.Z tag, this publishes the ghcr.io/chieftools/cert-manager-webhook-domainchief image and the oci://ghcr.io/chieftools/charts/cert-manager-webhook-domainchief chart and creates a GitHub release.

About

A cert-manager Domain Chief webhook.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages