[MDEV-14443] DENY clause for access control a.k.a. "negative grants" Created: 2017-11-20 Updated: 2023-12-22 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Hanzhi (Inactive) | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Unresolved | Votes: | 7 |
| Labels: | gsoc18 | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||
| Description |
Summary:Implement a way to ensure that a user can not get access to a particular resource. For example:
alice will not be able to select from secret_table. Syntax:
User caseshttps://stackoverflow.com/questions/6288554/mysql-grant-all-privileges-to-database-except-one-table (32k views) Details:
Compatiblity with other databases (Potential future work)SQL Server
MySQL
Implementation details:
Milestones (each milestone includes test cases showcasing functionality):
|
| Comments |
| Comment by Ralf Gebhardt [ 2018-11-10 ] | ||||||||||||||||
|
cvicentiu, rutuja, Please add a rough estimate for the remaining work | ||||||||||||||||
| Comment by Rutuja Surve (Inactive) [ 2019-01-22 ] | ||||||||||||||||
|
Current status: | ||||||||||||||||
| Comment by Rutuja Surve (Inactive) [ 2019-05-05 ] | ||||||||||||||||
|
Current status of implementation: | ||||||||||||||||
| Comment by Ben Stillman [ 2020-08-25 ] | ||||||||||||||||
|
As discussed with Max a while back, this functionality is highly desired by the SkySQL team to revoke access to system schemas. | ||||||||||||||||
| Comment by Jim Parks (Inactive) [ 2021-05-20 ] | ||||||||||||||||
|
The problem I see with that is just that if you later grant some privileges JP On Thu, May 20, 2021 at 7:13 AM Ralf Gebhardt (Jira) <jira@mariadb.org> | ||||||||||||||||
| Comment by Manjot Singh (Inactive) [ 2021-11-10 ] | ||||||||||||||||
|
If there is a DENY on mysql.* for a user and they try to run: mysql < mydump.sql the full dump should load but avoid the mysql.* tables (or have only warnings related). | ||||||||||||||||
| Comment by Manjot Singh (Inactive) [ 2021-11-10 ] | ||||||||||||||||
|
if there is a DENY on mysql.* .. GRANT and related syntax should still be allowed | ||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2021-11-22 ] | ||||||||||||||||
|
manjot DENY cancels out privileges. For example if a user could create a user with CREATE USER privilege, but otherwise didn't have INSERT/UPDATE rights on mysql.* database, then the same would be true if the user had DENY INSERT UPDATE on mysql.*. I assume this is in line with your statements, correct? | ||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2021-12-23 ] | ||||||||||||||||
|
A current status update on the feature: In order to facilitate the feature, I have done the following cleanups:
TODO items:
| ||||||||||||||||
| Comment by Christine Lieu (Inactive) [ 2022-06-22 ] | ||||||||||||||||
|
cvicentiu the Xpand team is going to start implementing this feature as well. Is there a build that we could use to compare notes? | ||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2022-09-07 ] | ||||||||||||||||
|
Hi Sergei! Once you are done with reviewing https://github.com/MariaDB/server/pull/2258 Things currently not completely operational: I'm looking for general input on architecture changes as well as functionality. I expect that by the time you get to the end of the commit tree that the missing items will also be present. | ||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2023-06-14 ] | ||||||||||||||||
|
One status update on this: I've rebased on top of 11.2. As discussed with Sergei Golubchik, I've implemented the separation of denies between users and roles. The implementation still requires testing and I am uncovering edge cases, bugs and an occasional crash. I expect around a week worth of work to stabilize this, then it should be ready for one final review. |