From 5f514b9ef98b852ae4a8f3266872d2a983f6349b Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Sat, 22 Jun 2019 14:19:49 +0200 Subject: [PATCH] Fix Whitelisting Tests --- .dev-tools/blacklist-user-agents-none.conf | 61 ++++++++++++++++++++++ .dev-tools/test-blocker.sh | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .dev-tools/blacklist-user-agents-none.conf diff --git a/.dev-tools/blacklist-user-agents-none.conf b/.dev-tools/blacklist-user-agents-none.conf new file mode 100644 index 000000000..e24a6428b --- /dev/null +++ b/.dev-tools/blacklist-user-agents-none.conf @@ -0,0 +1,61 @@ +# EDIT THIS FILE AS YOU LIKE TO BLACKLIST OR WHITELIST ANY BAD USER-AGENT STRINGS YOU WANT TO SCAN FOR +# **************************************************************************************************** + +### VERSION INFORMATION # +################################################### +### Version: V3.2018.05 +### Updated: 2018-08-21 +################################################### +### VERSION INFORMATION ## + +############################################################################## +# _ __ _ # +# / |/ /__ _(_)__ __ __ # +# / / _ `/ / _ \\ \ / # +# /_/|_/\_, /_/_//_/_\_\ # +# __/___/ __ ___ __ ___ __ __ # +# / _ )___ ____/ / / _ )___ / /_ / _ )/ /__ ____/ /_____ ____ # +# / _ / _ `/ _ / / _ / _ \/ __/ / _ / / _ \/ __/ '_/ -_) __/ # +# /____/\_,_/\_,_/ /____/\___/\__/ /____/_/\___/\__/_/\_\\__/_/ # +# # +############################################################################## + +# Add One Entry Per Line - List all the extra bad User-Agents you want to permanently block or whitelist. + +# This is for User-Agents that are not included in the main list of the bot blocker +# This file must exist on your system or Nginx will fail a reload due to a missing file +# This allows you finer control of keeping certain bots blocked and automatic updates will +# Never be able to remove this custom list of yours + +# Please note this include file loads first before any of the already whitelisted User-Agents +# in the bad bot blocker. By loading first in line it over-rides anything below it so for instance +# if you want to block Baidu, Google or Bing for any reason you add them to this file which loads +# first and takes precedence over anything below it. This now allows even finer control over the +# bad bot blocker. Enjoy !!! + +# Even though this file is called blacklist-user-agents, as mentioned it can also be used to whitelist user agents +# By adding them below and setting the 3; to 0; this will permanently whitelist the User-Agent. + +# Make sure any words that contain special characters are escaped and include word boundaries as per the Regex examples below. + +# Example the User-Agent name "someverybaduseragentname1" is entered as "\bsomeverybaduseragentname1\b" +# Example the User-Agent name "some-very-bad-useragentname2" is entered as "\bsome\-very\-bad\-useragentname1\b" +# the "\b" are word boundaries which prevents partial matching and false positives. + +# BY DEFAULT ALL THE EXAMPLES BELOW ARE COMMENTED OUT AND HENCE NOT ENABLED + +# --------------------- +# WHITELISTING EXAMPLES +# --------------------- +# "~*\bsomeverygooduseragentname1\b" 0; +# "~*\bsomeverygooduseragentname2\b" 0; +# "~*\bsome\-very\-good\-useragentname2\b" 0; + +# --------------------- +# BLACKLISTING EXAMPLES +# --------------------- +# "~*\bsomeverybaduseragentname1\b" 3; +# "~*\bsomeverybaduseragentname2\b" 3; +# "~*\bsome\-very\-bad\-useragentname2\b" 3; + + diff --git a/.dev-tools/test-blocker.sh b/.dev-tools/test-blocker.sh index 73838e10d..0cff012f6 100755 --- a/.dev-tools/test-blocker.sh +++ b/.dev-tools/test-blocker.sh @@ -23,7 +23,7 @@ echo "Tests Starting" echo "Set Whitelisting to Default" -sudo cp ${TRAVIS_BUILD_DIR}/bots.d/blacklist-user-agents.conf /etc/nginx/bots.d/blacklist-user-agents.conf +sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf echo "Reloading Nginx" sudo nginx -t && sudo nginx -s reload