diff options
| author | tv <tv@krebsco.de> | 2026-11-17 01:01:06 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-17 01:01:06 +0000 |
| commit | ff3dafcc0003ffc2d48244fcd6e98984b6a9174d (patch) | |
| tree | 155a9ca9fed6d2ab3000665f724d98e8a0890937 /README.md | |
| parent | 9d7f66b9cbdc203226ef919a4108706248d9779d (diff) | |
per-user egress rules
The host module takes users = { NAME = TAPS; ... } instead of a single
user: each user gets that many taps, and rules of their own, in
/var/lib/fc-egress/USER/allowed, managed with fc-egress as before.
The proxy tells whose a guest is by its address: each tap has a fixed
one, handed out by dnsmasq by MAC address (derived from the tap's number,
as the run script does), and the bridge drops anything a guest sends from
another address. The decrypting server gets a socket per user, as it
can't see the guest's address. The run script only takes the user's own
taps.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -20,17 +20,19 @@ In the host's NixOS configuration: ```nix imports = [ - (import /path/to/firecracker/modules/host { user = "tv"; }) + (import /path/to/firecracker/modules/host { users = { tv = 8; alice = 2; }; }) ]; ``` -This sets up a bridge `fcbr0` (172.16.0.1/24) with tap devices for the -given user, DHCP and DNS for the guests, the egress proxy, and nftables -rules that keep the guests from reaching anything else, on the host or -beyond. It needs `networking.nftables` (and enables it). +`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) +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 tap has a fixed address, and the bridge +drops anything a guest sends from another, so the proxy knows whose a +connection is. It needs `networking.nftables` (and enables it). -Optional arguments: `taps` (default 8, the number of VMs that can run at -the same time) and `proxyPort` (default 10443, where the proxy listens; +Optional argument: `proxyPort` (default 10443, where the proxy listens; the guests' port 443 gets redirected there). If the host has a firewall of its own, it has to let the guests in on @@ -73,8 +75,9 @@ nix-build pkgs/run-firecracker-vm \ ## Egress The guests resolve every name to the host, and all their HTTPS goes to -the proxy, which decides by the server name and the rules in -`/var/lib/fc-egress/allowed`. The user manages these with `fc-egress`: +the proxy, which decides by the server name and the rules of the guest's +user, in `/var/lib/fc-egress/USER/allowed`. Each user manages their own +with `fc-egress`: ```sh fc-egress list |
