MXS-1449 Firewall: Allow 'USE <db>'

When the database firewall filter is used in white-list mode,
'USE <db>' should be allowed. When connecting, it is always
possible to specify the database anyway so restricting
'USE <db>' serves no purpose.
This commit is contained in:
Johan Wikman 2017-09-27 12:45:54 +03:00
parent c1a7008479
commit 23fb0bf928
2 changed files with 6 additions and 4 deletions

View File

@ -51,13 +51,14 @@ all matching queries, or `ignore` which allows all queries to proceed.
The following statement types will always be allowed through when `action` is
set to `allow`:
- COM_QUIT: Client closes connection
- COM_PING: Server is pinged
- COM_CHANGE_USER: The user is changed for an active connection
- COM_SET_OPTION: Client multi-statements are being configured
- COM_FIELD_LIST: Alias for the `SHOW TABLES;` query
- COM_PROCESS_KILL: Alias for `KILL <id>;` query
- COM_INIT_DB: Alias for `USE <db>;`
- COM_PING: Server is pinged
- COM_PROCESS_INFO: Alias for `SHOW PROCESSLIST;`
- COM_PROCESS_KILL: Alias for `KILL <id>;` query
- COM_QUIT: Client closes connection
- COM_SET_OPTION: Client multi-statements are being configured
You can have both blacklist and whitelist functionality by configuring one
filter with `action=allow` and another one with `action=block`. You can then use

View File

@ -2310,6 +2310,7 @@ static bool command_is_mandatory(const GWBUF *buffer)
{
case MYSQL_COM_CHANGE_USER:
case MYSQL_COM_FIELD_LIST:
case MYSQL_COM_INIT_DB:
case MYSQL_COM_PING:
case MYSQL_COM_PROCESS_INFO:
case MYSQL_COM_PROCESS_KILL: