MXS-1346: Disallow convoluted rule names

The rule names could have punctuation in them which caused unnecessary
complexity. Keeping the identifiers simple makes it easier to process.
This commit is contained in:
Markus Mäkelä
2017-08-30 10:34:44 +03:00
parent b9302f11cc
commit 1e90b3623b
2 changed files with 6 additions and 2 deletions

View File

@ -89,6 +89,11 @@ The `function` type rule will now match a query that does not use a function
when the filter is in whitelist mode (`action=allow`). This means that queries when the filter is in whitelist mode (`action=allow`). This means that queries
that don't use functions are allowed though in whitelist mode. that don't use functions are allowed though in whitelist mode.
#### Rule Names
Rule names can no longer use punctuation in them and can consist only of
alphanumeric characters, underscores and hyphens.
### Logging ### Logging
When known, the session id will be included in all logged messages. This allows When known, the session id will be included in all logged messages. This allows

View File

@ -19,7 +19,7 @@
%option reentrant noyywrap bison-bridge prefix="dbfw_yy" %option reentrant noyywrap bison-bridge prefix="dbfw_yy"
%option yylineno %option yylineno
RULENAME [-_[:alnum:][:punct:]]+ RULENAME [-_[:alnum:]]+
STR [_[:alnum:]]+ STR [_[:alnum:]]+
TIME [0-9]{2}:[0-9]{2}:[0-9]{2}-[0-9]{2}:[0-9]{2}:[0-9]{2} TIME [0-9]{2}:[0-9]{2}:[0-9]{2}-[0-9]{2}:[0-9]{2}:[0-9]{2}
QSTR (\"[^\"]*\")|('[^']*') QSTR (\"[^\"]*\")|('[^']*')
@ -29,7 +29,6 @@ INT [0-9]+
FLOAT [0-9]+[.][0-9]+ FLOAT [0-9]+[.][0-9]+
SQL select|insert|update|delete|grant|revoke|drop|create|alter|use|load SQL select|insert|update|delete|grant|revoke|drop|create|alter|use|load
PIPE [|] PIPE [|]
USER [^[:space:]]*[@]
IP [0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3} IP [0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}
BTSTR `[^`]*` BTSTR `[^`]*`
USTR [%-_[:alnum:][:punct:]]+ USTR [%-_[:alnum:][:punct:]]+