[MDEV-13095] Implement user account locking Created: 2017-06-14 Updated: 2019-05-15 Resolved: 2019-02-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Admin statements, Authentication and Privilege System |
| Fix Version/s: | 10.4.2 |
| Type: | Task | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Robert Bindar |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | authentication, privileges, security, upstream | ||
| Issue Links: |
|
||||||||||||||||
| Sprint: | 10.4.0-1 | ||||||||||||||||
| Description |
|
MariaDB should support locking or unlocking user accounts via the· Given MySQL 5.7 already has this feature, we should preserve We should support the following use cases:
When a new connection is attempted to a locked account, the server should Regarding the required privileges for user account locking, there should be Note| The users are allowed to drop themselves or change their own password, Implementation details:
References: |
| Comments |
| Comment by Ranjan Ghosh [ 2018-06-28 ] |
|
Another use-case: I'm trying to write a script to automate restoring a database on our webserver which hosts multiple different websites - each of course with their own user/scheme. To restore the database properly, it needs to be wiped first. Unfortunately, after I deleted all tables, sometimes new website calls create new data/tables which subsequently prevent the restore operation. I dont want to stop the whole webserver because other websites should continue running. It would be really great if I could just LOCK the corresponding account to prevent new calls from coming in and wait until old calls have ceased. Then I knew I could easily restore the schema without any problems/interruptions and UNLOCK the account afterwards. I search if such a method is available and found that MySQL has it but not my much preferred MariaDB. |
| Comment by Teodor Mircea Ionita (Inactive) [ 2018-11-05 ] |
|
I would be interested in tackling this. For a start, what is the desired syntax for implementing this? I looked briefly into the SQL standard and there's no definition for that. Should we use the existing ALTER USER method or add something new similar to LOCK TABLE? Regarding the actual locking mechanism, are we looking at a new user flag or manipulate the hash as suggested on the mailing list (like linux does with passwd/shadow files)? The latter might not be a good approach due to the different hashing methods/libraries that are or might be used in the future, as Vicentiu has hinted. PS: Let me know if these questions would be better directed at the maria-discuss list. |
| Comment by Ranjan Ghosh [ 2018-11-05 ] |
|
I'm just a bystander, but I'd like to note that IMHO it might make sense to design this feature similar to what already exists in recent MySQL versions: https://stackoverflow.com/questions/40604087/how-to-lock-a-users-account-in-mysql-5-7 |