aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 13:08:29 +0000
committertv <tv@krebsco.de>2026-11-21 13:08:29 +0000
commit4e480218c0777ba9342ce2edd3b00ff3488229b2 (patch)
treef516784f946504113579af05da441ae8b46faa4b /README.md
parent0c8d9e30cb8fb9b42d1093540a2b73901c770fc5 (diff)
host: guests can check what their egress allows, fc-egress check
So a guest can know beforehand whether it gets somewhere, instead of finding out by timeouts and retries, and can tell which rule it lacks. nginx answers POST http://172.16.0.1/check (the guests' port 80 of 172.16.0.1 gets redirected to 172.16.0.1:checkPort, default 10080; plain HTTP anywhere else stays refused): URIs one per line, at most 100, and true or false for each, a line each, by the same rules as the egress: whole domains and path rules for https://HOST[/PATH] (port 443 only), and for tcp:// and udp://HOST:PORT the list's rules, with names as resolved for the guest's tap (its hosts file), but not to denyDestinations or the host's own addresses on fcbr0, and not to tcp port 443, which goes to the proxy. Read-only, about the asking guest's own list only (by its address, as for its egress), and rate-limited. In the guest, fc-egress check URI... asks that, over bash's /dev/tcp, as the guest may have no HTTP client, and prints true or false and the URI, a line each; exit status 0 if all are allowed, 1 if not, 2 on errors.
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/README.md b/README.md
index 874cc45..30dc439 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,8 @@ Optional arguments:
```
- `proxyPort` (default 10443): where the proxy listens; the guests' port
443 gets redirected there.
+- `checkPort` (default 10080): where the guests' checks of their egress
+ get answered; their port 80 of 172.16.0.1 gets redirected there.
- `prefix6` (default `fdfc:fc::`): the guests' IPv6 /64. Each guest
gets the address from its MAC (SLAAC, from router advertisements by
the host's dnsmasq), for tcp:// and udp:// rules; HTTPS stays IPv4,
@@ -67,7 +69,8 @@ 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), and tcp 10443 (the proxy).
+`fcbr0`: udp 67 (DHCP), udp and tcp 53 (DNS), tcp 10443 (the proxy), and
+tcp 10080 (the checks).
## Running a VM
@@ -233,6 +236,21 @@ chain of its own, it has to let them through, too (anything from
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:
+
+```sh
+fc-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
+are allowed, 1 if not), by the same rules as the egress itself: whole
+domains and path rules for `https://`, and for `tcp://` and `udp://`
+the rules, their names as resolved for the VM, and `denyDestinations`.
+It asks `POST http://172.16.0.1/check`, URIs one per line (at most 100),
+`true` or `false` for each, a line each; any guest can only ask about
+the list its own VM uses.
+
## Layout
- `pkgs/run-firecracker-vm/default.nix`: the guest's NixOS configuration,