Kubernetes External Joining: static_jwks implementation#30225
Merged
strideynet merged 24 commits intomasterfrom Sep 11, 2023
Merged
Kubernetes External Joining: static_jwks implementation#30225strideynet merged 24 commits intomasterfrom
static_jwks implementation#30225strideynet merged 24 commits intomasterfrom
Conversation
strideynet
commented
Aug 10, 2023
Contributor
Author
|
Blocked pending security review of #29225 |
…ed-kubernetes-external-join
Contributor
Author
|
Docs will follow in a future PR |
This was referenced Aug 14, 2023
hugoShaka
approved these changes
Aug 15, 2023
tigrato
approved these changes
Aug 16, 2023
…ed-kubernetes-external-join
|
@strideynet See the table below for backport results.
|
strideynet
added a commit
that referenced
this pull request
Sep 11, 2023
* Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment
strideynet
added a commit
that referenced
this pull request
Sep 11, 2023
* Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment
strideynet
added a commit
that referenced
this pull request
Sep 11, 2023
* Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Sep 12, 2023
…) (#31704) * Kubernetes External Joining: `static_jwks` implementation (#30225) * Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment * Go mod tidy
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Sep 12, 2023
…) (#31703) * Kubernetes External Joining: `static_jwks` implementation (#30225) * Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment * Add Kubernetes to repeatable bot join types * Go mod tidy
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Sep 13, 2023
…31702) * Add JWKS baseed kubernetes toekn validator * Add types for static_jwks kubernetes join type * Add validation for new fields on Provisiontoken * SPAG * Add support into tbot for kubernetes join method * Wire static_jwks implementation into auth.Server.checkKubernetesJoinRequest * fix-imports * Add JWKS tests for `kubernetestoken` * Fix TestIDTokenValidator_Validate * Ensure token is bound * Fix mistakenely renamed comments * Tidier return type * Refactor tests for slicker UI * Inject jwks token validator for test substitution * Add test cases for static_jwks to lib/auth kube joining test * Remove TODO * Add more test cases to token validation * Add enforcement of maximum TTL * Regenerate operator crd * Improve comments on proto * Rerun ?? generation ?? of ?? operator ?? protos ?? * Remove outdated comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
static_jwkssub-variant of thekubernetesjoin method to support pods joining in clusters other than the one the Teleport Auth Server is running in.Closes #25543
As per RFD: #29225
Example Token config:
Example Audit Event:
{ "attributes": { "raw": { "aud": [ "leaf.tele.ottr.sh" ], "exp": 1692026408, "iat": 1692025808, "iss": "https://kubernetes.default.svc.cluster.local", "kubernetes.io": { "namespace": "default", "pod": { "name": "ubuntu", "uid": "f6dd8b5e-cafc-4d92-b5ac-1a124a019d72" }, "serviceaccount": { "name": "tbot", "uid": "8b77ea6d-3144-4203-9a8b-36eb5ad65596" } }, "nbf": 1692025808, "sub": "system:serviceaccount:default:tbot" }, "type": "static_jwks", "username": "system:serviceaccount:default:tbot" }, "bot_name": "docker-desktop", "cluster_name": "leaf.tele.ottr.sh", "code": "TJ001I", "ei": 0, "event": "bot.join", "method": "kubernetes", "success": true, "time": "2023-08-14T15:15:59.91Z", "token_name": "docker-desktop-jwks", "uid": "84922598-1ba6-499f-a8cf-0dba96cab1d5" }Example pod spec
Example invocation:
export KUBERNETES_TOKEN_PATH=/var/run/secrets/tokens/tbot ./tbot start --destination-dir=./tbot-user --token=docker-desktop-jwks --auth-server=leaf.tele.ottr.sh:443 --join-method=kubernetes