-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: move privileges to a system table. #2939
Comments
I assume we'd check privileges in the privilege table using the gossiped system span. That will be mildly surprising from a user perspective as a permission change on a table will propagate asynchronously through the cluster. |
Yup. I think this will be the case with all config-type stuff. As long as we have the privilege manipulation commands use the real data, and have sufficient docs/warning about propagation delay, I'm not sure it's much of a concern. |
Removing 1.0 label. @mberhault what's the legit priority for this? |
I still think this would be nice, but post 1.0 is definitely fine. |
This is marked as "future improvement" for role-based access control |
CC: @awoods187 |
@mberhault Should we close this issue, or move to |
Given the disadvantages of moving privileges out of the descriptors, I propose we close this entirely, I can't see a good case being made for this anytime soon. |
@mberhault I think we still need this because a change in privileges will only apply to the use of a descriptor for the future. Older versions of the descriptor through AS OF SYSTEM TIME will not use the current privileges. |
We're in a sad state of affairs for a few reasons. A simple example of the problem is as follows:
Now for user
Fun! Even worse is that it works for dropped tables.
Even worse is that our user model is keyed by the string name.
A more sound user model would have a unique, internal identifier for each user such that a new user of the same name as an old user does not inherit the historical permissions of the old user of the same name. A short term solution could be to use the current permissions on the table for authorization checks. Such an approach has a problem if the table has since been dropped. Currently it is useful to be able to access a dropped table using historical timestamps to recovery accidentally deleted data. Today this is done using historical reads, perhaps with Two options to deal with historical reads on dropped tables would be to
A better long-term solution would be to store authorization information outside of the table descriptor to join access rules to users (which are hopefully keyed but something other than just the string name). |
We have marked this issue as stale because it has been inactive for |
Moving the privileges to a system table does not feel like the obvious approach. Given that, I'm going to close this. |
DB/Table privileges are currently stored in database/table descriptors.
This means that a privilege change on a system table is similar to a schema change, conflicting with the lease logic.
It would be preferable to store them in their own system table. Keyed either by object ID (meaning privileges would be only for existing objects), or by name with optional globs (mysql does this, allowing privileges to be set on db.*).
The privileges on the privilege table itself would need to be ignored, with logic coming from the privileges on parent objects. eg: to add a privilege on table foo.bar, a user would need
GRANT
privileges on databasefoo
, as opposed toINSERT
privileges onsystem.privilege
.The text was updated successfully, but these errors were encountered: