nats and bao can listen on a routable address, opt-in
This commit is contained in:
parent
4b71bd97eb
commit
892675628d
1 changed files with 174 additions and 6 deletions
|
|
@ -21,6 +21,7 @@ let
|
|||
hive
|
||||
runGroup
|
||||
baoSettings
|
||||
bridgePorts
|
||||
forceServiceConfigs
|
||||
selfScrapes
|
||||
;
|
||||
|
|
@ -28,6 +29,7 @@ let
|
|||
baoTwoAddresses = hive {
|
||||
deploy.bao.enable = true;
|
||||
deploy.bao.extraListenAddresses = [ "10.0.0.1" ];
|
||||
deploy.bao.openFirewall = true;
|
||||
# Pinned, not incidental: the case counting these listeners is about the
|
||||
# declared API addresses. ⚠️ Leaving the swarm tier off does not keep the
|
||||
# METRICS listener out of the count — that one is a function of the
|
||||
|
|
@ -106,6 +108,31 @@ let
|
|||
in
|
||||
l.loopback.address == "127.0.0.1:8200" && l.extra-1.address == "10.0.0.1:8200";
|
||||
}
|
||||
{
|
||||
# On: the port is open host-wide and the extra listener demands a client
|
||||
# certificate, like loopback. Evaluates with no assertion naming the
|
||||
# option, so the two refusals in bao-grants are not firing here.
|
||||
name = "openFirewall opens the store port host-wide, and the extra listener requires a client certificate";
|
||||
ok =
|
||||
let
|
||||
l = (baoSettings baoTwoAddresses).listener;
|
||||
in
|
||||
lib.elem 8200 baoTwoAddresses.networking.firewall.allowedTCPPorts
|
||||
&& l.extra-1.tls_require_and_verify_client_cert == true
|
||||
&& l.extra-1.tls_client_ca_file == l.loopback.tls_client_ca_file
|
||||
&& !(lib.any (
|
||||
a: !a.assertion && lib.hasInfix "deploy.bao.openFirewall" a.message
|
||||
) baoTwoAddresses.assertions);
|
||||
}
|
||||
{
|
||||
# Off is today's config: the port is open on the bridge for agents and on
|
||||
# no other interface. The bridge arm is the control that the lookup finds
|
||||
# a port that is there.
|
||||
name = "without openFirewall the store port is open on the bridge only";
|
||||
ok =
|
||||
!(lib.elem 8200 baoOtelElsewhere.networking.firewall.allowedTCPPorts)
|
||||
&& lib.elem 8200 (bridgePorts baoOtelElsewhere);
|
||||
}
|
||||
{
|
||||
# Control for the case above: these settings are rendered per deployment,
|
||||
# not constants a passing case could be indifferent to. The metrics and
|
||||
|
|
|
|||
Loading…
Reference in a new issue