Middleware to block requests based on UserAgent and requested URL. The inspiration for this came from a ridiculous amount of bots scanning our sites for exploits. So many .php requests in general, wp-login.php in particular and then oh the bots scraping email addresses, like sleazoid zoominfobot which doesn't even honor rel=nofollow. Well given their reputation (google it), that's not surprising.
This middleware blocks requests by URL containing or ending in certain strings, and user agents that contain certain strings, all case insensitive. The configuration is provided via a JSON file, with a UI in Admin > Settings > Request Block Settings (standard YetaWF site), which can also dynamically reload the settings.
There is no logging as we don't care who the sleaze balls are.
Namespace: YetaWF2.Middleware
Assembly: YetaWF.Core
Inheritance
public class BlockRequestMiddleware;
BlockRequestMiddleware | Constructor. |
SettingsFile | (not specified) |
SETTINGSFILE | (not specified) |
Equals | Determines whether the specified object is equal to the current object. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. | |
GetCurrentSettings | Returns the currently active settings. | |
GetHashCode | Serves as the default hash function. | |
GetType | Gets the Type of the current instance. | |
Invoke | (not specified) | |
LoadBlockSettingsAsync | Load or reload the block settings file. | |
MemberwiseClone | Creates a shallow copy of the current Object. | |
ReferenceEquals | Determines whether the specified Object instances are the same instance. | |
SaveNewSettings | Save new settings. | |
ToString | Returns a string that represents the current object. |
See Also YetaWF.Core Overview
Documentation Feedback
© 2024 - Softel vdm, Inc. - YetaWF.com