Repository navigation
feat(network): watch the dynamic DNS record against the WAN address - #627
Merged
Merged
Conversation
ADR-0044 left record freshness unmonitored, and the WAN address is sticky, so a broken updater would stay hidden until the day the address moved and the operator was outside trying to get in. gateway-state now also sends a script to morpheus over ssh on stdin. It reads the name from config.xml and the address from the WAN interface, asks 1.1.1.1 with drill, and prints one word: match, stale or unchecked. Neither value leaves the firewall. Two booleans are emitted, labelled with host alone: homelab_ddns_record_checked, and homelab_ddns_record_matches_wan, which is left out when the comparison could not run. A resolver outage therefore never reads as a stale record. DdnsRecordStale fires after an hour of mismatch, which is four samples, well past any forced update or TTL. DdnsRecordUnchecked fires after six hours without a comparison, so a broken check cannot pass as silence. The verdict logic is covered by eleven self-test fixtures; each rule has firing and quiet promtool cases. Docs: what the series do and do not disclose (observability.md), runbook rows for both alerts, a marked update under ADR-0044's consequence, and the rule counts moved from 94 to 96 and from 112 to 114. Closes #604 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #604.
What
make gateway-state, which runs every 15 minutes, now also checks whether the remote path's dynamic DNS name still resolves at a public resolver to the address the WAN holds.morpheus. A script goes over ssh on stdin. On the firewall it reads the name fromconfig.xmlthrough pfSense's config API and the address from the interface, then runsdrill @1.1.1.1. It prints one word:match,staleorunchecked. The name and the address never appear in an argv, a variable, a log or a series on the monitoring host.hostalone.homelab_ddns_record_checked, andhomelab_ddns_record_matches_wan. The second is left out when the comparison did not run, so a resolver outage cannot look like a stale record. NXDOMAIN, an empty answer, and one right A beside one wrong A all count asstale.DdnsRecordStale(warning):matches_wan == 0for 1h, which is four samples and well past a forced update or the TTL. The description gives both causes and says Force update comes first.DdnsRecordUnchecked(warning):checked == 0for 6h, so a broken check cannot pass as silence.Docs
observability.md: what the series do and do not disclose.open-the-remote-path.md: runbook rows for both alerts, plus a note in §0 step 4.Verified
collect-gateway-state.sh --self-test: 16 cases. Eleven are new: ten fixtures for the verdict awk, plus ansh -nparse check of the firewall script.morpheus:checked 1andmatches_wan 1. The firewall script's whole output is one line and one word, and nothing in the full--printoutput is shaped like an IPv4 address.GATEWAY_DDNS_RESOLVER=192.0.2.1:checked 0, and nomatches_wanseries../scripts/validate.shis green after rebasing onto current main.After merge
Converge is report-only. The timer runs
makefrom the main checkout, so the new series and rules go live once that checkout is pulled and Prometheus reloads its rules.🤖 Generated with Claude Code