-
Notifications
You must be signed in to change notification settings - Fork 604
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
[WIP]: POC of triggers in different namespace than broker #7502
Conversation
Signed-off-by: Calum Murray <[email protected]>
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I just realized that there is still one possible RBAC problem here: if a user (different to the user who created the trigger) does not have permission to get brokers in another namespace but has permissions to get triggers in the current namespace, they will be able to see that there is a broker in another namespace with a certain name. Not sure if that is a problem @pierDipi |
Summarizing discussion with @pierDipi about a path forwards here: we should create a new RBAC verb (e.g. |
Hi @Cali0707 . Was just thinkering around a bit here would be great if you provide the differences that our new verb would make ? . Since the non-creator of trigger policy without this verb enabled and with the "get" verb enabled on our trigger can still see the trigger yaml . |
@sadath-12 yes they would still be able to see the trigger yaml. The idea of this new verb is to give finer-grained control over who can subscribe to brokers or channels. So I could allow user A to subscribe to broker 1, even if they can't get broker 1. In this scenario, yes people would know that there is a broker with a given name in a namespace, but they won't know anything else. So, I can let people subscribe to my broker without giving them anymore information than the fact that there is a broker with a name in a namespace. Hope this helps! |
@Cali0707 I would think to merge this (currently implemented in the pr) as a temporary solution and guiding users some strict guide to follow on our documentation until we get up with the perfect solution. Since there are many of them waiting for this |
Closing this PR for now as it is only meant to prove the ideas, we can keep referring to it as we continue discussing options on the original issue |
This is a very rough POC of just the RBAC aspect of #7439 , all the reconciler and/or data plane changes still need to be made
Proposed Changes
SubjectAccessReview
s to check if the user creating a trigger has access to getting a broker in a different namespace than the trigger if the namespace is different than the trigger's namespace.To test this, create a new user (I called mine
cmurray
), and given them the following role + rolebinding:Then, create a broker in
default
namespace, and try to create a trigger in namespacens-test
with a user which has appropriate permissions (for me it wasminikube
). It should succeed. If you try again with the user without proper permissions, you will see it fails. For example, if I have a trigger intmp/trigger-other-namespace.yaml
, here are my outputs when running this locally:Still TODO: verify that this RBAC approach is good enough, and deal with writing the actual reconciliation for the trigger when the broker is in a different namespace
Pre-review Checklist
Release Note
Docs