feat(rosenpass): wg-remote absent() arm + UPnP mapping metric and alert #86
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_a2c54837"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Two Rosenpass monitoring gaps left open by the Link B rollout (t_0f20d04d), both on Link B (
rpi wg-remote 10.20.0.2 ↔ linode wg0 10.20.0.1).1.
absent()arm for the disappearedwg-remoteseriesRosenpassPskRotationStalled's absent arm only namedrpi/wg0andsiriussec/wg0, so if the Pi's metrics timer or script died thewg-remoteseries vanished and nothing paged — the exact case the arm exists for. Addedabsent(rosenpass_psk_rotation_age_seconds{node="rpi", interface="wg-remote"}). Deliberately nosiriussec/wg-remotearm: that interface does not exist there.2.
rosenpass_upnp_mapping_present{node="rpi"}+RosenpassUpnpMappingLostThe Pi's only inbound path for the Link B exchange is a permanent UPnP mapping
UDP 9999 -> 192.168.1.125:9999(the router has no admin panel).rosenpass-upnp.timerre-asserts it every 15 min but only logged to the journal when it could not:rosenpass-upnp.shnow stamps its result to/run/rosenpass-upnp.present(1/0) on every run.rosenpass-metrics.shreads that file intorosenpass_upnp_mapping_present{node="rpi"}androsenpass_upnp_last_check_timestamp_seconds{node="rpi"}(the state file's mtime). It does not callupnpc— that would poll the IGD 1440×/day. A host without the state file (siriussec) emits neither series.RosenpassUpnpMappingLost(warning, 10m) fires on value0, on a state file older than 30 minutes (stopped timer / hung IGD — so a stale1cannot keep reading healthy), or onabsent().Testing (per
infrastructure/networking/rosenpass/README.md§ Testing the rules without merging)kubectl run-style pod withquay.io/prometheus/prometheus:v3.15.1-distroless(the live Prometheus image):The
promtool test rulesfile is generated fromrosenpass.yamlitself (annotations copied, so expectations cannot drift) and covers six scenarios:rosenpass_unit_active{node="rpi"} 0— onlyRosenpassDown{node="rpi"}fires;wg0age 1800 and thewg-remoteseries missing — twoRosenpassPskRotationStalledalerts, one per arm (this is the new one);RosenpassUpnpMappingLost{node="rpi"};present=1but last check >30 min old —RosenpassUpnpMappingLost{node="rpi"}.The test file stays out of the repo (per the README it duplicates the annotation strings), but the generator is reproducible from
rosenpass.yaml.Scope
Host-script changes are installed on rpi only (the metric only exists there);
siriussecruns the same file and skips both series because it has no state file. No key material anywhere — the metrics script still hashes only.Link B (rpi wg-remote <-> linode wg0) depends on a permanent UPnP mapping UDP 9999 -> 192.168.1.125:9999 for its inbound path, and the 15-minute rosenpass-upnp.timer only logged to the journal when it could not re-assert it. Two gaps closed: * RosenpassPskRotationStalled gains absent(rosenpass_psk_rotation_age_seconds {node="rpi", interface="wg-remote"}). Without it a dead metrics timer or script on the Pi silently dropped the Link B series while the rule kept reading healthy. No siriussec/wg-remote arm: that interface does not exist there. * rosenpass-upnp.sh now stamps its result to /run/rosenpass-upnp.present (1/0) and rosenpass-metrics.sh reads that file into rosenpass_upnp_mapping_present {node="rpi"} plus rosenpass_upnp_last_check_timestamp_seconds. The 60 s metrics timer never calls upnpc (that would poll the IGD 1440x/day); a host without the state file (siriussec) emits neither series. New RosenpassUpnpMappingLost alert fires on value 0, on a state file older than 30 minutes (stopped timer / hung IGD, so a stale 1 cannot read healthy), or on a missing series.