egress: the forward chain refuses by default where the intercept is on
egress.forward defaults to reject while egress.intercept.enable is on (a hive controller host turns it on) and to log otherwise, because reject without the intercept would refuse all web traffic and an assertion already forbids it. log stays an explicit choice. The hive-squid VM test runs its log-mode half on the base node, so the base pins forward = log at mkDefault priority and the reject specialisation overrides it. A module-eval case covers the default on a controller host, on a host without the intercept, and an explicit log.
This commit is contained in:
parent
d88a0cc526
commit
b8851743e8
1 changed files with 86 additions and 35 deletions
|
|
@ -233,9 +233,10 @@ when it speaks HTTP on port 80 or TLS on port 443 and its agent is `restricted`
|
|||
or in `log` mode: the host redirects that traffic into squid's intercept ports
|
||||
(see _Intercepted web traffic_ below). Everything else goes straight out through
|
||||
the NAT, as before: the `unrestricted` agents, the service containers and every
|
||||
other port and protocol. By default nothing blocks that. The host logs the direct
|
||||
connections of the `restricted` and `log` agents, and `egress.forward =
|
||||
"reject"` refuses them (see _Agent bridge egress log_ below).
|
||||
other port and protocol. A hive controller host refuses the direct connections
|
||||
of the `restricted` and `log` agents (`egress.forward = "reject"`, the default
|
||||
while the intercept is on); `egress.forward = "log"` only logs them (see _Agent
|
||||
bridge egress log_ below).
|
||||
|
||||
Squid filters on the destination hostname: a `CONNECT` target or a plain-HTTP
|
||||
host. It never decrypts TLS. The one TLS key it loads is a throwaway that the
|
||||
|
|
@ -727,7 +728,8 @@ loopback — the hive-c0re admin socket is a UDS, not TCP.
|
|||
`services.hyperhive.deploy.hive-controller.egress.forward` sets what the `forward` chain of
|
||||
the `inet hive_egress` table does with traffic the host routes from the agent
|
||||
bridge to anywhere but the bridge. It takes
|
||||
`accept`, `log` (the default) or `reject`. In `log` mode the chain blocks
|
||||
`accept`, `log` or `reject`; the default is `reject` where the intercept is on
|
||||
(see _The default_ below) and `log` elsewhere. In `log` mode the chain blocks
|
||||
nothing. It logs each new flow and counts every packet. In `reject` mode it
|
||||
also refuses the flow.
|
||||
|
||||
|
|
@ -756,12 +758,15 @@ also refuses the flow.
|
|||
(and `hive-egress-reject-unmetered `); the rate limit and the counter work as
|
||||
in `log` mode. Still open to every agent are the host's own addresses: the
|
||||
proxy ports, DNS and DHCP from the bridge address, and the gateway.
|
||||
- **Switching on.** Leave `log` running for about a week, then read the
|
||||
`hive-egress-would-drop` lines. Each is a flow that `reject` would refuse; a
|
||||
flow that belongs to a legitimate use needs a fix first (a service container
|
||||
missing from `direct_mac`, an agent that should be `unrestricted`). Then set
|
||||
`services.hyperhive.deploy.hive-controller.egress.forward = "reject"`. Making it the default
|
||||
is a one-line change of the option's default.
|
||||
- **The default.** `reject` while `egress.intercept.enable` is on, which
|
||||
`hive-squid.nix` turns on for a hive controller host, and `log` on a host
|
||||
without the intercept, because `reject` there would refuse all web traffic
|
||||
too. The soak ran with `log` first: the `hive-egress-would-drop` lines are
|
||||
each a flow that `reject` would refuse, and a flow that belongs to a
|
||||
legitimate use needed a fix before the switch (a service container missing
|
||||
from `direct_mac`, an agent that should be `unrestricted`). To go back to
|
||||
logging, set
|
||||
`services.hyperhive.deploy.hive-controller.egress.forward = "log"`.
|
||||
- **What `reject` can break.**
|
||||
- A service container with no pin yet isn't in `direct_mac`, so the
|
||||
chain refuses it until `hive-egress-pin` binds its port. The bridge table
|
||||
|
|
|
|||
Loading…
Reference in a new issue