Watch
0
0
Fork
You've already forked hyperhive
0

egress: let every agent reach the swarm's own endpoints under forward reject

With the egress intercept on, the forward chain rejects what `agent_allow`
does not hold, and `agent_allow` only held an agent's ssh connections. An
agent whose secret store, queue, logs or metrics endpoint is not on the
bridge was refused, so no agent started on a hive away from the swarm host.

hive-c0re's egress worker now also renders a `* <ipv4> <port>` line for each
endpoint URL it hands to agents (HIVE_AGENT_BAO_ADDR, HIVE_AGENT_LOGS_QUERY_URL,
HIVE_AGENT_METRICS_URL, HIVE_AGENT_NATS_URL), resolved like the ssh hosts.
`hive-priv egress-pin` expands a `*` line to the MAC of every agent port. An
older hive-priv skips the line, as it skips any unknown name.

Closes #6902
This commit is contained in:
maia 2026-11-27 07:52:24 +01:00 • committed by mara
commit ecfc21b962

View file

@ -616,6 +616,22 @@ let
name = "a hive with no store identity forwards no store address to its agents";
ok = !(bare.systemd.services.hive-c0re.environment ? HIVE_AGENT_BAO_ADDR);
}
{
# hive-c0re's egress worker reads these three names and lets every agent
# open a connection to each address (`egress_connections.rs`,
# `ENDPOINT_ENVS`). The names are spelled in both places, so this is the
# nix half of that agreement, with the file's own variable as the
# presence control that the worker runs on this host at all.
name = "the environment of a hive that runs the egress worker names the store, logs and metrics endpoints its agents use";
ok =
let
e = allLocal.systemd.services.hive-c0re.environment;
in
e ? HIVE_EGRESS_CONNECTIONS_FILE
&& lib.hasPrefix "https://" e.HIVE_AGENT_BAO_ADDR
&& lib.hasSuffix "/select/logsql/query" e.HIVE_AGENT_LOGS_QUERY_URL
&& lib.hasPrefix "https://" e.HIVE_AGENT_METRICS_URL;
}
{
# The gateway's per-name issuer choice. If this ever collapses to a
# constant, every swarm-service vhost serves a certificate its CA