egress: the forward chain allows each agent's declared ssh connections
This commit is contained in:
parent
934da6f31f
commit
8ece0b7e0b
1 changed files with 1110 additions and 20 deletions
|
|
@ -43,6 +43,7 @@ let
|
|||
proxyUrl = "http://${netCfg.bridgeIp}:${toString port}";
|
||||
exporterListen = "127.0.0.1:9301";
|
||||
interceptCfg = hyperhiveCfg.deploy.hive-controller.egress.intercept;
|
||||
egressCfg = hyperhiveCfg.deploy.hive-controller.egress;
|
||||
# The path every platform container's unit runs hive-priv by (hive-priv.nix
|
||||
# points it at the current build). Squid runs `egress-whois` through it.
|
||||
hivePriv = (import ./lib/container-rootfs-check.nix { inherit config; }).hivePriv;
|
||||
|
|
@ -555,6 +556,11 @@ in
|
|||
enable = lib.mkDefault true;
|
||||
inherit (cfg) unrestrictedFile agentAllowFile;
|
||||
};
|
||||
# The file `hive-c0re` renders with the SSH connections each agent may open,
|
||||
# which the egress forward chain reads (`workers::egress_connections`). It
|
||||
# sits in the directory hive-c0re may write.
|
||||
services.hyperhive.deploy.hive-controller.egress.connectionsFile =
|
||||
lib.mkDefault "${usersDir}/ssh-connections";
|
||||
services.hyperhive.network.enable = lib.mkDefault true;
|
||||
|
||||
services.hyperhive.otel.scrapeTargets.squid = exporterListen;
|
||||
|
|
@ -591,7 +597,10 @@ in
|
|||
"C ${cfg.allowedFile} 0640 hive-core squid - ${seedFile}"
|
||||
"f ${cfg.agentAllowFile} 0640 hive-core squid - -"
|
||||
"f ${cfg.denyFile} 0640 hive-core squid - -"
|
||||
];
|
||||
]
|
||||
++ lib.optional (
|
||||
egressCfg.connectionsFile != null
|
||||
) "f ${egressCfg.connectionsFile} 0640 hive-core squid - -";
|
||||
|
||||
# Squid reads the unrestricted list, the allow-list and the per-agent include
|
||||
# when it parses its configuration, not when they change. hive-c0re writes
|
||||
|
|
|
|||
Loading…
Reference in a new issue