Store device FIB for observability (no rule limiting) #5

Merged
benvin merged 1 commits from benvin/device-fib into main 2026-07-21 00:16:32 +10:00
Owner

Why

The agent reports each device's FIB (tomswall #3, merged). The control plane stores it for fleet visibility and future zone-origin validation. It deliberately does NOT limit which rules a device enforces — with default routes everywhere that could not narrow anything, and the interface-agnostic rule form is correct under ECMP precisely because it is path-independent (over-approximation is safe and intended).

Changes

  • Add reachable_prefixes + routes_reported_at to devices (migration 0004, verified against Postgres 17); expose reachable_prefixes on the device resource.
  • Add the agent-authed POST /api/v1/devices/{name}/routes endpoint and store.UpdateDeviceRoutes. This is scoping/observability data, so it does not bump the config generation.
  • The compiler is unchanged in behaviour: every enforcing device still carries every applicable rule. Added a test asserting a reported FIB does not limit the rule set.
## Why The agent reports each device's FIB (tomswall #3, merged). The control plane stores it for fleet visibility and future zone-origin validation. It deliberately does NOT limit which rules a device enforces — with default routes everywhere that could not narrow anything, and the interface-agnostic rule form is correct under ECMP precisely because it is path-independent (over-approximation is safe and intended). ## Changes - Add `reachable_prefixes` + `routes_reported_at` to devices (migration 0004, verified against Postgres 17); expose reachable_prefixes on the device resource. - Add the agent-authed `POST /api/v1/devices/{name}/routes` endpoint and store.UpdateDeviceRoutes. This is scoping/observability data, so it does not bump the config generation. - The compiler is unchanged in behaviour: every enforcing device still carries every applicable rule. Added a test asserting a reported FIB does not limit the rule set.
unkinben added 1 commit 2026-07-20 23:52:04 +10:00
Store device FIB for observability (no rule limiting)
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
9dbeb62414
Devices carry a reachable_prefixes set (migration 0004) reported by their agent
from the kernel FIB, via a new agent-authed POST /devices/{name}/routes endpoint.
This is scoping/observability data, so it does not bump the config generation and
is exposed on the device resource.

It deliberately does NOT limit which rules a device enforces: the compiler still
emits every applicable rule on every enforcing device. The interface-agnostic,
address-matched rule form is correct under ECMP precisely because it does not
depend on which device is on the path, and most routers hold a default route
anyway — so reachability could not meaningfully narrow the rule set. The reported
FIB is kept for fleet visibility and future zone-origin validation.
benvin merged commit a5957d0e98 into main 2026-07-21 00:16:32 +10:00
benvin deleted branch benvin/device-fib 2026-07-21 00:16:32 +10:00
Sign in to join this conversation.