-
Notifications
You must be signed in to change notification settings - Fork 49
security
Frédéric Descamps edited this page Oct 20, 2020
·
3 revisions
NAME
security - Security management and utilities.
DESCRIPTION
A collection of security management tools and related utilities
Lists all specified authentication method and the amount of users using it.
security.showAuthMethods([user][, session])
- user: String. User to look for, it allows %%.
- session: Object. The session to be used on the operation.
JS ext.security.showAuthMethods()
Default authentication method is mysql_native_password
+-----------------------+-------+
| method | users |
+-----------------------+-------+
| mysql_native_password | 14 |
| caching_sha2_password | 5 |
| auth_socket | 1 |
+-----------------------+-------+
JS ext.security.showAuthMethods('fred')
Default authentication method is mysql_native_password
+------+------+-----------------------+
| user | host | method |
+------+------+-----------------------+
| fred | % | caching_sha2_password |
+------+------+-----------------------+
Lists all accounts and their expiration date
ext.security.showPasswordExpire([show_expire][, session])
- show_expire: Bool. List expired passwords too
- session: Object. The session to be used on the operation.
JS ext.security.showPasswordExpire()
Default password expires in 300 days
On expired password disconnect
+----------------------+-----------------------+------------+
| user | password_last_changed | expires_in |
+----------------------+-----------------------+------------+
| `alfredo`@`%` | 2020-05-29 12:50:05 | 236 days |
| `books`@`%` | 2019-08-08 17:20:44 | expired |
| `dbt3_reader`@`%` | 2019-07-11 08:25:53 | expired |
| `dbt3_writer`@`%` | 2019-07-11 08:26:36 | expired |
| `dev_limited`@`%` | 2020-02-04 14:29:59 | 121 days |
| `fred`@`%` | 2019-02-07 11:09:01 | expired |
| `giuseppe`@`%` | 2019-12-18 08:58:22 | expired |
| `james`@`%` | 2020-04-23 11:03:10 | 200 days |
| `jen`@`%` | 2019-07-09 17:16:20 | expired |
| `logistic`@`%` | 2020-06-29 19:29:23 | expired |
| `logistic2`@`%` | 2020-06-29 19:34:44 | 267 days |
| `nopassword`@`%` | 2020-06-08 18:37:20 | 246 days |
| `python`@`%` | 2020-06-12 10:53:11 | 250 days |
| `root`@`localhost` | 2019-02-07 11:07:29 | expired |
| `socker`@`localhost` | NULL | expired |
| `test`@`%` | 2020-07-24 14:58:25 | 292 days |
| `waseem`@`%` | 2019-12-20 09:22:05 | 75 days |
+----------------------+-----------------------+------------+
Lists all accounts that will expire in specific days
ext.security.showPasswordExpireSoon([expire_in_days][, session])
- expire_in_days: Bool. List accounts that will expire in that range upper limit, if none provided, the default is 30
- session: Object. The session to be used on the operation.
JS ext.security.showPasswordExpireSoon()
+------------+-----------------------+------------+
| user | password_last_changed | expires_in |
+------------+-----------------------+------------+
| `test`@`%` | 2020-07-24 14:58:25 | 2 days |
+------------+-----------------------+------------+