Watch
0
0
Fork
You've already forked hyperhive
0

egress: document the allowed ssh connections

This commit is contained in:
atlas 2026-11-20 03:25:50 +01:00
commit eab2dcb0a2

View file

@ -737,11 +737,21 @@ also refuses the flow.
leaves alone too (see _Intercepted web traffic_). They leave no line, so a
`hive-egress-would-drop` line is exactly a flow that `reject` would refuse,
and a service container keeps every port and protocol under `reject`.
- **Named SSH connections.** Right after the `direct_mac` rule the chain
accepts TCP from an agent's MAC to an address and port in the `agent_allow`
set, in both modes, so such a flow leaves no count and no log line either.
The set holds, for each agent whose `ssh` switch is on, the addresses its
connections' hosts resolve to and their ports (see
[the SSH CA page](../swarm/ssh-ca.md#egress)). `hive-c0re` renders them into
`services.hyperhive.deploy.hive-controller.egress.connectionsFile`
(`/var/lib/hive-squid/ssh-connections`), and `hive-egress-pin` fills the set
from the file like `direct_mac`, when the file changes and on its timer. The
set is empty while the file is missing or empty.
- **What `reject` refuses.** Everything from the bridge to the uplink that the
chain didn't exempt, whether a flow is new or not: TCP on any port but the
80 and 443 that squid takes, UDP (DNS to an outside resolver, QUIC and NTP
included), ICMP and IPv6. A TCP flow gets a reset, so the connect fails at
once instead of stalling. Everything else gets ICMP administratively
chain didn't exempt or allow, whether a flow is new or not: TCP on any port
but the 80 and 443 that squid takes, UDP (DNS to an outside resolver, QUIC
and NTP included), ICMP and IPv6. A TCP flow gets a reset, so the connect
fails at once instead of stalling. Everything else gets ICMP administratively
prohibited. The log lines of this mode carry the prefix `hive-egress-reject `
(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
@ -761,6 +771,11 @@ also refuses the flow.
agent in the gap.
- An unreadable `unrestricted` file lists no agent, so `unrestricted` agents
lose every non-web flow.
- A new named connection, or a flipped `ssh` switch, reaches the set about a
minute after the write: the hive reads the swarm every 30 seconds and the
file's change runs a pass at once. A host that moves to an address the hive
hasn't looked up yet gets refusals for up to ten minutes. An agent whose
connection names a host that never resolved has no allowance for it.
- An agent in per-agent `log` mode keeps its web traffic, which squid only
observes, and loses every other port and protocol.
- **Which traffic.** IPv4 and IPv6 alike (the table is `inet`). The chain never