Skip to content

Fix tsh kube credentials when root cluster roles don't allow Kube access#33014

Merged
tigrato merged 3 commits intomasterfrom
tigrato/fix-tsh-remote-clusters
Oct 10, 2023
Merged

Fix tsh kube credentials when root cluster roles don't allow Kube access#33014
tigrato merged 3 commits intomasterfrom
tigrato/fix-tsh-remote-clusters

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Oct 5, 2023

This PR fixes an edge case where an error message is printed to the users without proper knowledge of the role mappings between root and leaf clusters.

The user certificates include the kubernetes_users and kubernetes_groups allowed in the root cluster. Still, nothing prevents the access from being successful if the leaf cluster roles after mapping introduce the Kubernetes principals.

This PR prevents tsh from failing when generating certificates for leaf Kubernetes clusters.

…ccess

This PR fixes an edge case where an error message is printed to the
users without proper knowledge of the role mappings between root and
leaf clusters.

The user certificates include the `kubernetes_users` and
`kubernetes_groups` allowed in the root cluster but nothing prevents the
access to be sucessfull if the leaf cluster roles after the mapping
introduce the kubernetes principals.

This PR prevents tsh from failing when generating certificates for leaf
Kubernetes clusters.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@github-actions github-actions Bot added size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Oct 5, 2023
@github-actions github-actions Bot requested review from espadolini and tcsc October 5, 2023 13:19
Comment thread tool/tsh/common/kube.go
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
@tigrato tigrato force-pushed the tigrato/fix-tsh-remote-clusters branch 3 times, most recently from 0b30a4c to 7ab0c80 Compare October 9, 2023 17:05
@tigrato tigrato force-pushed the tigrato/fix-tsh-remote-clusters branch from 7ab0c80 to 756ba42 Compare October 9, 2023 17:09
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from tcsc October 10, 2023 12:27
@tigrato tigrato added this pull request to the merge queue Oct 10, 2023
Merged via the queue into master with commit 27c90c7 Oct 10, 2023
@tigrato tigrato deleted the tigrato/fix-tsh-remote-clusters branch October 10, 2023 13:49
@public-teleport-github-review-bot
Copy link
Copy Markdown

@tigrato See the table below for backport results.

Branch Result
branch/v12 Failed
branch/v13 Create PR
branch/v14 Create PR

tigrato added a commit that referenced this pull request Oct 10, 2023
…ccess (#33014)

* Fix `tsh kube credentials` when root cluster roles don't allow Kube access

This PR fixes an edge case where an error message is printed to the
users without proper knowledge of the role mappings between root and
leaf clusters.

The user certificates include the `kubernetes_users` and
`kubernetes_groups` allowed in the root cluster but nothing prevents the
access to be sucessfull if the leaf cluster roles after the mapping
introduce the kubernetes principals.

This PR prevents tsh from failing when generating certificates for leaf
Kubernetes clusters.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Update tool/tsh/common/kube.go

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* add check to tsh proxy

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request Oct 11, 2023
…ccess (#33014) (#33227)

* Fix `tsh kube credentials` when root cluster roles don't allow Kube access

This PR fixes an edge case where an error message is printed to the
users without proper knowledge of the role mappings between root and
leaf clusters.

The user certificates include the `kubernetes_users` and
`kubernetes_groups` allowed in the root cluster but nothing prevents the
access to be sucessfull if the leaf cluster roles after the mapping
introduce the kubernetes principals.

This PR prevents tsh from failing when generating certificates for leaf
Kubernetes clusters.



* Update tool/tsh/common/kube.go



* add check to tsh proxy

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants