From 7b9187d11489c88f6d2847a5662af4cb060f7da4 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:44:20 +0000 Subject: [PATCH 1/2] docs(adr): ADR-0130, give Alertmanager its own DNS fallback With AdGuard on trinity as morpheus's only forwarder (ADR-0055), a trinity outage left the ntfy.sh copy of urgent pages and the heartbeat unable to resolve. Alertmanager now lists morpheus first, then 1.1.1.1 and 9.9.9.9; Docker's embedded resolver was measured moving to the next server on SERVFAIL while keeping the matrix.elysium overrides. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +- ...-give-alertmanager-its-own-dns-fallback.md | 115 ++++++++++++++++++ docs/changelog.md | 12 ++ docs/observability.md | 6 +- docs/runbooks/forward-dns-to-adguard.md | 6 +- stacks/observability/compose.yaml | 10 ++ 6 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 docs/adr/0130-give-alertmanager-its-own-dns-fallback.md diff --git a/README.md b/README.md index 4c9d4767e..2c7a48fd5 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ documents for different readers. at all. Every pinned digest is also scanned weekly for fixable HIGH and CRITICAL CVEs, and each image with findings has an open issue until a scan finds it clean. -- **Documented decisions and runbooks.** 129 ADRs covering what was chosen +- **Documented decisions and runbooks.** 130 ADRs covering what was chosen and what was rejected — including the costs accepted knowingly; 54 runbooks for the operations that are easy to get wrong at 1am, one of which is the handover page a successor reads first. Every critical alert links to @@ -236,7 +236,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology │ ├── architecture.md network.md hardware.md │ ├── observability.md security.md roadmap.md changelog.md │ ├── diagrams/ # the network diagram (SVG) and its predecessors -│ ├── adr/ # 129 ADRs — architecture decision records +│ ├── adr/ # 130 ADRs — architecture decision records │ ├── exercises/ # purple-team exercise records — see its README │ └── runbooks/ # 54 runbooks; successor-handover.md is the front door └── Makefile # make help diff --git a/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md b/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md new file mode 100644 index 000000000..7661b679b --- /dev/null +++ b/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md @@ -0,0 +1,115 @@ +# ADR-0130: Give Alertmanager its own DNS fallback + +**Status:** Accepted · 2026-11 + +## Context + +[ADR-0055](0055-forward-to-adguard-alone.md) makes AdGuard on `trinity` the +only forwarder behind Unbound on `morpheus`, and accepts what follows: while +AdGuard is down, nothing in the house resolves an outside name. It makes that +failure loud, with `AdGuardNotAnswering` at critical, and short. + +The page that announces the failure needs DNS to leave the house. Alertmanager +on `prometheus` resolves through Docker's embedded resolver, which forwards to +`morpheus`. Its receivers are: + +- **the in-house ntfy,** `ntfy.matrix.elysium`, which runs on `trinity`. Its + name is a host override that `morpheus` answers itself, without AdGuard; +- **ntfy.sh,** the second copy of every urgent and security page; +- **healthchecks.io,** `hc-ping.com`, the heartbeat that pages when + Alertmanager goes quiet. + +Today, the cases are: + +| What is down | In-house ntfy | ntfy.sh copy | Heartbeat | What you hear | +| --- | --- | --- | --- | --- | +| AdGuard alone | Arrives | Fails to resolve | Fails to resolve | The in-house page, then healthchecks.io calling Alertmanager dead | +| All of `trinity` | Host down | Fails to resolve | Fails to resolve | Only healthchecks.io calling Alertmanager dead | + +The usual cause is the second row: `trinity` rebooting, off, or waiting at its +passphrase prompt. Then the only page names the wrong machine. It happened +on 2026-11-13, when every host was rebooted at once. Alertmanager logged +`lookup hc-ping.com … server misbehaving` from 18:21 to 18:23 while `trinity` +came up, and `AlertmanagerNotificationsFailing` fired. The audit of +`prometheus` that day recorded it as finding 4. + +ADR-0055 rules out the obvious fix. A public forwarder beside AdGuard on +`morpheus` let a third of the house's lookups through unfiltered, and pfSense +cannot express `forward-first`. So a fallback has to cover the alert path +alone. + +Three things were measured on `prometheus` on 2026-11-23 (Docker 29.9.1): + +- **VLAN 99 already reaches public resolvers.** `1.1.1.1` and `9.9.9.9` + answered `hc-ping.com` over UDP and TCP. blackbox-exporter's `8.8.8.8:53` + probe ([`security.md`](../security.md)) uses the same path. Nothing in + ADR-0129 closes it. +- **`morpheus` answers `SERVFAIL` when it cannot forward.** A name AdGuard + blocks gets the same answer, which is why the test below could use one + without taking AdGuard down. ADR-0055 explains the `SERVFAIL`. +- **Docker's embedded resolver tries the next server on `SERVFAIL`, in + order.** A scratch container on a user-defined network, as Alertmanager is, + was given `--dns 10.0.99.1 --dns 1.1.1.1`. It resolved `doubleclick.net` to + a real address from `1.1.1.1` after `morpheus` returned `SERVFAIL`. It + still resolved `ntfy.matrix.elysium` to `10.0.99.40` from `morpheus`. With + `morpheus` alone, `doubleclick.net` did not resolve. + +## Decision + +**Alertmanager gets its own resolver list: `morpheus` first, then two public +resolvers from different operators.** In +[`stacks/observability/compose.yaml`](../../stacks/observability/compose.yaml): + +```yaml +dns: + - 10.0.99.1 + - 1.1.1.1 + - 9.9.9.9 +``` + +`morpheus` stays first, so every name it can answer comes from it. That +includes the `matrix.elysium` overrides, which no public resolver knows. A +public resolver is asked only when `morpheus` fails, and then only for +Alertmanager's own lookups: its three receiver hosts. + +The house's DNS does not change. ADR-0055 stands for every client, and +filtering is not weakened anywhere a person browses. + +## Alternatives considered + +- **A public forwarder on `morpheus`.** Declined: it is ADR-0010's fallback, + which ADR-0055 measured leaking a third of the house's lookups past the + filter. +- **Pin the receivers' addresses** with `extra_hosts`. Declined. ntfy.sh and + healthchecks.io sit behind addresses their operators change without + notice, and a stale pin fails silently on the path that must not. +- **Add the fallback to the host,** in systemd-resolved. Declined: Docker + takes its upstreams from the host, so every process and container on + `prometheus` would get the fallback. That is more than the alert path + needs. +- **Accept it.** The failure is loud, not silent. Declined, because what is + loud is wrong: the page blames Alertmanager for an outage on `trinity`, at + the moment the right page matters most. + +## Consequences + +- **With `trinity` down, the urgent pages reach ntfy.sh.** That covers + `AdGuardNotAnswering`, and `trinity`'s `InstanceDown` once it is due. The + heartbeat keeps pinging, so healthchecks.io no longer calls Alertmanager + dead for a problem on another host. The in-house copy still cannot arrive + while `trinity` is down, because it runs there. +- **Alertmanager's lookups bypass AdGuard while `morpheus` cannot answer.** + They are three hostnames, all of them notification services, so nothing is + lost by not filtering them. The query leaves the house only in that window. +- **An internal name could reach a public resolver** only if `morpheus` itself + failed to answer it. With `morpheus` down there is no route out either, so + in practice it cannot. +- **The fallback depends on Docker's resolver behaviour,** measured on 29.9.1. + After the change is deployed, `nslookup doubleclick.net` inside the + `alertmanager` container proves it in place: it answers only if the + fallback works, because `morpheus` returns `SERVFAIL` for that name. +- **Reopen if:** + - ADR-0055 is reopened by `forward-first` or a second AdGuard, which would + make `morpheus` itself fail over; + - VLAN 99 loses its path to public resolvers; + - Docker changes how its embedded resolver treats `SERVFAIL`. diff --git a/docs/changelog.md b/docs/changelog.md index cd1f666c8..3a4a6f9b7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,18 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-23 +- **Alertmanager has its own DNS fallback + ([ADR-0130](adr/0130-give-alertmanager-its-own-dns-fallback.md)).** With + AdGuard on `trinity` as `morpheus`'s only forwarder (ADR-0055), a `trinity` + outage left the ntfy.sh copy of every urgent page, and the healthchecks.io + heartbeat, unable to resolve. The only page was healthchecks.io calling + Alertmanager dead. That happened on 2026-11-13, and the audit of + `prometheus` recorded it as finding 4. Alertmanager's compose service now + lists `10.0.99.1`, `1.1.1.1` and `9.9.9.9`. A scratch container measured + that Docker's embedded resolver moves to the next server when `morpheus` + answers `SERVFAIL`, and still takes the `matrix.elysium` overrides from + `morpheus`. The house's DNS is unchanged. + - **The monitoring host's weekly prune also removes anonymous volumes that no container uses.** The 2026-11-13 audit of `prometheus` found 69 of them, and there were 99 by today, left behind by validation and scratch runs. diff --git a/docs/observability.md b/docs/observability.md index f429369f3..8eece1ff9 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -788,7 +788,11 @@ separately, so either half can fail without taking the other with it. If the in-house ntfy is the thing that has failed, the page still goes out: `EndpointUnreachable` (from the `http_2xx_tier_ca` probe of `ntfy.matrix.elysium`) and `AlertmanagerNotificationsFailing` are both -critical, so both reach `urgent` and its ntfy.sh copy. The runbook has the +critical, so both reach `urgent` and its ntfy.sh copy. That holds while +`trinity`, and the AdGuard on it, is down too: Alertmanager falls back to +public resolvers when `morpheus` cannot answer +([ADR-0130](adr/0130-give-alertmanager-its-own-dns-fallback.md)), so the +ntfy.sh copy and the heartbeat still resolve. The runbook has the table and the cutover: [`verify-the-alert-path.md`](runbooks/verify-the-alert-path.md#where-the-real-alerts-go). diff --git a/docs/runbooks/forward-dns-to-adguard.md b/docs/runbooks/forward-dns-to-adguard.md index c9865d682..b23cf2a9b 100644 --- a/docs/runbooks/forward-dns-to-adguard.md +++ b/docs/runbooks/forward-dns-to-adguard.md @@ -197,7 +197,11 @@ done; echo "blocked=$b leaked=$l" Since [ADR-0055](../adr/0055-forward-to-adguard-alone.md) there is no fallback to prove. What this proves is that the page reaches you, and about how long -the house is without outside names before it does. **Do not silence +the house is without outside names before it does. Both copies of the page +should arrive, the in-house ntfy and ntfy.sh. The ntfy.sh copy resolves +through Alertmanager's own fallback +([ADR-0130](../adr/0130-give-alertmanager-its-own-dns-fallback.md)), not +through the house's DNS. **Do not silence `AdGuardNotAnswering` for this**: the page is the result. Pick a moment nobody in the house needs the internet for about ten minutes. diff --git a/stacks/observability/compose.yaml b/stacks/observability/compose.yaml index a8bb83ff9..8f3ebfa8c 100644 --- a/stacks/observability/compose.yaml +++ b/stacks/observability/compose.yaml @@ -349,6 +349,16 @@ services: - no-new-privileges:true # No tmpfs needed; see prometheus above for how that was established. read_only: true + # ADR-0130. morpheus first, so the matrix.elysium overrides (the in-house + # ntfy) still answer from it. The public two are asked only when morpheus + # fails: Docker's embedded resolver moves to the next server on SERVFAIL, + # which is what morpheus answers while AdGuard on trinity is down + # (ADR-0055). Without them, the ntfy.sh copy and the heartbeat cannot + # resolve during the outage they should be reporting. + dns: + - 10.0.99.1 + - 1.1.1.1 + - 9.9.9.9 command: - --config.file=/etc/alertmanager/alertmanager.yaml - --storage.path=/alertmanager From 8a94ae737cbbfb5c345422054eb90b3c02554046 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:57:52 +0000 Subject: [PATCH 2/2] docs(adr): ADR-0130 records the name leak when Unbound fails alone The matrix.elysium overrides are Unbound's, so an Unbound failure while morpheus still routes sends ntfy.matrix.elysium to the public resolvers. Accepted: the name is already published here. Co-Authored-By: Claude Opus 5.5 --- .../0130-give-alertmanager-its-own-dns-fallback.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md b/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md index 7661b679b..5e403e3b9 100644 --- a/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md +++ b/docs/adr/0130-give-alertmanager-its-own-dns-fallback.md @@ -101,9 +101,14 @@ filtering is not weakened anywhere a person browses. - **Alertmanager's lookups bypass AdGuard while `morpheus` cannot answer.** They are three hostnames, all of them notification services, so nothing is lost by not filtering them. The query leaves the house only in that window. -- **An internal name could reach a public resolver** only if `morpheus` itself - failed to answer it. With `morpheus` down there is no route out either, so - in practice it cannot. +- **An internal name reaches a public resolver if Unbound fails while + `morpheus` keeps routing.** The `matrix.elysium` overrides are Unbound's, + so a stopped or wedged Unbound fails them along with every outside name. + Docker then asks `1.1.1.1` and `9.9.9.9` for `ntfy.matrix.elysium`. They + answer `NXDOMAIN`, and the in-house copy fails as it would have anyway, but + the name has left the house. That is accepted: the name is already + published in this repository, and the query carries nothing else. A whole + `morpheus` outage leaks nothing, because then there is no route out either. - **The fallback depends on Docker's resolver behaviour,** measured on 29.9.1. After the change is deployed, `nslookup doubleclick.net` inside the `alertmanager` container proves it in place: it answers only if the