filters.BaseFilter
Method Summary | |
public BaseFilter |
init(any firewallInstance)
Called Once On Application Initialization |
public void |
allowURI(string uriPrefix)
Add a URI that is to be allowed to be filtered. NOT Case Sensitive |
public boolean |
blockEnabled()
Returns true if blocking is enabled for this filter (setBlockLevel greater than 0) |
public void |
denyURI(string uriPrefix)
DEPRECATED, use ignoreURI |
public boolean |
filterEnabled()
Returns true if filtering is enabled for this filter (setFilterLevel greater than 0) |
public void |
filterRequest()
Filters all varaibles it can in the request when this method is called. |
package void |
filterVariables()
|
public numeric |
getBlockLevel()
Returns the block level specified with setBlockLevel() |
public string |
getDescription()
Returns a plain text description of what the filter does. |
public variablename |
getFilterComponent()
Returns the name of the component |
public numeric |
getFilterID()
Returns the id of the filter specified by the firewall at runtime. |
public string |
getFilterInstanceName()
Returns the filter instance name for this filter instance |
public numeric |
getFilterLevel()
Returns the filter level specified with setFilterLevel() |
public any |
getFirewall()
Returns a reference to the firewall object instance. |
public string |
getHelp()
Returns XHTML markup for a help screen. |
public numeric |
getLogLevel()
Returns the log level specified with setLogLevel() |
public string |
getName()
Returns the friendly name of the filter. |
public string |
getRequestLogMessage([boolean escape="true"])
get a message for the request if defined, otherwise returns an empty string. |
public string |
getRequestLogMessageDetail([boolean escape="true"])
get a message for the request if defined, otherwise returns an empty string. |
public string |
getThreatCategory()
Returns a threat category for this filter. Examples are xss,sql-injection,session-hijacking,authentication,validation,general the default is general |
public boolean |
ignoresVariable(variableName scope, string varName)
Returns true if the specified variable is to be ignored from a call to ignoreVariable |
public void |
ignoreURI(string uriPrefix)
Add a URI that is to be skiped by the filter. NOT case sensitive |
public void |
ignoreVariable(variableName scope, string varName)
Ignores scanning of the specified variable. |
public numeric |
inspectRequest()
The method called on every request that the filter is active on. Returns a risk level from 0 to 10 - 0 being no risk found, and 10 being a high risk request. |
public boolean |
inspectsCGIScope()
Returns true if filter inspects the CGI scope |
public boolean |
inspectsCookieScope()
Returns true if filter inspects the COOKIE scope |
public boolean |
inspectsFormScope()
Returns true if filter inspects the FORM scope |
public boolean |
inspectsURI([any uriValue="#cgi.script_name#"])
Returns false if the filter ignores this URI from setting allowURI and denyURI functions |
public boolean |
inspectsUrlScope()
Returns true if filter inspects the URL scope |
public numeric |
inspectVariable(variableName scope, string varName, any value)
This method can be overridden by a sub component, and will be invoked for each variable by calling inspectVariables() |
package numeric |
inspectVariables()
|
public boolean |
logEnabled()
Returns true if logging is enabled for this filter (setLogLevel greater than 0) |
public boolean |
logOnly()
false. |
public any |
setAllowDenyOrder(string order)
Should it run the allow list first, and then the deny? or vise versa. Default is allow,deny |
public void |
setBlockLevel(numeric blockLevel)
The blockLevel is an integer from 0 to 10 if set to 0 no requests will be blocked, if set to 10 only highest risk requests are blocked. |
public void |
setFilterID(numeric filterID)
Automatically Set by the Firewall when addFilter is called. |
public void |
setFilterInstanceName([string name])
If you have multiple instances of the same filter you can distinguish them by giving them each a unique filter instance name |
public void |
setFilterLevel([numeric filterLevel])
The filterLevel is an integer from 0 to 10 if set to 0 no requests content will be filtered, if set to 10 only highest risk requests are blocked. |
public void |
setLogLevel(numeric logLevel)
The logLevel is an integer from 0 to 10 if set to 0 nothing is logged, if set to 10 only high risk requests are logged. |
public void |
setRequestLogMessage(string message, [string detail=""])
used by a filter to set a log message when something is found, this message will be logged. |
public void |
setScopes(string scopes)
Pass in the scopes you want this filter to check. |
Method Detail |
public void allowURI(string uriPrefix)
string uriPrefix
- prefix of a url, so /admin/foo/ would filter everything in that folderpublic boolean blockEnabled()
public void denyURI(string uriPrefix)
string uriPrefix
- prefix of a url, so /admin/ would skip everything in that folderpublic boolean filterEnabled()
public void filterRequest()
package void filterVariables()
public numeric getBlockLevel()
public string getDescription()
public variablename getFilterComponent()
public numeric getFilterID()
public string getFilterInstanceName()
public numeric getFilterLevel()
public any getFirewall()
public string getHelp()
public numeric getLogLevel()
public string getName()
public string getRequestLogMessage([boolean escape="true"])
[boolean escape="true"]
- Escapes nasty characterspublic string getRequestLogMessageDetail([boolean escape="true"])
[boolean escape="true"]
- Escapes nasty characterspublic string getThreatCategory()
public boolean ignoresVariable(variableName scope, string varName)
variableName scope
- Must be one of: form,url,cookie,cgistring varName
- The Name of the variable to ignorepublic void ignoreURI(string uriPrefix)
string uriPrefix
- prefix of a url, so /admin/ would skip everything in that folderpublic void ignoreVariable(variableName scope, string varName)
variableName scope
- Must be one of: form,url,cookie,cgi,allstring varName
- The Name of the variable to ignorepublic BaseFilter init(any firewallInstance)
any firewallInstance
public numeric inspectRequest()
public boolean inspectsCGIScope()
public boolean inspectsCookieScope()
public boolean inspectsFormScope()
public boolean inspectsURI([any uriValue="#cgi.script_name#"])
[any uriValue="#cgi.script_name#"]
public boolean inspectsUrlScope()
public numeric inspectVariable(variableName scope, string varName, any value)
variableName scope
string varName
any value
package numeric inspectVariables()
public boolean logEnabled()
public boolean logOnly()
public any setAllowDenyOrder(string order)
string order
- allow,deny or deny,allowpublic void setBlockLevel(numeric blockLevel)
numeric blockLevel
- 0-10public void setFilterID(numeric filterID)
numeric filterID
public void setFilterInstanceName([string name])
[string name]
public void setFilterLevel([numeric filterLevel])
[numeric filterLevel]
- 0-10public void setLogLevel(numeric logLevel)
numeric logLevel
- 0-10public void setRequestLogMessage(string message, [string detail=""])
string message
[string detail=""]
public void setScopes(string scopes)
string scopes
- comma seperated list of scope names, eg: url,form,cookie,cgi