mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
www/nginx: Add Possibility to Disable User Agent Based Blocks (#934)
* Add Possibility to Disable Bot Protection * fix merge issue
This commit is contained in:
@@ -79,6 +79,13 @@
|
||||
<advanced>true</advanced>
|
||||
<help>Blocks files like .htaccess files or other files not intended for the public.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>httpserver.disable_bot_protection</id>
|
||||
<label>Disable Bot Protection</label>
|
||||
<type>checkbox</type>
|
||||
<advanced>false</advanced>
|
||||
<help>Blocks the request when a possibly bad bot is detected and adds the originating IP to the managed firewall alias for permanent blocking.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>httpserver.ip_acl</id>
|
||||
<label>IP ACL</label>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<model>
|
||||
<mount>//OPNsense/Nginx</mount>
|
||||
<version>1.1.2</version>
|
||||
<version>1.1.3</version>
|
||||
<description>nginx web server, reverse proxy and waf</description>
|
||||
<items>
|
||||
<general>
|
||||
@@ -558,6 +558,10 @@
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
</block_nonpublic_data>
|
||||
<disable_bot_protection type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
</disable_bot_protection>
|
||||
<naxsi_extensive_log type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
|
||||
@@ -130,6 +130,7 @@ server {
|
||||
root /var/etc/acme-client/challenges;
|
||||
}
|
||||
{% endif %}
|
||||
{% if server.disable_bot_protection is not defined or server.disable_bot_protection != '1' %}
|
||||
# block based on User Agents - stuff I have found over the years in my server log
|
||||
if ($http_user_agent ~* Python-urllib|Nmap|python-requests|libwww-perl|MJ12bot|Jorgee|fasthttp|libwww|Telesphoreo|A6-Indexer|ltx71|okhttp|ZmEu|sqlmap|LMAO/2.0|ltx71|zgrab|Ronin/2.0|Hakai/2.0) {
|
||||
return 418;
|
||||
@@ -143,6 +144,7 @@ server {
|
||||
{
|
||||
return 418;
|
||||
}
|
||||
{% endif %}
|
||||
{% if server.ip_acl is defined %}
|
||||
{% set ip_acl = server.ip_acl %}
|
||||
{% include "OPNsense/Nginx/ipacl.conf" %}
|
||||
|
||||
Reference in New Issue
Block a user