Skip to main content
Account
Lesson 3 of 6

Identity-Based User Access & RBAC

Replace manually configured users with GitHub SSO authentication, map GitHub teams to Teleport roles, and access your Kubernetes clusters with short-lived certificates tied to real identities.

In collaboration with Teleport

Identity-Based User Access & RBAC

Moving Beyond Manual Users

In the last video, we deployed Teleport and created a manual admin user. That’s fine for development, but not for production. Today we’re setting up GitHub as our identity provider so every user authenticates through SSO and gets a short-lived certificate tied to their real identity.

GitHub SSO with Teleport

For the Teleport Community Edition, the supported provider is GitHub — perfect for developers. Enterprise users can also use OIDC and SAML connectors for Okta, Azure AD, Google Workspace, and other identity providers.

The flow is simple:

  1. User runs tsh login to authenticate with Teleport
  2. It opens a browser for GitHub authentication
  3. Teleport issues a short-lived certificate
  4. User can tsh kube ls to list available clusters and start working

GitOps Configuration

We configure everything the GitOps way using Teleport’s operator and custom resource definitions:

  • Enable the Teleport operator in the Helm release
  • Create a GitHub connector CRD with client ID, secret, and team-to-role mappings
  • Define Teleport roles (access and editor) as custom resources

GitHub teams map directly to Teleport roles — anyone in the Rawkode Academy organization gets read access, platform team members get editor access.

CLI Access

Once configured, tsh login --proxy=rawkode.cloud --auth github authenticates via browser, and you’re in. tsh kube ls shows available clusters, and kubectl works seamlessly through Teleport’s proxy — no kubeconfig files needed.

Transcript

Generated from English captions. Select a timestamp to jump to that moment.

0:00 Welcome back. In the last video, we deployed teleport into two Kubernetes clusters, or at least a local Cluster, and we took a look at my production Cluster. Today's video, we're going to improve my production setup. We have a running proxy on off server and a Kubernetes agent all running in our Cluster. And I can log in with the user that we created manually after the deploy. That's the part we want to take a look at today. I mean, if you've worked with Kubernetes before, you know the default access model is a kubeconfig sitting on your disc.

0:36 This contains a long lived credential. We spoke about this in the first video that cannot be revoked. Teleport solves this by a requiring every user to authenticate through their identity proxy, getting a short-lived certificate. It lives for hours, not months or years, and it encodes the user's real identity, their email address, their roles, Kubernetes groups, et cetera. And when the certificate expires as painless or as painless as it can be to re-authenticate. Now, we don't want to have manually configured users. So we're going to take a look at setting this up within OIDC provider for the Teleport Community Edition.

1:19 The supported provider is GitHub, which is perfect for developers. Of course, if you're running Teleport Enterprise, you can also use OIDC and SAML connectors beyond GitHub, allowing you to plug in Okta Azure ad, Google Workspace, or any other compliant identity provider. But for my Rawkode Academy production Cluster, I'm more than happy to use GitHub. The flow works like this. The user runs TSH login to authenticate with Teleport. It opens a browser and they click the button. Boom, job done. They can land list Kubernetes clusters, get credentials and work with the Kubernetes. API sound too good to be true.

2:02 Let's take a look. So here we have our Teleport rawkode.cloud. I have removed all GitHub authentication. We're gonna start from scratch and we're gonna do it the GitOps way. We don't want to log in with my Rawkode user. Instead, we wanna modify our get GitOps pipeline in two ways. First we've got the helm release and inside here we're pretty much just doing one thing, and that is we're going to enable the teleport operator. This gives us the ability to configure Teleport, whether that be apps we wish to expose, or our GitHub OIDC single sign on authentication support

2:57 that we can apply in a GitHub's pipeline. And I can think of no better way. I would like to configure my teleport. All right, so then we click on GitHub connector. This is just a teleport GitHub connector using a custom resource definition. We have a client ID and a display name, which is, this is a GitHub authentication. No surprises here. We tell it to pull or secret from the Cluster. This is handled by the Xterm Secrets operator. I can show you that it's not very exciting. Uh, we have this sinking from in physical. Uh, to a secret in my Cluster with my GitHub client secret.

3:37 Like so, so we give that client secret to teleport. We provide the redirect URL, and then we map our teams to our roles. This is our GitHub teams to our teleport roles. Here we have our catchall. Anyone who is a member of the Rawkode Academy organization will get read access to the Cluster. And anyone who is on the platform team will get editor access. These roles can also be provided via a customer resource definition, like, so. Here we have the access role, this just allows you to provide Kubernetes roles that you wish to attach Kubernetes labels to use for resource matching, and of course the resources

4:21 and the verbs that you wish to support, as well as the editor one, like so. So if we come over here and click GitHub, this will be super fast 'cause I am logged into GitHub, but. Uh, we now have access to our teleport via GitHub authentication, and that is pretty sweet. But of course we don't want to use the web UI for everything. What about the CLI? Let's remove all my existing TSH config. We can run TSH status and we're not logged in. We can now see that we want to do a login proxying through Teleport

5:05 rawkode.cloud using auth GitHub. This will spin up a web browser asking me to authenticate myself like so. And again, I'm logged into GitHub, so teleport off is near instantaneous. We can refresh the web, but really what we're focusing on here is the CLI. We're now logged in to this teleport server, meaning I can run tsh kube ls. And see that I have access to my Rawkode Academy production Cluster, which could probably do with some labels. We'll tackle that at another video. Let's keep moving. So that is GitHub authentication with Teleport. Now Teleport can do a whole lot more and I want to make sure we dive into

5:57 some of those really cool features. So join us in the next video as we take a look at just in time access. We'll see you in a minute.

Course curriculum (6 lessons)
  1. 01. Introduction to Teleport for Kubernetes
  2. 02. Deploying a Teleport Cluster on Kubernetes
  3. 03. Identity-Based User Access & RBAC
  4. 04. Two-Layer RBAC with Teleport Boundaries
  5. 05. Just-in-Time Access for Incidents
  6. 06. Auditing and Session Recording

Loading optional course email signup. If it does not load, reload this lesson to retry. Signup requires JavaScript; all lesson content remains available without signing up.