[MDEV-24065] Restrict permissions to set max_session_mem_used (and maybe more) to SUPER or another suitable admin privilege Created: 2020-10-30 Updated: 2020-11-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
There are a number of variables which a low-privileged and/or unknowing user shouldn't be able to change, as it can cause a variety of problems. Since there are already session variables restricted to certain privileges, apparently the necessary mechanism exists within the server, but it would make sense to extend the list (maybe significantly). max_session_mem_used starts the list. More can be added to the task. |
| Comments |
| Comment by Michael Widenius [ 2020-10-30 ] |
|
The idea with this task is to disable 'normal' users from changing local variables that are mainly meant for testing. Of course the aim is to fix all bugs that can cause crashes. However we should concentrate our efforts on bugs that hits normal users, not bugs that are causing of setting system variables to unexpected values (like giving all or almost no memory to connection). |
| Comment by Sergei Golubchik [ 2020-11-01 ] |
|
To prevent bugs caused by too low max_session_mem_used, max_session_mem_used should not allow very low settings (or my be only in debug builds). Another use case is to prevent users from setting max_session_mem_used too high after the DBA has limited per-session memory usage. This can be solved with a --max* my_getopt prefix. The feature could be to allow SQL access to it. |
| Comment by Elena Stepanova [ 2020-11-01 ] |
|
I agree with the point about prohibiting too low values. I think it should be done in any case, regardless whether permissions remain the same or not. It is however still reasonable to limit permissions to "technical" and/or low-level variables (as opposed to business-logic-related variables) to privileged users only. |
| Comment by Sergei Golubchik [ 2020-11-01 ] |
|
RIght, that's exactly what I mean. "prevent normal users from changing local variables ... to unexpected values (like giving all or almost no memory to connection)" is one task. "prevent users from setting max_session_mem_used too high after the DBA has limited per-session memory usage" is another task. "Require specific privileges to change certain session variables" is a third task. This MDEV-24065 cannot be implemented until it'll be clear what task it is. |