aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-25 23:06:46 +0000
committertv <tv@krebsco.de>2026-11-26 00:03:17 +0000
commitb5edf2b27f18f6576d3bcc00f65f95754aec1317 (patch)
tree3fc8423b412a97ce3ee54aeb3cca9ca9cf1277a0 /README.md
parent23df3da867ec9297f1050dcca14103fddca2153d (diff)
rigs: the host's names, rig-egress, rigbr0, rigtapN, ...
The host side loses the fc and firecracker, too: rig-egress (the command, also in the guests, and in log lines; /var/lib/rig-egress for the lists, /run/rig-egress for the VMs' choices of list), rig-proxy (the proxy, its user, /run/rig-proxy, and /var/lib/rig-proxy with the CA), rig-firewall, rig-dnsmasq, /run/rig-hosts, /run/rig-addr, the bridge rigbr0 and taps rigtapN, /etc/rig-taps and /etc/rig-vms, config.rig.vms, the nftables tables rigs and rigs-bridge, and egress.lua's RIG_EGRESS_*. The host's own configuration needs the new names, too: its firewall's trusted interface rigbr0, and config.rig.vms.
Diffstat (limited to 'README.md')
-rw-r--r--README.md54
1 files changed, 27 insertions, 27 deletions
diff --git a/README.md b/README.md
index 66e9ed1..0156f0c 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ imports = [
```
`users` says who may run VMs, and how many at the same time: each gets
-that many tap devices. This sets up a bridge `fcbr0` (172.16.0.1/24,
+that many tap devices. This sets up a bridge `rigbr0` (172.16.0.1/24,
and fdfc:fc::1/64) with the taps, DHCP and DNS for the guests, the egress proxy, and
nftables rules that keep the guests from reaching anything else, on the
host, beyond, or each other. Each running VM has a fixed address, and
@@ -47,11 +47,11 @@ Optional arguments:
them run at the same time as the user has taps. Taps have addresses of
their own, for VMs without one: from 172.16.0.200 on, so they stand
out (but for VMs' there; at most 55 taps in all). The VMs'
- addresses are also in `config.fc.vms.NAME` (`user`, `ip`, `ip6`):
+ addresses are also in `config.rig.vms.NAME` (`user`, `ip`, `ip6`):
```nix
services.nginx.virtualHosts."hermes.example".locations."/".proxyPass =
- "http://${config.fc.vms.hermes.ip}:9120";
+ "http://${config.rig.vms.hermes.ip}:9120";
```
- `proxyPort` (default 10443): where the proxy listens; the guests' port
443 gets redirected there.
@@ -70,7 +70,7 @@ Optional arguments:
second): limits per guest, so one user can't starve the others.
If the host has a firewall of its own, it has to let the guests in on
-`fcbr0`: udp 67 (DHCP), udp and tcp 53 (DNS), tcp 10443 (the proxy), and
+`rigbr0`: udp 67 (DHCP), udp and tcp 53 (DNS), tcp 10443 (the proxy), and
tcp 10080 (the checks).
## Running a VM
@@ -201,7 +201,7 @@ Who may log in goes in a layer, e.g.:
```
A guest's address is its VM's, by name (`vms`, see host setup), or else
-its tap's own (see `fc-egress vms`).
+its tap's own (see `rig-egress vms`).
Secrets, like API keys (and that host key), come from the host at boot,
never through the store or `/xchg` (which other VMs given the same
@@ -262,21 +262,21 @@ nix-build pkgs/run-rig \
The guests resolve every name to the host, and all their HTTPS goes to
the proxy, which decides by the server name and the VM's whitelist.
Each user has any number of named whitelists, in
-`/var/lib/fc-egress/USER/LIST`, and manages them with `fc-egress`
+`/var/lib/rig-egress/USER/LIST`, and manages them with `rig-egress`
(`-l LIST`; without it, the list `default`):
```sh
-fc-egress list
-fc-egress allow https://cache.nixos.org # the domain and its subdomains
-fc-egress allow https://github.com/NixOS/ # only paths starting with /NixOS/
-fc-egress allow https://api.github.com/search/issues # that path and below, any query
-fc-egress allow tcp://192.0.2.7:22 # plain TCP to that address and port
-fc-egress allow tcp://git.example.org:22 # or name (resolved by the host)
-fc-egress allow udp://192.0.2.0/24:5000-5100
-fc-egress deny https://github.com/NixOS/
-fc-egress -l work allow https://example.com # the list "work"
-fc-egress lists
-fc-egress log -f
+rig-egress list
+rig-egress allow https://cache.nixos.org # the domain and its subdomains
+rig-egress allow https://github.com/NixOS/ # only paths starting with /NixOS/
+rig-egress allow https://api.github.com/search/issues # that path and below, any query
+rig-egress allow tcp://192.0.2.7:22 # plain TCP to that address and port
+rig-egress allow tcp://git.example.org:22 # or name (resolved by the host)
+rig-egress allow udp://192.0.2.0/24:5000-5100
+rig-egress deny https://github.com/NixOS/
+rig-egress -l work allow https://example.com # the list "work"
+rig-egress lists
+rig-egress log -f
```
Each VM can have a name (also its host name; unique among your running
@@ -284,19 +284,19 @@ VMs), and uses one list: the one given with `--egress`, else the one
named like the VM, else (no name) `default`:
```sh
-fc-egress -l box allow https://cache.nixos.org
+rig-egress -l box allow https://cache.nixos.org
./result/bin/run-rig --name box # list box
./result/bin/run-rig --name box2 --egress box # list box, too
-fc-egress vms # running VMs: tap (as in the log), address, name, list
-fc-egress -v box allow https://example.org # the list box uses
-fc-egress use box default # switch box to another list
+rig-egress vms # running VMs: tap (as in the log), address, name, list
+rig-egress -v box allow https://example.org # the list box uses
+rig-egress use box default # switch box to another list
```
A list that doesn't exist allows nothing. Changes to lists and switches
apply to the next connection. Whole domains get passed through
encrypted. Domains with path rules get decrypted to check each request,
with certificates from a CA the host creates on first start
-(`/var/lib/fcbr0-egress/ca.pem`). The guest trusts that CA if it exists
+(`/var/lib/rig-proxy/ca.pem`). The guest trusts that CA if it exists
when the guest gets built, so build the guest on the host after the proxy
has started once. Everything else, and anything that isn't HTTPS, gets
refused.
@@ -309,18 +309,18 @@ those (IPv4 and IPv6) and tells the guests the same addresses, so
`ssh git.example.org` works. They get resolved again every 5 minutes.
(Every guest gets those addresses for those names, but only the VMs
whose list has the rule can connect.) Those connections get forwarded, NATed to the host's address, and logged
-(rate-limited, kernel log; `fc-egress log` shows them), as are refused
+(rate-limited, kernel log; `rig-egress log` shows them), as are refused
ones. If the host has a forward
chain of its own, it has to let them through, too (anything from
-`fcbr0`; this module rejects what isn't allowed).
+`rigbr0`; this module rejects what isn't allowed).
For `nix-shell` and the like to download, allow `cache.nixos.org`.
Guests can check what their egress allows, before relying on it, with
-`fc-egress check` (the guest's own, read-only one), which asks the host:
+`rig-egress check` (the guest's own, read-only one), which asks the host:
```sh
-fc-egress check https://github.com/krebs/kartei tcp://172.16.0.1:22
+rig-egress check https://github.com/krebs/kartei tcp://172.16.0.1:22
```
prints `true` or `false` and the URI, a line each (exit status 0 if all
@@ -341,7 +341,7 @@ the list its own VM uses.
- `layers/console.nix`: a shell on the serial console, to import into a layer.
- `layers/switch.nix`: switching a running guest, to import into a layer.
- `modules/host/default.nix`: the host's side: network, DHCP/DNS, egress
- proxy, `fc-egress`.
+ proxy, `rig-egress`.
- `modules/host/egress.lua`: the egress policy, for the proxy (OpenResty).
## Caveats