| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Like tcp:// and udp:// rules, HTTPS rules are now URIs:
https://DOMAIN (with subdomains, passed through) and
https://DOMAIN/PATH-PREFIX (decrypted to check the path), instead of
DOMAIN and DOMAIN/PATH-PREFIX. The old forms are refused by fc-egress
and ignored by egress.lua; to convert existing lists:
sed -i -E '/^[a-z]+:\/\//!s#^#https://#' /var/lib/fc-egress/*/*
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whitelists are now named, any number per user, in
/var/lib/fc-egress/USER/LIST, and each VM uses one of them:
run-firecracker-vm --egress LIST (default: default). The run script
writes the list's name to /run/fc-egress/TAP when it takes the tap, and
empties it when the VM exits; a list that doesn't exist allows nothing.
A user's VMs can only use that user's lists.
So the unit of policy is the tap (i.e. the running VM) rather than the
user: nftables sets allow_TAP, nginx decrypt sockets decrypt-TAP.sock,
egress_taps.lua maps guest addresses to tap and user. fcbr0-firewall
updates a tap when its file in /run/fc-egress changes, and all of a
user's taps when anything in the user's directory does. nginx's
connection limit stays per user.
fc-egress takes -l LIST (default: default), and has new commands lists
and vms (running VMs' taps and their lists). Log lines now say user,
tap and (nginx's) list: "ALLOW|DENY USER TAP LIST ...", kernel:
"fc-egress ALLOW|DENY USER TAP".
The old rules file, /var/lib/fc-egress/USER/allowed, is now just a list
named "allowed"; rename it to "default" to keep using it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
egress.lua goes along. The host now imports it as
(import .../modules/host { user = ...; }).
|