-
Notifications
You must be signed in to change notification settings - Fork 41
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
Tenant owner can list the namespace not managed by Capsule #287
Comments
@prometherion I can work on this issue please assign it to me. I have debugged this issue and found the root cause. capsule-proxy cached the RoleBindings using RoleBindingReflector to get the mapping of user and namespaces and then set the label selector in the request to show only those namespaces which belongs to that user. I think the issue here is capsule-proxy cached all the RoleBindings present in the cluster. As the purpose of RoleBindingReflector is to get the mapping of user and a capsule managed namespace it should only cache the RoleBinding created by Capsule. The fix for this issue is in two places:
In this way only Capsule managed RoleBindings are cached. Please provide the feedback on the root cause and the proposed solution. |
Hi @sagar-jadhav The main idea behind this feature was following: if a person had permissions in any namespace (it doesn’t actually matters if is managed by capsule or not), it means that this permission was explicitly granted for him and he should be able to see this namespaces using namespace list operation (because he already have some permissions it makes no sense to hide it) One of the use cases for this feature would be, for example, allowing tenant admins from all cluster tenants to have permissions only for reading logs on a shared ingress located in some other namespace (which can be an another tenant or standalone namespace) |
Thanks for the prompt response, Max! The role binding reflector has been implemented by Max prior to the introduction of a My idea is, in the longer term, to drop the role-binding reflector since it's hard-coded to the If this is blocking you, we introduced a new flag that is "disabling" the role binding reflector and relies only on the remote state of the Kubernetes cluster, bypassing the cache, such as the |
Closing, also considering that discussion about the role binding reflector deprecation has started with #268. |
If it is designed to list all the namespaces (namespaces managed by capsule + others) for a user then YES it makes sense to work as it is. I thought it is designed to list only namespaces managed by Capsule hence pointed it out as Bug. Thank you @MaxFedotov for the information. @prometherion I have used Thanks |
Bug description
As a Tenant Owner I am able to list the namespace not managed by Capsule.
How to reproduce
Create a Tenant
oil
as a cluster adminCreate a namespace
db
as a cluster adminCreate a RoleBinding
admin
as a cluster adminNote: Issue is not tied to any Role you can refer any Role or ClusterRole in the RoleBinding but in subject user needs to be Alice.
Create a namespace
oil-frontend
as a Alice userList the namespace as a Alice user
Expected behaviour
As a Tenant owner I should only see the namespaces managed by Capsule. In the above e.g. only
oil-frontend
should be listed.Additional context
The text was updated successfully, but these errors were encountered: