rules.json 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. [
  2. {
  3. "name": "roboagent limit",
  4. "filters": [
  5. "Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client|Ruby|UniversalFeedParser)"
  6. ],
  7. "limit": 0,
  8. "stop": true,
  9. "actions": [
  10. { "name": "log"},
  11. { "name": "block",
  12. "params": {
  13. "message": "Rate limit exceeded"
  14. }
  15. }
  16. ]
  17. },
  18. {
  19. "name": "botlimit",
  20. "filters": [
  21. "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)"
  22. ],
  23. "limit": 0,
  24. "stop": true,
  25. "actions": [
  26. { "name": "log"},
  27. { "name": "block",
  28. "params": {
  29. "message": "Rate limit exceeded"
  30. }
  31. }
  32. ]
  33. },
  34. {
  35. "name": "suspiciously frequent IP",
  36. "filters": [],
  37. "interval": 600,
  38. "limit": 30,
  39. "aggregations": [
  40. "Header:X-Forwarded-For"
  41. ],
  42. "actions":[
  43. {"name":"log"}
  44. ]
  45. },
  46. {
  47. "name": "search request",
  48. "filters": [
  49. "Param:q",
  50. "Path=^(/|/search)$"
  51. ],
  52. "interval": 61,
  53. "limit": 999,
  54. "subrules": [
  55. {
  56. "name": "missing Accept-Language",
  57. "filters": ["!Header:Accept-Language"],
  58. "limit": 0,
  59. "stop": true,
  60. "actions": [
  61. {"name":"log"},
  62. {"name": "block",
  63. "params": {"message": "Rate limit exceeded"}}
  64. ]
  65. },
  66. {
  67. "name": "suspiciously Connection=close header",
  68. "filters": ["Header:Connection=close"],
  69. "limit": 0,
  70. "stop": true,
  71. "actions": [
  72. {"name":"log"},
  73. {"name": "block",
  74. "params": {"message": "Rate limit exceeded"}}
  75. ]
  76. },
  77. {
  78. "name": "IP limit",
  79. "interval": 61,
  80. "limit": 9,
  81. "stop": true,
  82. "aggregations": [
  83. "Header:X-Forwarded-For"
  84. ],
  85. "actions": [
  86. { "name": "log"},
  87. { "name": "block",
  88. "params": {
  89. "message": "Rate limit exceeded"
  90. }
  91. }
  92. ]
  93. },
  94. {
  95. "name": "rss/json limit",
  96. "filters": [
  97. "Param:format=(csv|json|rss)"
  98. ],
  99. "interval": 121,
  100. "limit": 2,
  101. "stop": true,
  102. "actions": [
  103. { "name": "log"},
  104. { "name": "block",
  105. "params": {
  106. "message": "Rate limit exceeded"
  107. }
  108. }
  109. ]
  110. },
  111. {
  112. "name": "useragent limit",
  113. "interval": 61,
  114. "limit": 199,
  115. "aggregations": [
  116. "Header:User-Agent"
  117. ],
  118. "actions": [
  119. { "name": "log"},
  120. { "name": "block",
  121. "params": {
  122. "message": "Rate limit exceeded"
  123. }
  124. }
  125. ]
  126. }
  127. ]
  128. }
  129. ]