load the agent-bridge to loopback drop in its own nft table
This commit is contained in:
parent
748ef2da08
commit
eb39a90057
1 changed files with 186 additions and 19 deletions
|
|
@ -122,7 +122,7 @@ in
|
|||
|
||||
**The host service must bind an address reachable from the bridge** —
|
||||
`0.0.0.0` or the bridge IP (`bridgeIp`) — not loopback-only. The
|
||||
bridge→`127.0.0.0/8` DROP rule (defence-in-depth) is unchanged: this
|
||||
bridge→`127.0.0.0/8` DROP rule (`hive-egress.nix`) still applies: this
|
||||
only opens the firewall, it does not bridge loopback. A service that
|
||||
binds `127.0.0.1` only is still unreachable; rebind it to `0.0.0.0`.
|
||||
|
||||
|
|
@ -276,12 +276,6 @@ in
|
|||
internalInterfaces = [ cfg.bridgeName ];
|
||||
};
|
||||
|
||||
# Defence-in-depth: DROP bridge→loopback so compromised agents can't
|
||||
# reach host-loopback services even via routing table leaks.
|
||||
networking.firewall.extraInputRules = ''
|
||||
ip saddr ${cfg.bridgeIp}/${toString cfg.bridgePrefixLength} ip daddr 127.0.0.0/8 drop
|
||||
'';
|
||||
|
||||
# Allow isolated agents to reach the gateway (nginx on the host, shared
|
||||
# netns). Port 80 covers `http://forge.<domain>`, per-agent UI proxies,
|
||||
# and any other HTTP services the gateway fronts. Port 443 for HTTPS.
|
||||
|
|
@ -304,7 +298,7 @@ in
|
|||
# Host port exposure: open each `exposeHostPorts` entry on the bridge
|
||||
# firewall so agents can reach a host service at `<bridgeIp>:P`. The host
|
||||
# service must bind `0.0.0.0` or the bridge IP (a loopback-only bind stays
|
||||
# unreachable — the bridge→127.0.0.0/8 DROP rule above is unchanged). This
|
||||
# unreachable — the bridge→127.0.0.0/8 DROP rule in hive-egress.nix still applies). This
|
||||
# is firewall-only by design: a host service that binds `0.0.0.0` already
|
||||
# serves the bridge IP, so an extra bridge-IP proxy would only collide
|
||||
# (EADDRINUSE) with it. Merges with the [ 80 443 ] gateway ports above.
|
||||
|
|
|
|||
Loading…
Reference in a new issue