Repository navigation
Sparewall 0.5.0
Sparewall 0.5.0 connects sites and sends traffic through other people's VPNs. It adds:
- WireGuard tunnels to other sites;
- WireGuard clients that send chosen networks out through a VPN provider or hub;
- log forwarding to any syslog collector;
- an optional local Prometheus that keeps each node's metric history.
Tunnels
-
Site-to-site tunnels (#148, #221). A
vpnpeer with anendpointis treated as another site.- Connections: the node connects to the other site as well as accepting connections from it.
- Routing: the peer's networks are routed through the tunnel.
keepalive: a new per-peer setting that keeps an idle tunnel up and holds it open through NAT.- Endpoints named by DNS: resolved again while the tunnel is quiet, so a site on a dynamic address is found again.
sparewall vpn peer-config NAME: prints the other site's side of the tunnel, for wg-quick.- In a pair: only the master sends to the other site, from the gateway address. After a failover, the new master restarts the tunnel itself. In the pair test, the tunnel was back within 8 seconds.
- Requirement: a pair with site peers needs exactly one static WAN, with a gateway address.
- See site-to-site tunnels.
vpn: branch: listen_port: 51821 endpoint: hq.example.org addresses: [10.98.0.1/30] zone: branch peers: office-b: public_key: "<the branch's public key>" endpoint: office-b.example.net:51821 addresses: [10.98.0.2/32, 192.168.20.0/24] keepalive: 25
-
VPN clients (#149, #223).
vpn_clients.<name>makes the node a WireGuard client of a service it doesn't run, such as a VPN provider, a cloud host or another organization's hub.- What goes through the tunnel: traffic from the networks listed in
route.networks, except traffic to the node's own networks. Everything else keeps using the WAN. - Addressing: traffic leaving through the tunnel takes the tunnel's address.
- Kill switch (on by default): while the tunnel is down, the routed networks can't reach the WAN.
- DNS: DHCP hands the routed networks the client's
dnsservers. - In a pair: both nodes use the same key, and only the master's tunnel is up. In the pair test, connections through it carried on across a failover.
- Health: the new
tunnelscheck is degraded when a site or a service hasn't completed a handshake in three minutes. - See VPN clients.
vpn_clients: egress: private_key: secret:provider-key addresses: [10.64.12.34/32] zone: egress peer: public_key: "<the service's public key>" endpoint: nl1.provider.example:51820 dns: [10.64.0.1] route: networks: [guests]
- What goes through the tunnel: traffic from the networks listed in
Logs and metrics
- Forwarding to a syslog collector (#147, #219). With
logging.remote.provider: syslog, the node runs rsyslog, which sends the journal as RFC 5424 syslog to rsyslog, syslog-ng, Graylog or a SIEM.- Protocols: UDP (the default), TCP, TCP over TLS (RFC 5425) or RELP.
- TLS:
logging.remote.catakes a private CA.logging.remote.certificatenames a secret holding a client certificate; RELP over TLS needs one. - While the collector is down: messages wait on disk, up to 256 MB, and are sent when it is back.
- Rule hits: the message carries the rule and the packet.
- Health: the new
log-forwardingcheck is degraded while the certificate's secret is missing. - See forwarding logs.
- A local Prometheus (#145, #220). With
metrics.mode: local, each node keeps its own metric history: what/metricsshows, every 15 seconds.- How long it keeps it:
metrics.retention(default15d) and the newmetrics.retention_size(default1GB). - How it runs: in its own container, as
nobody, listening on loopback only, with memory capped at 512 MB. - Querying:
org.sparewall.Metrics.QueryandQueryRangetake PromQL from any token or session with themonitorrole or above. Through/call/, a call answers 503 while Prometheus is down. - Not backed up: the history isn't part of the backup bundle.
- The image: ghcr.io/sparewall/prometheus is a fourth provider image, bound to the OS image. It adds about 190 MB to each deployment.
- Charts in the web UI are planned for 0.6.0 (#222).
- See history: a local Prometheus.
- How long it keeps it:
Pairs
- A configuration change with the sync link cut (#224, #225). Each node now remembers which schema revision its peer last said it reads, even when the peer is out of reach or the node restarts. That allows
--allow-divergechanges that use new settings while the sync link is down; before, only revision-1 changes were accepted. - Recovery times are now in the operations guide, as measured by the pair test.
Testing
- New VM tests:
- Syslog forwarding over UDP, TCP, TLS and RELP with a client certificate, including a collector outage.
- A local Prometheus, including queries through the API.
- Site-to-site tunnels: on a single node; and in a pair, across master loss and a rolling upgrade.
- A VPN client with its kill switch, on a two-NIC pair, across a failover.
- A sync-link cut with a revision 4 configuration.
- Upgrade tests start from 0.4.0, on a single node and on a pair.
Upgrading
Run sparewall upgrade on either node, or start it from the web UI. Nodes on 0.4.0 can upgrade straight to 0.5.0.
- Schema revision 4. These new settings and values are schema revision 4, and 0.4.x can't read a document that uses any of them:
logging.remote.caandlogging.remote.certificate;metrics.retentionandmetrics.retention_size;vpn.<name>.peers.<peer>.keepalive;vpn_clients;- the values
logging.remote.provider: syslogandmetrics.mode: local.
- Rolling back to 0.4.x: first roll the configuration back, with
sparewall rollback, to a generation that doesn't use any revision 4 setting. Then roll back the node. See schema revisions. - Pairs: until both nodes run 0.5.0, any change that uses a revision 4 setting is refused. Upgrade both nodes first.
- Download size: the Prometheus image is pulled with the upgrade even if
metrics.modeisn'tlocal.
What's Changed
- feat(logging): forward to a syslog collector with rsyslog by @silug in #219
- feat(metrics): a local Prometheus (metrics.mode: local) by @silug in #220
- feat(vpn): site-to-site tunnels with static WireGuard peers by @silug in #221
- feat(vpn): WireGuard clients for chosen networks' egress by @silug in #223
- fix(pair): keep what the peer reads across a sync cut by @silug in #225
Full Changelog: v0.4.0...v0.5.0
Installing and upgrading
The image is ghcr.io/sparewall/sparewall:0.5.0 (sha256:5f0e341ea284d5b4b84f86f6a6a0fd91a82aac5fbe1c10e9a12d12accf801973). Nodes on the stable channel are offered it once it is published.
Upgrade a node or a pair with sparewall upgrade (operations).
For a new install (getting started):
sparewall-0.5.0-x86_64.isoinstalls unattended to the first fixed
disk of the machine it boots, only if that disk is blank; it
stops at a disk with anything on it.sparewall-0.5.0-x86_64.raw.zstis a disk image to write to a disk,
and.qcow2the same for virtual machines.sparewall-0.5.0-x86_64-linux.tar.gzis thesparewallCLI, to
manage nodes over SSH from a workstation;-aarch64-linuxis
the same for arm64 Linux, and-aarch64-darwinand
-x86_64-darwinfor a Mac (Apple silicon, Intel).
Homebrew installs it on either:brew install sparewall/tap/sparewall.
Files named .partNN are pieces of one file (GitHub limits a file to
2 GiB): cat them together, in order.
Verifying the downloads
SHA256SUMS is signed with the project key (cosign.pub in the
repository) and lists every file, including each split file joined:
cosign verify-blob --key cosign.pub --bundle SHA256SUMS.sigstore.json SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMSThe macOS CLI is signed ad hoc, not notarized: after unpacking a
downloaded tarball, clear its quarantine attribute with
xattr -d com.apple.quarantine sparewall (Homebrew does this itself).
The SPDX SBOMs list what is in the image and in each CLI build.