From b050c6af6aedbe78201addb4abe2636ab075d14e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 01:59:29 +0000 Subject: host: harden against users turning on the host or each other - denyDestinations (default: loopback, private, link-local, CGNAT, multicast, ...): no user's rules can open those, neither tcp:// and udp:// rules nor the proxy, whatever a name resolves to: nginx's own outgoing connections may only go to port 443 outside them, and not to the host. tcp:// rules no longer open anything on the host itself. - fcbr0-firewall no longer runs as root, but with only CAP_NET_ADMIN, doesn't follow symlinks, and gets started per user when that user's rules change, so one user can't stop the others' updates. Rules files are read up to 64k only, by egress.lua, too. - Limits per guest (maxConnections open, maxNewConnections per second), and per user in nginx, so one user can't starve the others. - tcp:// and udp:// connections, and refused ones, get logged (rate-limited) with the user; fc-egress log shows them. - The run script keeps its lock files in a directory of the user's own, not in /tmp, where others could take them first. --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ea30fd2..a03cb12 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,17 @@ 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 argument: `proxyPort` (default 10443, where the proxy listens; -the guests' port 443 gets redirected there). +Optional arguments: + +- `proxyPort` (default 10443): where the proxy listens; the guests' port + 443 gets redirected there. +- `denyDestinations`: addresses no user's rules can open, neither for + tcp:// and udp:// rules nor through the proxy, whatever a name resolves + to. Default: loopback, private, link-local, CGNAT, multicast and the + like (IPv4 and IPv6). The host's own addresses are always out of reach + (but for DHCP, DNS and the proxy). +- `maxConnections` (default 256) and `maxNewConnections` (default 50 per + 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). @@ -99,8 +108,9 @@ refused. tcp:// and udp:// rules take IPv4 addresses (a guest resolves every name to the host, so it has to use addresses for these, too). Those -connections get forwarded, NATed to the host's address, or, if they're -for one of the host's addresses, let in. If the host has a forward +connections get forwarded, NATed to the host's address, and logged +(rate-limited, kernel log; `fc-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). -- cgit v1.3.1