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
17.35k stars 1.74k forks source link

Reducing confusion and improving UX for the `token` join method / shared secret based joining #44054

Open strideynet opened 2 months ago

strideynet commented 2 months ago

It's been a long time since we first introduced the token join method, and since then, a plethora of join methods have been introduced that are much more secure.

There's a few interesting problems that have arisen now that we have more join methods:

What I'd suggest is that we introduce a new shared-secret join method, and phase out usage of the token join method. Given the extent to which customers are likely dependent on existing join tokens working, it's unlikely that we'll be able to fully remove the token join method soon.

The name of a shared-secret join token would not be a secret value - this brings it in line with the other join method types.

Instead, a secret value would be included within the main spec of the resource. For example:

kind: token
version: v2
metadata:
  expires: "2024-11-24T21:45:40.104524Z"
  name: my-join-token
spec:
  join_method: shared-secret
  shared_secret: ONUGIZTVNJVXGZTVONXHK2TENZ2WUZDTNZTHGZDKMZXGI43KNZTGU43OMZVGI3TK

When configuring joining for Teleport or TBot, users would specify both values e.g

tbot start --join-method shared-secret --join-token my-join-token --join-shared-secret ONUGIZTVNJVXGZTVONXHK2TENZ2WUZDTNZTHGZDKMZXGI43KNZTGU43OMZVGI3TK

The secret value could also be read from the configuration file, from the environment or from a path specified in the config or environment.

This new join method could also be a good opportunity to introduce other mechanisms to improve security, e.g:


Whilst we're certainly on a mission to eliminate shared secrets, we cannot deny that in on-prem environments, without TPMs, there is no alternative.

strideynet commented 1 month ago

Could tie https://github.com/gravitational/teleport/issues/43402 in this as well