mirror of https://github.com/searxng/searxng
utils/filtron.sh: various fix from first installation test (WIP)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>pull/1/head
parent
f20193155a
commit
4990b07b4b
@ -1,56 +1,98 @@
|
|||||||
[
|
[{
|
||||||
{
|
"name":"search request",
|
||||||
"name": "api limit",
|
"filters":[
|
||||||
"interval": 60,
|
"Param:q",
|
||||||
"limit": 1000,
|
"Path=^(/|/search)$"
|
||||||
"filters": ["Path=^/api"],
|
|
||||||
"aggregations": ["Path"],
|
|
||||||
"actions": [
|
|
||||||
{"name": "block"}
|
|
||||||
],
|
],
|
||||||
"subrules": [
|
"interval":60,
|
||||||
{
|
"limit":15,
|
||||||
"name": "drop put",
|
"subrules":[
|
||||||
"interval": 60,
|
{
|
||||||
"limit": 100,
|
"name":"roboagent limit",
|
||||||
"filters": ["Method=PUT"],
|
"interval":60,
|
||||||
"aggregations": ["Header:X-Forwarded-For"],
|
"limit":15,
|
||||||
"actions": [
|
"filters":[
|
||||||
{"name": "shell",
|
"Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"
|
||||||
"params": {"cmd": "iptables -A INPUT -s %v -j DROP", "args": ["Header:X-Forwarded-For"]}}
|
],
|
||||||
]
|
"actions":[
|
||||||
|
{"name": "log"},
|
||||||
|
{
|
||||||
|
"name":"block",
|
||||||
|
"params":{
|
||||||
|
"message":"Rate limit exceeded"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "log'n'block rss",
|
"name":"botlimit",
|
||||||
"interval": 300,
|
"limit":0,
|
||||||
"limit": 2500,
|
"stop":true,
|
||||||
"filters": ["Path=^/$", "GET:format=rss"],
|
"filters":[
|
||||||
"actions": [
|
"Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"
|
||||||
|
],
|
||||||
|
"actions":[
|
||||||
{"name": "log"},
|
{"name": "log"},
|
||||||
{"name": "block"}
|
{
|
||||||
|
"name":"block",
|
||||||
|
"params":{
|
||||||
|
"message":"Rate limit exceeded"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "log rule",
|
"name":"IP limit",
|
||||||
"filters": ["Path=/"],
|
"interval":60,
|
||||||
"actions": [ {"name": "log"} ],
|
"limit":15,
|
||||||
"subrules": [
|
"stop":true,
|
||||||
|
"aggregations":[
|
||||||
|
"Header:X-Forwarded-For"
|
||||||
|
],
|
||||||
|
"actions":[
|
||||||
|
{"name": "log"},
|
||||||
{
|
{
|
||||||
"name": "block missing accept-language",
|
"name":"block",
|
||||||
"filters": ["!Header:Accept-Language"],
|
"params":{
|
||||||
"actions": [
|
"message":"Rate limit exceeded"
|
||||||
{"name": "block"}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "block curl",
|
"name":"rss/json limit",
|
||||||
"filters": ["Header:User-Agent=[Cc]url"],
|
"interval":60,
|
||||||
"actions": [
|
"limit":15,
|
||||||
{"name": "block"}
|
"stop":true,
|
||||||
|
"filters":[
|
||||||
|
"Param:format=(csv|json|rss)"
|
||||||
|
],
|
||||||
|
"actions":[
|
||||||
|
{"name": "log"},
|
||||||
|
{
|
||||||
|
"name":"block",
|
||||||
|
"params":{
|
||||||
|
"message":"Rate limit exceeded"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"useragent limit",
|
||||||
|
"interval":60,
|
||||||
|
"limit":15,
|
||||||
|
"aggregations":[
|
||||||
|
"Header:User-Agent"
|
||||||
|
],
|
||||||
|
"actions":[
|
||||||
|
{"name": "log"},
|
||||||
|
{
|
||||||
|
"name":"block",
|
||||||
|
"params":{
|
||||||
|
"message":"Rate limit exceeded"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}]
|
||||||
|
Loading…
Reference in New Issue