Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot block "good" User-Agent in blacklist-user-agents.conf #204

Open
MyLifeOrganized opened this issue Jun 30, 2024 · 1 comment

Comments

@MyLifeOrganized
Copy link

MyLifeOrganized commented Jun 30, 2024

I want to block an User-Agent which is listed as "good" in globalblacklist.conf

However when I add it to blacklist-user-agents.conf it is not blocked.
Steps to reproduce:

  1. add this line to blacklist-user-agents.conf:
BrowserMatchNoCase "\bApplebot\b" bad_bot

(Applebot is a "good bot" in globalblacklist.conf)

  1. Restart apache

  2. Try:

curl -A "Applebot" https://yoursite.net

Expected: 
403 Forbidden

Actually:
The HTML page is returned normally

I am using version Apache_2.4

I also tried this syntax and it did not work as well
BrowserMatchNoCase "(?:\b)Applebot(?:\b)" bad_bot

If I block other User-Agents not white-listed in globalblacklist.conf it works as expected and blocked

Your documentation in blacklist-user-agents.conf says:

# 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 !!!

I see that actually blacklist-user-agents.conf is included after, not before white listing in globalblacklist.conf
I've also tried to change globalblacklist.conf  and include blacklist-user-agents.conf first and it still does not work.

How do I block an User-Agent white-listed in globalblacklist.conf?

Server :

  • OS: Ubuntu
  • Apache Version
    Server version: Apache/2.4.52 (Ubuntu)
    Server built: 2024-04-10T17:45:18
@kasutajaimin
Copy link

Can confirm same behaviour on Apache 2.4.6 @ CentOS 7.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants