You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to prevent the proxy from forwarding inbound traffic to target
IP addresses not in the list of inbound ips allowed by a pod, the proxy
will be changed to also forward on the original destination rather than
the original port on localhost. To support forwarding on the original
destination address, an iptables rule that currently results in a
traffic loop has to be dropped. The rule allows an app to call itself:
when a packet is sent over lo as a network interface and the destination
is not localhost, the packet is routed back through the inbound chain
(essentially resulting in the following flow: appX -- outbound --
inbound -- appX). The packets sent by the proxy are routed by the kernel
through the loopback interface, however, when forwarding on the original
destination, the destination address is no longer localhost (resulting
in a traffic).
Dropping the rule will break the edge case of an app calling itself
since the packet will go through the outbound and from outbound straight
to the process (packets on loopback skip nat prerouting tables so from
outbound /it has/ to be redirected through rules to the inbound; inbound
will not pick up the packet) -- the packet will be encrypted by the
outbound side and also upgraded to H2 since the outbound does not know
the receving end will not be another proxy.
This change deals with this edge case: if our target destination is also
part of the inbound ips then we will not do any TLS or upgrade the
connection to H2. Packet generated by the outbound side of the proxy
will now be sent straight to the application process who will be able to
deal with it as if it came from the inbound side. To support this
change, the list of inbound ips has been wired through the outbound
configuration. On each endpoint, we cross check the target against our
list of inbound ips -- if the target is an inbound ip, then we don't do
any TLS (reason: loopback) and set the protocol hint as Unknown. This is
done on both logical and direct connections; skipping TLS should be
protocol agnostic.
The gateway also had to be changed since it now supports logical and
direct connections. Where the configuration is not wired through, we
provide defaults (an empty set should still set TLS).
N.B. we set this directly on an endpoint for direct communications
however iptables currently has a rule which will forward a packet
directly to the application process when the address used is the
endpoint address (effectively skipping outbound). App X (ep addres) -->
App X, App X (logical address) --> outbound --> App X.
Signed-off-by: Matei David <[email protected]>
0 commit comments