Skip to content

docs: design-13 — WireGuard + NetGuard as first-class plugins - #1

Merged
lr00rl merged 6 commits into
mainfrom
docs/design-13-wireguard-netguard-plugins
Jul 10, 2026
Merged

docs: design-13 — WireGuard + NetGuard as first-class plugins#1
lr00rl merged 6 commits into
mainfrom
docs/design-13-wireguard-netguard-plugins

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Design document for splitting WireGuard and nftables out of the current core forms into two independent signed system pluginslatticenet.netguard and latticenet.wireguard — with cloud-security-group-grade graphical control, following the proven vpn-core migration pattern (design-09/10/11).

Key decisions

  • Engine = core, providers = plugin (ADR-001 D5 preserved): approvals/plan-hash/watchdog/rollback scaffolding/task executor stay CORE; plugins own domain models, compilers, RPC interfaces (/api/plugins/call), and dashboard IA via builtin component keys. Zero plugin JS in the browser.
  • NetGuard: Zones (trusted interfaces — fixes the tailscale0 lockout class found on dmit-eb-wee), reusable SecurityGroups with port ranges and cidr/node/group/zone/domain remotes, reality-first authoring (agent-reported listeners + nft -j ruleset → suggestions + drift badges), pre-plan lockout linting, blank-machine bootstrap (preflight → install plan), L1/L2/L3 nftables feature ladder ending in a linted raw-snippet escape hatch.
  • WireGuard: networks/memberships/external-device peers (one-time conf/QR issuance), mesh + hub-and-spoke + custom topologies, adoption bridge for existing on-box configs (wg show all dump + redacting conf parser), apply gains nft-parity dead-man rollback (today wireguard apply has none — server.go:4810-4821), full option surface with a templated PostUp allowlist.
  • Migration behind a byte-parity gate: converted NFTInputs must reproduce today's GenerateNFTPlan output byte-identically before the legacy path retires; NetPolicy/Group* map 1:1 into GuardRules.

Grounding

Code-audited against internal/network/nft.go, internal/netpolicy, internal/wireguard, server.go apply scripts/watchdog, agent taskexec sandbox, and the dashboard Guard/WireGuard views; gap list (no WG rollback, no drift visibility, silent selfcheck skip, hardcoded watchdog, no reality input) is enumerated in §3 and each gap maps to a design section.

Phasing

Track G1–G7 (netguard) and W1–W5 (wireguard), each an iter-NNN slice with exit bars; G1/W1 are read-only foundations with zero apply-path changes.

Test plan

  • Design review pass (architecture + security)
  • Decide open questions §10 (byte-parity failure policy, section IA, watchdog default)
  • G1/W1 iteration docs authored before code

https://claude.ai/code/session_01D6PbasV2UT8nytJXGpn47Q

lr00rl added 2 commits July 8, 2026 23:49
Two signed system plugins (latticenet.netguard, latticenet.wireguard)
following the vpn-core migration pattern: engine stays core (approvals,
plan-hash, watchdog/rollback scaffolding, task executor), plugins own
domain models, compilers, RPC interfaces, and dashboard IA via builtin
views.

NetGuard: zones (trusted interfaces — the tailscale0 lockout fix),
reusable security groups with port ranges and group/zone/node remotes,
reality-first authoring (listener + nft -j reporting, suggestions,
drift detection), pre-plan lockout linting, blank-machine bootstrap,
L1/L2/L3 nftables feature ladder.

WireGuard: networks/memberships/external-device peers with one-time
conf/QR issuance, mesh + hub-and-spoke + custom topologies, adoption
bridge for existing on-box configs, apply gains nft-parity dead-man
rollback (today it has none), full option surface with templated
PostUp allowlist.

Migration behind a byte-parity gate over converted NFTInputs fixtures;
phased G1-G7 / W1-W5 tracks.

Claude-Session: https://claude.ai/code/session_01D6PbasV2UT8nytJXGpn47Q
Exact seams for G/W slices: capability risk-table additions
(netguard:*/wireguard:* scopes), builtin-view double registration with
ownership pinning, namespaced RPC interface enforcement, gateway scope
union, system-runner contract, and marketplace shipping constraints.

Claude-Session: https://claude.ai/code/session_01D6PbasV2UT8nytJXGpn47Q
@lr00rl
lr00rl marked this pull request as ready for review July 9, 2026 06:26
lr00rl added 2 commits July 9, 2026 04:40
An accidental `git add -A` swept a Claude Code settings temp file into the
previous docs commit. It held only a local command allowlist (no secrets),
but .claude/ is session state and never belongs in the repo.

Claude-Session: https://claude.ai/code/session_01D6PbasV2UT8nytJXGpn47Q
Records lattice-plugin-netguard and lattice-plugin-wireguard (0.1.0-alpha.1,
unsigned) and the security finding that forced both manifests to ship
without interfaces: the plugin gateway checks scopes with an empty node id,
and RPCHandler carries no principal, so a node-restricted PAT could read the
whole fleet through POST /api/plugins/call.

Claude-Session: https://claude.ai/code/session_01D6PbasV2UT8nytJXGpn47Q
@lr00rl
lr00rl merged commit 508a442 into main Jul 10, 2026
1 check passed
@lr00rl
lr00rl deleted the docs/design-13-wireguard-netguard-plugins branch July 10, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant