使用正則不允許對整表進行操作
-- 禁止應用檢視錶結構
delete from mysql_query_rules where rule_id=10006;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10006,1,'yrzif_test2','yrzif_test2','^desc\s*\S*','desc is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止應用對information_schema進行查詢
delete from mysql_query_rules where rule_id=10007;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10007,1,'yrzif_test2','yrzif_test2','\s*\S*information_schema\s*\S*','query on information_schema is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的查詢
delete from mysql_query_rules where rule_id=10001;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10001,1,'yrzif_test2','yrzif_test2','^SELECT\s*\*\s*from\s*fi_user_bak$','Query not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的刪除
delete from mysql_query_rules where rule_id=1002;
INSERT INTO mysql_query_rules (rule_id, active, username,schemaname,match_pattern, error_msg, apply) VALUES (1002,1,'yrzif_test2','yrzif_test2','^DELETE\s*from\s*fi_user_bak$','Query not allowed',1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的更新
delete from mysql_query_rules where rule_id=1003;
delete from mysql_query_rules where rule_id=1004;
delete from mysql_query_rules where rule_id=1005;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_digest, flagOUT, apply) VALUES (1003,1,'yrzif_test2','yrzif_test2','^update\s*fi_user_bak', 100, 0);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, match_digest, destination_hostgroup, apply) VALUES (1004,1,'yrzif_test2','yrzif_test2', 100, 'WHERE', 9, 1);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, error_msg, apply) VALUES (1005,1, 'yrzif_test2','yrzif_test2',100, 'Query not allowed', 1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
delete from mysql_query_rules where rule_id=10006;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10006,1,'yrzif_test2','yrzif_test2','^desc\s*\S*','desc is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止應用對information_schema進行查詢
delete from mysql_query_rules where rule_id=10007;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10007,1,'yrzif_test2','yrzif_test2','\s*\S*information_schema\s*\S*','query on information_schema is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的查詢
delete from mysql_query_rules where rule_id=10001;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10001,1,'yrzif_test2','yrzif_test2','^SELECT\s*\*\s*from\s*fi_user_bak$','Query not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的刪除
delete from mysql_query_rules where rule_id=1002;
INSERT INTO mysql_query_rules (rule_id, active, username,schemaname,match_pattern, error_msg, apply) VALUES (1002,1,'yrzif_test2','yrzif_test2','^DELETE\s*from\s*fi_user_bak$','Query not allowed',1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對整表進行不加條件的更新
delete from mysql_query_rules where rule_id=1003;
delete from mysql_query_rules where rule_id=1004;
delete from mysql_query_rules where rule_id=1005;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_digest, flagOUT, apply) VALUES (1003,1,'yrzif_test2','yrzif_test2','^update\s*fi_user_bak', 100, 0);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, match_digest, destination_hostgroup, apply) VALUES (1004,1,'yrzif_test2','yrzif_test2', 100, 'WHERE', 9, 1);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, error_msg, apply) VALUES (1005,1, 'yrzif_test2','yrzif_test2',100, 'Query not allowed', 1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29291882/viewspace-2133103/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 正整數表單校驗規則
- Python如何對浮點數進行取整操作?Python
- 阿里不允許使用 Executors 建立執行緒池!那怎麼使用,怎麼監控?阿里執行緒
- Logstash之Grok正則匹配,讓正則進階!
- PKGBUILD檔案pkgver不允許使用連字元-問題UI字元
- shell正則匹配捕獲引用進行IP匹配
- 網站提示405 - 方法不允許:請求中使用了伺服器不允許的方法或動作怎麼辦網站伺服器
- Golang 的正則表達Golang
- C# 正則進階C#
- python可以對excel進行那些操作PythonExcel
- 正則表達batchInert,過濾BAT
- 正則正常使用1
- 使用nodejs對Marketing Cloud的contact主資料進行修改操作NodeJSCloud
- 使用jaxp解析器dom方式對xml節點進行操作XML
- 【雜談】如何對Redis進行原子操作Redis
- 微信、企微小程式使用taro對位置許可權進行處理
- Python之正則表達運用Python
- go語言中import不允許迴圈包含GoImport
- go正則相關使用Go
- 為什麼hashtable不允許設定Null但是hashmap允許?NullHashMap
- JPA之使用JPQL進行CRUD操作
- 理解Path對路徑進行操作的APIAPI
- 用 matlab 對圖片進行對比度和均衡度調整Matlab
- Shell階段09 shell正則,grep正則, sed使用及案例
- 關於使用sklearn進行資料預處理 —— 歸一化/標準化/正則化
- js表情正則 手機正則 郵箱正則JS
- 使用springboot對linux進行操控Spring BootLinux
- MySQL text型別不允許有預設值MySql型別
- 如何使用利特爾法則調整執行緒池大小執行緒
- Linux 中 grep -P 選項 perl正則 限制兩側進行匹配Linux
- 使用go在mongodb中進行CRUD操作MongoDB
- 使用正則 轉換大小寫
- 使用正則實現 getType方法
- 【TcaplusDB知識庫】如何對陣列進行操作陣列
- JQuery對ASP.NET MVC資料進行操作jQueryASP.NETMVC
- Java使用正規表示式對註冊頁面進行驗證功能實現Java
- Python如何對多個sheet表進行整合?Python
- 對 LLM 工具使用進行統一
- 使用MySQL之用正規表示式進行搜尋MySql