ADR-0020: An hourly DNSSEC probe in Lambda, asking public resolvers over DoH#

  • Status: accepted. In force since 25 November 2026 (see Current status).
  • Date: 2026-11-25

Context#

DNSSEC fails hard. If the DS record at the registrar stops matching the key-signing key, every validating resolver returns SERVFAIL and the domain is gone for most of the internet, while it still resolves for anyone whose resolver does not validate (DNSSEC).

The two CloudWatch alarms in the guardrails module watch Route 53's own signing. They cannot see the registrar's side: Route 53 keeps signing correctly while the DS no longer matches. Only a probe from outside sees that, the way a client would (principle 8). The dns-health workflow is that probe, scheduled twice a day. The review of 24 November 2026 found that GitHub started every observed scheduled run between 4½ and 12 hours late (finding 8). GitHub documents that scheduled workflows can be delayed under load, and on a private repository there is nothing to tune.

The domain is at an external registrar, so the DS is entered by hand and cannot be checked by OpenTofu (manage_registrar_ds = false). On 24 November the DS was published and both resolvers the health check asks set the AD flag.

Constraints: no new dependency in the Lambda (ADR-0007's reasoning, and edge-api's pattern), no standing credential, free tier where possible (principle 7), and a probe that warns rather than wedges and can be shown to fail (principles 2 and 6).

Decision#

An AWS Lambda function, run hourly by EventBridge Scheduler, asks three public validating resolvers over DNS-over-HTTPS whether the zone validates, and two CloudWatch alarms carry the result to the existing alert topic. dns-health stays, as the full twice-daily report that opens an issue.

  1. What it asks. For each resolver, two SOA queries with the AD and DO bits

set. The parent zone (dev) is a control: if it does not come back validated, that resolver abstains. The zone itself must come back NOERROR with AD and an SOA. SERVFAIL (bogus), NOERROR without AD (insecure, meaning the DS is gone) and NXDOMAIN are failing votes. A transport error is retried once and then abstains; a SERVFAIL is never retried.

  1. Who it asks. Cloudflare, Google and NextDNS, three independent operators,

by their RFC 8484 endpoints. Two of three must agree for a verdict, so one resolver's outage or one stale cache can neither raise nor clear the alarm.

  1. How. DNS wire format over HTTPS, written with Python's standard library

(struct, ssl, urllib). HTTPS authenticates the resolver; RFC 6840 section 5.7 says a stub may trust the AD bit only over a channel it trusts to the resolver, and plain UDP from Lambda is not one.

  1. How a result becomes an alert. One log line per run in CloudWatch

Embedded Metric Format. CloudWatch Logs extracts two metrics, so the function needs no permission beyond writing its own log group: no PutMetricData, no sns:Publish.

    • testz-prod-dnssec-chain-of-trust: a broken verdict. One-minute period,

missing data ignored, so only a conclusive run changes its state.

    • testz-prod-dnssec-probe-silent: no verdict for three consecutive hours.

Missing data is breaching, so a probe that stops running, crashes or cannot reach a quorum alarms instead of looking healthy.

Both notify on ALARM and on OK.

  1. How it is shown to fail. Invoked with {"self_test": true}, the probe

asks about dnssec-failed.org, a zone kept deliberately mis-signed, so the real alarm fires through the real path. The event can choose only that domain. The alarm-delivery-test workflow's dnssec-probe-end-to-end option runs it and then a normal run that clears the alarm.

  1. What it may do. The function's role writes its own log group. The

scheduler's role invokes this function. Both carry the workload permissions boundary; the scheduler's trust policy is scoped by aws:SourceAccount and aws:SourceArn (the schedule group, as AWS documents). This needs three bootstrap-layer changes, applied by bootstrap-account before terraform-apply:

    • the boundary allows lambda:InvokeFunction on testz-* functions;
    • the apply role may manage testz-* schedules in the default group, pass

workload roles to scheduler.amazonaws.com, invoke the probe (for the self-test) and force the state of the two new alarms (for the delivery test).

Alternatives considered#

Run dns-health more often, or on a different CI. A schedule GitHub runs hours late is still late at a higher frequency, and the delay is GitHub's to choose. Another CI service is another third party with write access to nothing useful, and still not punctual by contract.

Plain DNS over UDP/TCP to the resolvers' anycast addresses. Standard library too, and the same resolvers. Lost because nothing authenticates the answer, and the AD bit is the whole result (RFC 6840 section 5.7).

DNS-over-TLS (RFC 7858). Authenticated, standard library, and supported by all the large resolvers, including Quad9. Lost only because it could not be tested from the environment this was built in, which reaches the internet through an HTTPS proxy. Shipping an untested transport for the most important alarm in the stack is worse than choosing a tested one. See Revisit when.

Quad9 as the third resolver. Quad9 is the obvious third choice and validates. Its DoH endpoint answered HTTP 505 (version not supported) to HTTP/1.1 on 25 November 2026, and Python's standard library has no HTTP/2 client. A dependency to add HTTP/2 would break the no-dependency rule for one resolver. NextDNS's unconfigured endpoint validates, does no filtering, and answers HTTP/1.1. AdGuard also passed but filters by default. DNS.SB returned HTTP 503 in place of a SERVFAIL, which would make a broken zone look like a resolver outage.

Validate the chain inside the function (fetch DS, DNSKEY and RRSIGs, verify ECDSA signatures). Independent of any resolver, but needs ECDSA verification, which the standard library lacks, so a dependency; and it answers a different question. What matters is what visitors' resolvers do, and the large public resolvers are most of them.

Publish to SNS directly instead of a metric and alarm. One fewer hop, but the function would need sns:Publish (and the boundary would have to allow it), every hourly failure would email again with no OK when it recovers, and a probe that stopped running would send nothing at all. CloudWatch alarms give state, de-duplication, OK notifications and missing-data handling for free.

PutMetricData instead of Embedded Metric Format. Same metrics, but a permission in the role and the boundary. EMF needs only the log write the function already has.

A scheduled EventBridge rule instead of Scheduler. It invokes through a resource policy, so it would need no role and no PassRole. AWS now documents scheduled rules as a legacy feature and recommends Scheduler. Scheduler's role is one more identity, carries the boundary, and is scoped to one function and the default schedule group; that cost is small and the result is not built on a deprecated feature.

Open a GitHub issue from the function, as dns-health does. Needs a GitHub credential stored in AWS, which is a long-lived credential (principle 4). The alert topic already reaches the owner and is tested end to end (ADR-0018). dns-health still opens issues.

One alarm for both failure and silence. Missing data would then have to be either breaching (every quiet minute between hourly runs is a failure) or not (a stopped probe looks healthy). Two alarms also say in the subject line which kind of trouble it is.

Consequences#

Positive: a registrar-side break of the chain of trust is alerted within about an hour plus the zone's cache times (the SOA's TTL is 900 seconds; a DS or DNSKEY change is seen when resolvers' cached copies expire, up to their TTLs). A probe that stops working is itself alerted within about three hours. The probe can be made to fail on demand, through the real resolvers and the real alarm.

Negative:

  • Three third-party services. Cloudflare, Google and NextDNS see a query for

testz.dev, dev and, in a self-test, dnssec-failed.org, about 1,500 a month each, from an AWS address. The names are public and no visitor data is involved, but each operator's resolver is now part of the monitoring path (principle 5). The quorum is what makes that acceptable: no single one can cause or hide an alert.

  • One more third party for the self-test: dnssec-failed.org is maintained

by Comcast as a public test zone. If it disappears or is fixed, the self-test stops proving anything and the workflow fails, rather than passing.

  • An always-on component (principle 7: a service to monitor is a cost). It

is monitored by its own silence alarm.

  • The workload boundary widens to allow lambda:InvokeFunction on the

project's functions, for every role CI creates. It still denies IAM, Organizations, account and sts:AssumeRole.

  • The apply role widens: schedules, passing roles to Scheduler, invoking the

probe, and forcing two more alarms' state.

  • Removing the DS on purpose now alarms. The emergency runbook pulls the DS

first; the probe will then report the zone insecure, correctly, until the DS is restored or the probe is turned off with DNSSEC.

Neutral: cost stays within the perpetual free tiers (720 invocations a month, two custom metrics, two alarm metrics; see cost). The Lambda environment holds no commit SHA, so the probe adds nothing to the plan noise of roadmap item 5.

Current status#

25 November 2026: built, not yet applied. Nothing in this ADR is in force until the owner runs bootstrap-account and then terraform-apply from main, and the dnssec-probe-end-to-end test has reached the inbox. Until then the only external check is still dns-health.

25 November 2026, later: in force. bootstrap-account changed the three policies and terraform-apply added the nine resources; the dnssec-probe-end-to-end test then made the probe report dnssec-failed.org broken, testz-prod-dnssec-chain-of-trust went to ALARM within a minute, a normal run reported testz.dev healthy and it went back to OK, and both emails reached the alert inbox. The hourly schedule's own runs are watched by testz-prod-dnssec-probe-silent: if it does not fire, that alarm says so within about three hours.

Revisit when#

  • DNS-over-TLS can be tested from where this is built: it would let Quad9 replace

a smaller resolver without a dependency.

  • Python's standard library gains an HTTP/2 client, for the same reason.
  • One of the three resolvers stops validating, stops answering HTTP/1.1 or starts

filtering: the control query makes it abstain, and three abstaining runs in a row are a probe-silent alarm, so this will be noticed.

  • The domain moves to Route 53 Domains (manage_registrar_ds = true). The DS is

then in OpenTofu's hands, though a probe from outside is still the only check that sees what resolvers see.

  • GitHub scheduled workflows become punctual, for example once the repository is

public. The probe would still be worth keeping for its alerting path, but dns-health could take over the silence check.

Built 2026-11-25 from commit 33bfabf6a27d4baeecf228c31bd5d636a3965070. This page was generated from the same source that provisions the infrastructure it describes.