Managing user access to kubernetes resource in teleport role or kubernetes RBAC ? #40161
-
Hi everyone. I am using teleport version 14 and define some roles for team members to use kubernetes through teleport.
The editor group in kubernetes has bind with edit clusterrole. i want to restrict this role to get just service in namespace test but this role get servicec in all namespace and also get other resource because of editor group apparently. how should define such a role ? in another role when i define nothing in kubernetes_groups, i get forbidden error when i run kubectl get services test. please show a best practice for managing role access in teleport and kubernetes in order to the manage in one place (teleport or kubernetes) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think the reason you're seeing this difference is because your role is using When using So here's what should happen:
|
Beta Was this translation helpful? Give feedback.
I think the reason you're seeing this difference is because your role is using
version: v6
rather thanversion: v7
: https://goteleport.com/docs/changelog/#extended-kubernetes-per-resource-rbacWhen using
version: v7
, this should work the way you're describing. Even though theeditor
Kubernetes group has greater permissions, settingkubernetes_resources
should cause Teleport to filter out any resources in other namespaces before the response is passed back to the user.So here's what should happen:
kubectl -n test get services
I'd expect that you see all services in thetest
namespacekubectl -n test get pods
you should see nothing (even if there are pods in thetest
…