diff --git a/plugins/op_waf/conf/luawaf.conf b/plugins/op_waf/conf/luawaf.conf index 140da0509..17291c348 100755 --- a/plugins/op_waf/conf/luawaf.conf +++ b/plugins/op_waf/conf/luawaf.conf @@ -1,7 +1,7 @@ lua_shared_dict limit 30m; lua_shared_dict drop_ip 30m; lua_shared_dict drop_sum 30m; -lua_package_path "{$WAF_PATH}/lua/?.lua"; +lua_package_path "{$ROOT_PATH}/openresty/lualib/?.lua;;"; access_by_lua_file {$WAF_PATH}/lua/init.lua; #init_by_lua_file {$WAF_PATH}/lua/init.lua; diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index 41a892f15..df079a53f 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -195,19 +195,19 @@ def contentReplace(content): def initDreplace(): - config = getPluginDir() + '/waf/config.json' - content = mw.readFile(config) - content = json.loads(content) - content['reqfile_path'] = mw.getServerDir( - ) + "/openresty/nginx/conf/waf/html" - mw.writeFile(config, mw.getJson(content)) - path = mw.getServerDir() + "/openresty/nginx/conf" if not os.path.exists(path + '/waf'): sdir = getPluginDir() + '/waf' cmd = 'cp -rf ' + sdir + ' ' + path mw.execShell(cmd) + config = mw.getServerDir() + '/openresty/nginx/conf/waf/config.json' + content = mw.readFile(config) + content = json.loads(content) + content['reqfile_path'] = mw.getServerDir( + ) + "/openresty/nginx/conf/waf/html" + mw.writeFile(config, mw.getJson(content)) + config = mw.getServerDir() + "/openresty/nginx/conf/waf/lua/init.lua" content = mw.readFile(config) content = contentReplace(content) @@ -669,7 +669,7 @@ def setCcConf(): def setSiteCcConf(): - return mw.returnJson(True, '设置成功-?!', []) + return mw.returnJson(False, '暂未开发!', []) def saveScanRule(): diff --git a/plugins/op_waf/info.json b/plugins/op_waf/info.json index cdb50283f..32ae7c43c 100755 --- a/plugins/op_waf/info.json +++ b/plugins/op_waf/info.json @@ -1,5 +1,5 @@ { - "title":"OP防火墙[DEV]", + "title":"OP防火墙", "tip":"soft", "name":"op_waf", "type":"其他插件", diff --git a/plugins/op_waf/waf/config.json b/plugins/op_waf/waf/config.json index c3ec31415..92bbed594 100755 --- a/plugins/op_waf/waf/config.json +++ b/plugins/op_waf/waf/config.json @@ -1 +1 @@ -{"reqfile_path": "/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/html", "retry": {"retry_time": 180, "is_open_global": 0, "retry": 6, "retry_cycle": 60}, "log": true, "scan": {"status": 444, "ps": "\u8fc7\u6ee4\u5e38\u89c1\u626b\u63cf\u6d4b\u8bd5\u5de5\u5177\u7684\u6e17\u900f\u6d4b\u8bd5", "open": true, "reqfile": ""}, "cc": {"status": 444, "ps": "\u8fc7\u8651CC\u653b\u51fb", "limit": 120, "endtime": 300, "open": true, "reqfile": "", "cycle": 60}, "get": {"status": 403, "ps": "\u8fc7\u6ee4uri\u3001uri\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "get.html"}, "log_save": 30, "user-agent": {"status": 403, "ps": "\u901a\u5e38\u7528\u4e8e\u8fc7\u6ee4\u6d4f\u89c8\u5668\u3001\u8718\u86db\u53ca\u4e00\u4e9b\u81ea\u52a8\u626b\u63cf\u5668", "open": true, "reqfile": "user_agent.html"}, "other": {"status": 403, "ps": "\u5176\u5b83\u975e\u901a\u7528\u8fc7\u6ee4", "reqfile": "other.html"}, "cookie": {"status": 403, "ps": "\u8fc7\u6ee4\u5229\u7528Cookie\u53d1\u8d77\u7684\u6e17\u900f\u653b\u51fb", "open": true, "reqfile": "cookie.html"}, "logs_path": "/www/wwwlogs/btwaf", "post": {"status": 403, "ps": "\u8fc7\u6ee4POST\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "post.html"}, "open": true} \ No newline at end of file +{"reqfile_path": "{$WAF_PATH}/html", "retry": {"retry_time": 180, "is_open_global": 0, "retry": 6, "retry_cycle": 60}, "log": true, "scan": {"status": 444, "ps": "\u8fc7\u6ee4\u5e38\u89c1\u626b\u63cf\u6d4b\u8bd5\u5de5\u5177\u7684\u6e17\u900f\u6d4b\u8bd5", "open": true, "reqfile": ""}, "cc": {"status": 444, "ps": "\u8fc7\u8651CC\u653b\u51fb", "limit": 120, "endtime": 300, "open": true, "reqfile": "", "cycle": 60}, "get": {"status": 403, "ps": "\u8fc7\u6ee4uri\u3001uri\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "get.html"}, "log_save": 30, "user-agent": {"status": 403, "ps": "\u901a\u5e38\u7528\u4e8e\u8fc7\u6ee4\u6d4f\u89c8\u5668\u3001\u8718\u86db\u53ca\u4e00\u4e9b\u81ea\u52a8\u626b\u63cf\u5668", "open": true, "reqfile": "user_agent.html"}, "other": {"status": 403, "ps": "\u5176\u5b83\u975e\u901a\u7528\u8fc7\u6ee4", "reqfile": "other.html"}, "cookie": {"status": 403, "ps": "\u8fc7\u6ee4\u5229\u7528Cookie\u53d1\u8d77\u7684\u6e17\u900f\u653b\u51fb", "open": true, "reqfile": "cookie.html"}, "logs_path": "/www/wwwlogs/btwaf", "post": {"status": 403, "ps": "\u8fc7\u6ee4POST\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "post.html"}, "open": true} \ No newline at end of file