-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Block $bad_uri_words prototype #365
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# EDIT THIS FILE AS YOU LIKE TO ADD OR REMOVE ANY BAD WORDS YOU WANT TO SCAN FOR ### | ||
|
||
# THE RULES BELOW ARE ENABLED BY DEFAULT | ||
# You can disable this default list by switching the values to 0 | ||
|
||
# Old WordPress vulnerability | ||
"~*(?:\b)HelloThinkPHP(?:\b)" 1; | ||
|
||
# Trigger XDebug in production | ||
"~*(?:\b)XDEBUG_SESSION_START(?:\b)" 1; | ||
|
||
# PHPUnit exploit: | ||
# /vendor/phpunit/phpunit/phpunit.xsd | ||
# /vendor/phpunit/phpunit/build.xml | ||
# /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php | ||
"~*(?:\b)vendor/phpunit/phpunit(?:\b)" 1; | ||
"~*(?:\b)phpunit/src/Util/PHP/eval-stdin\.php(?:\b)" 1; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,14 @@ if ($bad_referer) { | |
return 444; | ||
} | ||
|
||
# --------------------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks fine |
||
# BLOCK BAD URI WORDS | ||
# --------------------------------- | ||
|
||
if ($bad_uri_words) { | ||
return 444; | ||
} | ||
|
||
# ----------------------------- | ||
# BLOCK IP ADDRESSES and RANGES | ||
# ----------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18123,6 +18123,22 @@ geo $ratelimited { | |
# END SECTION 4 - ACTIVATE BLOCKER FUNCTIONS | ||
# ========================================== | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this reference the rules in bad-referrer-words.conf, it also cannot be added here it needs to be added in the two master template files |
||
# ============================= | ||
# BEGIN SECTION 5 - REQUEST URI | ||
# ============================= | ||
|
||
map $request_uri $bad_uri_words { | ||
default 0; | ||
# include bots.d/whitelist-domains.conf; # ??? | ||
include bots.d/bad-uri-words.conf; | ||
} | ||
|
||
|
||
# ========================================== | ||
# END SECTION 5 - ACTIVATE BLOCKER FUNCTIONS | ||
# ========================================== | ||
|
||
# ===================== | ||
# END BLOCKER FUNCTIONS | ||
# ===================== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move these rules to bad-referrer-words.conf