ADR-0033: The health check watches Certificate Transparency through Cert Spotter#
- Status: accepted
- Date: 2026-11-27
Context#
The zone's CAA record names only Amazon's CA domains and forbids wildcards, so a certificate from any other public CA is a policy violation. CAA says what is permitted; it does not show what was issued. Certificate Transparency (RFC 6962) does: browsers accept a publicly trusted certificate only if it is logged, so any certificate that could be used against visitors is in the logs.
From outside, the check knows the zone's CAA record and the certificate the site serves, which is the ACM certificate OpenTofu attached. It holds no state or AWS credentials, and ADR-0027 rejected giving it a copy of values from state. After a renewal, the older certificate stays in the logs until it expires.
Reading the logs directly (get-sth and get-entries, RFC 6962 section 4) means downloading every log's entries, billions across a dozen logs, to find a handful. So the source is a CT search service, and a third party (principle 5).
Decision#
- Certificate Transparency is a section of the twice-daily health check,
scripts/health-check.sh, opening the same incident issue. No workflow, schedule, alarm, AWS resource or permission is added, so there is nothing to retire (ADR-0029). - The source is Cert Spotter's issuances API, unauthenticated, asked for the domain and every name under it, page by page until an empty page, over HTTPS only, with one retry on a transient error.
- It fails when:
- the answer cannot be fetched or parsed, runs past five pages, or holds a certificate for none of the domain's names; the other lines then fail as not checked;
- the served certificate's public key is not in the answer, so an empty or stale answer fails instead of passing on nothing;
- an unexpired certificate's CA has none of its CAA domains among the zone's
issuevalues, or Cert Spotter does not know them; - an unexpired certificate names a host, a wildcard included, that the served certificate does not.
- The expectations are read, not written down: allowed CAs from the zone's CAA record, expected names from the served certificate.
- A standard-library helper reads the JSON,
scripts/ct-issuances.py;make test-healthruns the script against a stub API.
Alternatives considered#
A scheduled Lambda, as the roadmap said. A function, schedule, role, alarms (one free alarm metric is left) and apply-role changes, for a check that needs nothing from AWS. Hourly buys little: a mis-issued certificate needs a path to visitors, and the probe watches the delegation hourly.
crt.sh, by JSON or PostgreSQL. No credential, and a best-effort service. It returned an empty list for this domain while Cert Spotter listed its certificate, and often times out under load.
Cert Spotter's paid monitoring, which notifies by email or webhook. From $15 a month, more than the whole stack, and it reaches a mailbox rather than the incident issue.
An API key, for a larger quota. A long-lived credential held as an Actions secret, for two queries a run.
Compare with ACM's certificate list through the read-only role. It would tell OpenTofu's Amazon certificates from anyone else's, but needs AWS credentials in the health check and a trust-policy change, for a case that already needs write access to the zone.
Pin the issuer by name or intermediate key. Amazon adds and rotates intermediates; CAA domains are the identifier the standard uses.
Consequences#
Positive: a certificate from a CA the CAA record does not name, or for a host the site does not serve, opens the incident within about half a day. Nothing new runs or bills.
Negative:
- One more third party. SSLMate sees this domain looked up twice a day, and the check depends on its index being current.
- Unauthenticated queries are for personal or evaluation use, on a small hourly quota. Each run uses two; repeated manual runs can exhaust it.
- A second Amazon certificate for the served names passes. From outside it looks like a renewal, and obtaining one needs write access to the zone.
- Removing a name from the certificate fails the check until the old certificate expires.
- A renewed certificate served before Cert Spotter lists it fails a run.
- A mis-issued certificate fails every run until it expires, revoked or not.
Neutral: a precertificate and its certificate are one issuance.
Revisit when#
- SSLMate withdraws or narrows unauthenticated queries.
- The site serves a second certificate, such as the
legacy.testz.devexhibit on the roadmap: its names are not on the apex's certificate. - The health check gains AWS access for another reason, so ACM's list could be compared.
- A false alarm from a renewal, or a mis-issuance missed between two runs.