spacewander commented on a change in pull request #4587: URL: https://github.com/apache/apisix/pull/4587#discussion_r667772823
########## File path: apisix/plugins/bot-restriction.lua ########## @@ -0,0 +1,180 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +local ipairs = ipairs +local core = require("apisix.core") +local stringx = require('pl.stringx') +local type = type +local str_strip = stringx.strip +local re_find = ngx.re.find + +local MATCH_NONE = 0 +local MATCH_ALLOW = 1 +local MATCH_DENY = 2 +local MATCH_BOT = 3 + +local lrucache_useragent = core.lrucache.new({ ttl = 300, count = 1024 }) + +local schema = { + type = "object", + properties = { + message = { + type = "string", + minLength = 1, + maxLength = 1024, + default = "Not allowed" + }, + whitelist = { + type = "array", + minItems = 1 + }, + blacklist = { + type = "array", + minItems = 1 + }, + }, + additionalProperties = false, +} + +local plugin_name = "bot-restriction" Review comment: Don't believe the nonsense bullshit. This way can only kick out script boys. But for the real hacker, checking the UA is definitely not enough. > We have to use the product of professional security company to do the feature you mentioned. That's it. A real bot detection system should be as professional as them instead of just doing UA checks and declaring this solves the problem. People will laugh at APISIX. We should provide a mechanism that the professional security company can use to build a gateway, but not declare we are a security gateway. ########## File path: apisix/plugins/bot-restriction.lua ########## @@ -0,0 +1,180 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +local ipairs = ipairs +local core = require("apisix.core") +local stringx = require('pl.stringx') +local type = type +local str_strip = stringx.strip +local re_find = ngx.re.find + +local MATCH_NONE = 0 +local MATCH_ALLOW = 1 +local MATCH_DENY = 2 +local MATCH_BOT = 3 + +local lrucache_useragent = core.lrucache.new({ ttl = 300, count = 1024 }) + +local schema = { + type = "object", + properties = { + message = { + type = "string", + minLength = 1, + maxLength = 1024, + default = "Not allowed" + }, + whitelist = { + type = "array", + minItems = 1 + }, + blacklist = { + type = "array", + minItems = 1 + }, + }, + additionalProperties = false, +} + +local plugin_name = "bot-restriction" Review comment: Of course, yes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
