Filtron rules.json: mitigate flood on all URL

See issue #6
This commit is contained in:
Dalf 2019-07-30 09:10:10 +02:00
parent 566677c6c1
commit 5b8b8720b4

View file

@ -7,6 +7,27 @@
"stop": true,
"actions": [{ "name": "log"}]
},
{
"name": "IP limit, all paths",
"interval": 3,
"limit": 25,
"aggregations": ["Header:X-Forwarded-For"],
"actions": [
{"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
]
},
{
"name": "useragent limit, all paths",
"interval": 30,
"limit": 200,
"aggregations": ["Header:X-Forwarded-For", "Header:User-Agent"],
"stop": true,
"actions": [
{"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
]
},
{
"name": "search request",
"filters": ["Param:q", "Path=^(/|/search)$"],
@ -14,10 +35,10 @@
{
"name": "robot agent forbidden",
"limit": 0,
"filters": ["Header:User-Agent=([Cc][Uu][Rr][Ll]|[wW]get|Scrapy|splash|JavaFX|FeedFetcher|python-requests|Go-http-client|Java|Jakarta|okhttp|HttpClient|Jersey|Python|libwww-perl|Ruby|SynHttpClient)"],
"stop": true,
"filters": ["Header:User-Agent=([Cc][Uu][Rr][Ll]|[wW]get|Scrapy|splash|JavaFX|FeedFetcher|python-requests|Go-http-client|Java|Jakarta|okhttp|HttpClient|Jersey|Python|libwww-perl|Ruby|SynHttpClient|UniversalFeedParser)"],
"actions": [
{
"name": "block",
{"name": "block",
"params": {"message": "Rate limit exceeded"}}
]
},
@ -27,8 +48,7 @@
"stop": true,
"filters": ["Header:User-Agent=(Googlebot|GoogleImageProxy|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT|Sogou|Abonti|Pixray|Spinn3r|SemrushBot|Exabot|ZmEu|BLEXBot|bitlybot)"],
"actions": [
{
"name": "block",
{"name": "block",
"params": {"message": "Rate limit exceeded"}}
]
},
@ -44,7 +64,7 @@
},
{
"name": "block Connection:close",
"filters": ["Connection=close"],
"filters": ["Header:Connection=close"],
"limit": 0,
"stop": true,
"actions": [
@ -63,27 +83,13 @@
]
},
{
"name": "IP limit",
"interval": 300,
"limit": 128,
"name": "block accept everything",
"filters": ["!Header:Accept=text/html"],
"limit": 0,
"stop": true,
"aggregations": ["Header:X-Forwarded-For"],
"actions": [
{
"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
]
},
{
"name": "useragent limit",
"interval": 600,
"limit": 60,
"stop": true,
"aggregations": ["Header:X-Forwarded-For", "Header:User-Agent"],
"actions": [
{
"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
{"name": "block",
"params": {"message": "Rate limit exceeded"}}
]
},
{
@ -91,18 +97,29 @@
"interval": 3600,
"limit": 4,
"stop": true,
"filters": ["Header:User-Agent", "Param:format=(csv|json|rss)"],
"filters": ["Param:format=(csv|json|rss)"],
"aggregations": ["Header:X-Forwarded-For"],
"actions": [
{
"name": "block",
{"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
]
},
{
"name": "block accept everything",
"filters": ["!Header:Accept=text/html"],
"limit": 0,
"name": "IP limit",
"interval": 3,
"limit": 3,
"aggregations": ["Header:X-Forwarded-For"],
"actions": [
{"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}
]
},
{
"name": "IP and useragent limit",
"interval": 600,
"limit": 60,
"stop": true,
"aggregations": ["Header:X-Forwarded-For", "Header:User-Agent"],
"actions": [
{"name": "block",
"params": {"message": "Rate limit exceeded, try again later."}}