Skip to content

Lesson 5 of 9 · 24m

ACME and Renewal Automation That Survives Production

ACME issuance is easy to demo and easy to mis-operate — validation methods, rate limits, secret distribution, reload behavior, and failure alerting are the real design.

ACME removed the excuse for manual renewal, but it did not remove the need for judgment. The protocol is simple: prove control of a name, receive a certificate. The hard part is DNS authority, ingress reachability, secret distribution, reload behavior, rate limits, and knowing renewal stopped weeks before expiry.

Choose the challenge for the environment

HTTP-01 asks the CA to fetch a token over HTTP. It is simple when port 80 reaches the correct ingress. DNS-01 publishes a TXT record and is usually right for wildcards, internal ingress shapes, and services that cannot expose a stable HTTP path.

# cert-manager ClusterIssuer excerpt
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: platform-ops@sudosecurity.org
    privateKeySecretRef:
      name: letsencrypt-account-key
    solvers:
      - dns01:
          cloudflare:
            apiTokenSecretRef:
              name: cloudflare-api-token
              key: api-token

Automate the blast radius, not just issuance

A renewal pipeline has four outputs that must stay synchronized: private key, leaf certificate, intermediate chain, and the running process using them. cert-manager, lego, acme.sh, and cloud load balancers solve issuance differently, but none know your application's reload semantics.

Test whether a secret update is hot-reloaded, requires a rolling restart, or is ignored until the next process start:

openssl s_client -connect api.internal:443 -servername api.internal </dev/null 2>/dev/null   | openssl x509 -noout -serial -enddate

Compare the serial with the newly issued secret, not merely with a file on disk.

Rate limits are architecture feedback

Duplicate-certificate rate-limit incidents usually mean every replica requests its own certificate, broken storage causes reissuance on restart, tests use production ACME, or automation recreates resources because it is not idempotent. Use staging endpoints while building the pipeline.

Renew well before expiry. Thirty days is reasonable for 90-day certificates. Alert when renewal fails, not when expiry approaches. A renewal failure at day 60 is a ticket; day 2 is an incident.

Decide whether renewal reuses keys or rotates them. Rotation limits exposure after compromise; reuse reduces coordination pain. Write the policy down and make automation implement it.

Field notes

  • DNS-01 credentials are powerful; scope tokens to minimum zones and actions.
  • Do not let horizontally scaled services race to solve the same challenge independently.
  • Track the ACME account key like a production secret.
  • Test renewal failure in staging and confirm the alert fires.
  • Automate chain verification too; successful issuance can still produce an unusable served chain.

Was this lesson helpful?

Sign in to rate