swarm-nats: the pod's raw rule lets through the interfaces the firewall opens the client port on
The hostPort's raw-table drop for the queue's client port let through only the host's loopback, the bridge and the pods' interfaces, so a hive on another host, reaching the queue over wg0 where the firewall's own rule opens the port, timed out. The rule now also returns for every interface whose networking.firewall.interfaces entry opens the port. semi-spread dumps the queue's network state when the hive cannot reach it, and asserts the port answers over wg0 and not on the public address.
This commit is contained in:
parent
bd7c261078
commit
4bb6c573ae
1 changed files with 98 additions and 8 deletions
|
|
@ -1741,12 +1741,49 @@ let
|
|||
"br0"
|
||||
"cni0"
|
||||
];
|
||||
firewallInterfaces = { };
|
||||
};
|
||||
closed = rules (args // { openClient = false; });
|
||||
open = rules (args // { openClient = true; });
|
||||
# An interface the firewall opens the port on, by the port or by a
|
||||
# range, is let through; one that opens other ports is not.
|
||||
viaInterfaces = rules (
|
||||
args
|
||||
// {
|
||||
openClient = false;
|
||||
firewallInterfaces = {
|
||||
wg0 = {
|
||||
allowedTCPPorts = [ 4222 ];
|
||||
allowedTCPPortRanges = [ ];
|
||||
};
|
||||
wg1 = {
|
||||
allowedTCPPorts = [ ];
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 4000;
|
||||
to = 4300;
|
||||
}
|
||||
];
|
||||
};
|
||||
eth1 = {
|
||||
allowedTCPPorts = [ 80 ];
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 5000;
|
||||
to = 5100;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
has = hasInfix;
|
||||
in
|
||||
has "-p tcp --dport 4222 -i br0 -j RETURN" closed
|
||||
has "-p tcp --dport 4222 -i wg0 -j RETURN" viaInterfaces
|
||||
&& has "-p tcp --dport 4222 -i wg1 -j RETURN" viaInterfaces
|
||||
&& !(has "-i eth1" viaInterfaces)
|
||||
&& !(has "-i wg0" closed)
|
||||
&& has "-p tcp --dport 4222 -i br0 -j RETURN" closed
|
||||
&& has "-p tcp --dport 4222 -i cni0 -j RETURN" closed
|
||||
&& has "-p tcp --dport 4222 -m addrtype --dst-type LOCAL -j DROP" closed
|
||||
# Open, the client port has no rule. The exporter's port, behind a
|
||||
|
|
|
|||
Loading…
Reference in a new issue