Conversation
strideynet
left a comment
There was a problem hiding this comment.
Overall looks good - nice work. Just a few nits.
I couldn't leave this as a comment, but a lib/kubernetestoken/kubernetestoken.go which just has a comment linking to the RFD and also linking to the appropriate docs on the Kubernetes site would be 👌
I'm thinking we maybe ought to group all of the join method packages at some-point now that we have 3 ! Perhaps that's better suited for a separate PR though...
There was a problem hiding this comment.
While the prefix system: should be reserved for internal Kubernetes system use, I believe nothing prevents a normal user or group to start with the system: prefix and bypass this? https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-subjects
A better check would probably involve looking at the assigned groups (i.e. at least reviewResult.Status.User.Groups including system:serviceaccounts).
There was a problem hiding this comment.
I was not able to find any information about checks and security enforcement around username prefix and reserved groups. I will add the group check as well.
28cd8d5 to
da20949
Compare
There was a problem hiding this comment.
this line could probably use an update
Do you think we should add an item to the test plan for a manual check of this in a real kube cluster?
It all looks pretty good to me, I left mostly minor comments you can take or leave or do in a separate PR.
|
Following a discussion with nic I will move tbot out of this PR scope as it is untested and was broken. I definitely will bring this feature back once we have a working tbot in kubernetes (like the operator), this will allow to move the teleport operator out if its sidecar and have it join the cluster nicely. |
f9e2791 to
14ba207
Compare
Co-authored-by: Noah Stride <noah.stride@goteleport.com>
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
f89e6d0 to
21968ff
Compare
6cc5ffd to
5da9d0d
Compare
This commit adds a new joinMethod as described in #17905 This method allow pods running in the same Kubernetes cluster than the auth servers to join the Teleport cluster. It relies on Kubernetes tokens to establish trust. The goal is to be able to deploy proxies and auths separately and join them in a single cluser. Pre Kubernetes 1.20, the tokens are static, long-lived, not bound to pods. We support them for compatibility reasons. Starting with Kubernetes 1.20, tokens are bound to pods (and starting with 1.21 they can be mounted through projected volumes). Starting with 1.21 we should only accept bound tokens. The chart will ensure tokens are properly mounted with projected volumes so we can benefit from the 1h to 10min token lifetime.
This commit adds a new joinMethod as described in #17905 This method allow pods running in the same Kubernetes cluster than the auth servers to join the Teleport cluster. It relies on Kubernetes tokens to establish trust. The goal is to be able to deploy proxies and auths separately and join them in a single cluser. Pre Kubernetes 1.20, the tokens are static, long-lived, not bound to pods. We support them for compatibility reasons. Starting with Kubernetes 1.20, tokens are bound to pods (and starting with 1.21 they can be mounted through projected volumes). Starting with 1.21 we should only accept bound tokens. The chart will ensure tokens are properly mounted with projected volumes so we can benefit from the 1h to 10min token lifetime.
This commit adds a new joinMethod as described in #17905 This method allow pods running in the same Kubernetes cluster than the auth servers to join the Teleport cluster. It relies on Kubernetes tokens to establish trust. The goal is to be able to deploy proxies and auths separately and join them in a single cluser. Pre Kubernetes 1.20, the tokens are static, long-lived, not bound to pods. We support them for compatibility reasons. Starting with Kubernetes 1.20, tokens are bound to pods (and starting with 1.21 they can be mounted through projected volumes). Starting with 1.21 we should only accept bound tokens. The chart will ensure tokens are properly mounted with projected volumes so we can benefit from the 1h to 10min token lifetime.
Backport #18659 ### About the backport This backport is here to provide a rollback path from v12 to v11. Helm users upgrading to v12 end up with Kubernetes tokens automatically created. Currently, if they rollback to v11, the token is unknown and Teleport crashes during cache warming. Once this will be backported, users will have a v11 version they can rollback to if the v12 upgrade fails. ### Original commit message This commit adds a new joinMethod as described in #17905 This method allow pods running in the same Kubernetes cluster than the auth servers to join the Teleport cluster. It relies on Kubernetes tokens to establish trust. The goal is to be able to deploy proxies and auths separately and join them in a single cluser. Pre Kubernetes 1.20, the tokens are static, long-lived, not bound to pods. We support them for compatibility reasons. Starting with Kubernetes 1.20, tokens are bound to pods (and starting with 1.21 they can be mounted through projected volumes). Starting with 1.21 we should only accept bound tokens. The chart will ensure tokens are properly mounted with projected volumes so we can benefit from the 1h to 10min token lifetime.
This PR adds a new joinMethod as described in #17905
This method allow pods running in the same Kubernetes cluster than the auth servers to join the Teleport cluster. It relies on Kubernetes tokens to establish trust. The goal is to be able to deploy proxies and auths separately and join them in a single cluser.
Pre Kubernetes 1.20, the tokens are static, long-lived, not bound to pods. We support them for compatibility reasons. Starting with Kubernetes 1.20, tokens are bound to pods (and starting with 1.21 they can be mounted through projected volumes). Starting with 1.21 we should only accept bound tokens. The chart will ensure tokens are properly mounted with projected volumes so we can benefit from the 1h to 10min token lifetime.