feat: the WireGuard overlay, converged under the window of decision 0018 #49
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel!49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/wireguard-overlay"
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?
Step 2 of the order of handbook decision 0020: the WireGuard overlay in the spec, converged under the window of decision 0018.
The fields (docs/spec.md, "overlay")
How it is converged
kind(uplink or overlay) andabsent(the change created the file). The overlay sequence iswg-quick downon the old file, file in place (0600),wg-quick up, the same in both directions. A first overlay reverts by removing its file.managed_by: host, as 0018 decides. So the change is dated on the process start clock (a thread's start time). lxcfs's/proc/uptimecounts from the container's start and could not tell an old session from a new one.wg-quick@<if>is enabled on confirm, not on apply. A reboot inside the window of a first overlay therefore leaves nothing up.modprobe wireguardon the host); a change already pending; a key file that is not 0600 and owned by root.wg genkeyon the machine, never under--root(keel-core#8), and it never enters the rendered file:PostUp = wg set %i private-key FILE.--skip-network(first boot) still makes the key./etc/wireguardback and reports the public key (wg pubkeyreads the key file on stdin). diff compares peers by public key.keel network wireguard keyandkeel network wireguard suggest-address.Which sessions confirm an overlay change
A new session from another machine is accepted when it arrives at an address the overlay declares, or at an address held by another interface (the uplink). An overlay change can break two paths: the overlay itself, and the uplink, whose replies wg-quick's routes for
allowed_ipscan capture. A new session over either path shows that path survived. Accepting only the overlay would make pairing impossible, because the first node's overlay carries nothing until the second node declares it. confirm says which path was tested. A console or a host attach is accepted, as for the uplink. Older sessions, sessions from the machine to itself, and sessions arriving at an address the overlay does not declare are refused.Needs from the layer
wireguard-tools is not in the core layer: Keel-Linux/keel-core#15. The package
Suggests: wireguard-tools.Tests
wg genkeyandwg pubkeymake and read the key pair.wg-quick stripparses the rendered file.wg-quick upbrings it up in a network namespace of its own, wherewg showmust report the declared key, port, endpoints, allowed IPs and keepalive, andipthe addresses. CI installs wireguard-tools, and these tests fail there rather than skip.