Class IPBanningModuleExtensions
Provides extension methods for IPBanning
Inherited Members
Namespace: EmbedIO.Security
Syntax
public static class IPBanningModuleExtensions
Methods
WithMaxRequestsPerSecond<TModule>(TModule, Int32)
Sets a maximum amount of requests per second as a criterion for banning IP addresses.
Declaration
public static TModule WithMaxRequestsPerSecond<TModule>(this TModule this, int maxRequests = 50)
where TModule : IPBanningModule
Parameters
Type | Name | Description |
---|---|---|
TModule | this | The module on which this method is called. |
Int32 | maxRequests | The maximum requests per second. |
Returns
Type | Description |
---|---|
TModule |
|
Type Parameters
Name | Description |
---|---|
TModule | The type of the module. |
WithRegexRules<TModule>(TModule, Int32, Int32, String[])
Add a collection of Regex to match the log messages against as a criterion for banning IP addresses.
Declaration
public static TModule WithRegexRules<TModule>(this TModule this, int maxMatchCount, int secondsMatchingPeriod, params string[] value)
where TModule : IPBanningModule
Parameters
Type | Name | Description |
---|---|---|
TModule | this | The module on which this method is called. |
Int32 | maxMatchCount | The maximum match count. |
Int32 | secondsMatchingPeriod | The seconds matching period. |
String[] | value | A collection of regex to match log messages against. |
Returns
Type | Description |
---|---|
TModule |
|
Type Parameters
Name | Description |
---|---|
TModule | The type of the module. |
WithRegexRules<TModule>(TModule, String[])
Add a collection of Regex to match the log messages against as a criterion for banning IP addresses.
Declaration
public static TModule WithRegexRules<TModule>(this TModule this, params string[] value)
where TModule : IPBanningModule
Parameters
Type | Name | Description |
---|---|---|
TModule | this | The module on which this method is called. |
String[] | value | A collection of regex to match log messages against. |
Returns
Type | Description |
---|---|
TModule |
|
Type Parameters
Name | Description |
---|---|
TModule | The type of the module. |
WithWhitelist<TModule>(TModule, String[])
Adds a collection of valid IPs that never will be banned.
Declaration
public static TModule WithWhitelist<TModule>(this TModule this, params string[] value)
where TModule : IPBanningModule
Parameters
Type | Name | Description |
---|---|---|
TModule | this | The module on which this method is called. |
String[] | value | A collection of valid IPs that never will be banned. |
Returns
Type | Description |
---|---|
TModule |
|
Type Parameters
Name | Description |
---|---|
TModule | The type of the module. |