squid self-check: use a public canary, drop the swarm service names from the allow list
This commit is contained in:
parent
698183c16a
commit
10fdf06334
1 changed files with 44 additions and 30 deletions
|
|
@ -526,6 +526,19 @@ let
|
|||
&& builtins.elem "cache deny all" lines
|
||||
&& lib.last (lib.filter (l: l != "") lines) == "http_access deny all";
|
||||
}
|
||||
{
|
||||
# Control: the allow ACL line is found and holds the canary, so the
|
||||
# absence of the swarm's service names is not a lookup of nothing.
|
||||
name = "squid's default allow-list is the self-check canary alone, with no swarm service name";
|
||||
ok =
|
||||
let
|
||||
lines = lib.splitString "\n" hiveOtel.services.squid.configText;
|
||||
acl = lib.findFirst (l: lib.hasPrefix "acl allowed_dst dstdomain " l) "" (map lib.trim lines);
|
||||
in
|
||||
acl == "acl allowed_dst dstdomain ${hiveOtel.services.hyperhive.squid.selfcheck.canary}"
|
||||
&& hiveOtel.services.hyperhive.squid.selfcheck.canary == "cache.nixos.org"
|
||||
&& !(builtins.elem hiveOtel.services.hyperhive.swarm.forge.domain (lib.splitString " " acl));
|
||||
}
|
||||
{
|
||||
# The ranges are what keeps an unrestricted user on the public internet.
|
||||
# Control: the bridge deny and the ACL line are found, so a range missing
|
||||
|
|
|
|||
Loading…
Reference in a new issue