Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Wrap transport when kube proxy runs in-cluster. #2715

Merged
merged 2 commits into from
May 15, 2019

Conversation

r0mant
Copy link
Collaborator

@r0mant r0mant commented May 14, 2019

This PR fixes the issue with Teleport's Kubernetes proxy sending empty credentials to the API server when running in-cluster.

When Teleport runs inside Kubernetes cluster, it uses "in-cluster configuration" which provides a wrapper for transport that adds service account token to requests. This wrapper was not used and thus Teleport was not providing any credentials when making impersonation requests to the API server, which could be seen in the audit log - the "user" field was empty.

I've tested both local and remote cluster paths using Gravity (i.e. via Ops Center + cluster).

@r0mant r0mant requested a review from klizhentas May 14, 2019 21:48
// as the proxy uses client cert auth to reach out to remote proxy
// which will then use its own transport wrapper
if !ctx.cluster.isRemote {
if f.creds.cfg.WrapTransport != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those two ifs could be just one if? if !ctx.cluster.isRemote && f.creds.cfg.WrapTransport != nil

@r0mant r0mant force-pushed the roman/3.2/kubeproxy branch from dc80f80 to 0a1d87c Compare May 14, 2019 22:04
@r0mant
Copy link
Collaborator Author

r0mant commented May 15, 2019

retest this please

@r0mant r0mant merged commit 2487396 into branch/3.2 May 15, 2019
@r0mant r0mant deleted the roman/3.2/kubeproxy branch May 15, 2019 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants