gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
16.93k stars 1.7k forks source link

Deprecate API Client's usage of the Reverse Tunnel for connecting to the Auth Server #37608

Open strideynet opened 4 months ago

strideynet commented 4 months ago

The Current State

Today, when an API client is created, it tries connecting to the Auth Server in a number of ways. This accounts for the many different deployment architectures in use (e.g separate ports vs multiplexed, TLS terminating LB presence)

At the time of writing, the following connectivity pathways are posible:

And to visualize D+ image

More and more customers are using multiplexed mode instead of ports separate mode, and the published Teleport plugins (e.g Terraform/Access Plugins) do not configure the client with the name of the cluster. This means in most cases, D/D+ is being used (the most complex and least performant!)

Why change this?

Performance:

Complexity:

How?

Option B/B+ is the most promising pathway for customers who need to connect through a proxy, are using multiplexed ports, and who may have a TLS terminating LB in place. It has the least number of wrapped connections and avoids the use of SSH, making it much simpler. In addition, tricks can be used to make this even more performant (e.g configuring your load balancer to detect the teleport-auth@[hex-cluster-name].teleport.cluster.local ALPN and to direct traffic directly to your Auth Server, skipping the Proxy entirely)

The main issue with B/B+ is that the client must be configured with the name of the Teleport cluster to use the teleport-auth@[hex-cluster-name].teleport.cluster.local ALPN routing. This contrasts with using the special @remote-auth-server address when using teleport-reversetunnel, which just connects you to the Auth Server the proxy is connected to.

This issue can be resolved in two different ways:

With the support for pathway B/B+ improved, we'd then be free to begin deprecating pathways involving the SSH reverse tunnel.

espadolini commented 4 months ago

If we don't have credentials it's not a big deal to try /webapi/find just the one time, and if we have credentials we know the cluster name.

Even if the agent configuration isn't using proxy_server we can just try to use /webapi/find once per process to determine whether or not we should run the agent in tunnel mode or in direct dial mode without too many issues, I think (we repeatedly hit /webapi/find for worse reasons already).

This is an also a blocker for gravitational/cloud#5006 too.