firewall
Method Summary | |
public firewall |
init([any configurator="DefaultConfigurator"])
Initializes the Firewall, and returns a reference to itself |
public void |
addFilter(any filterInstance)
Adds a filter object to the firewall. |
public void |
addLogger(any logger)
Adds a logger to the firewall. |
public boolean |
allowRequest([string ip_address="#cgi.remote_addr#"])
Invokes each filter, and returns false if the request should be blocked. |
public void |
deRegisterEventListener(any listener)
Registers a listners.EventListener instance |
public void |
dumpConfiguration()
Dumps the configuration of the firewall instance. |
public any |
getAuthenticator()
Returns the authenticator object used for user authentication and management. |
public string |
getConfiguratorName()
Returns the name of the configurator used to configure this firewall instance |
public void |
getDatasource()
Returns the datasource name specified with setDatasource |
public date |
getDateConfigured()
Returns the date at which the firewall was started, or reconfigured last. |
public numeric |
getDefaultBlockLevel()
Returns the Default Block Level |
public numeric |
getDefaultFilterLevel()
Returns the Default Filter Level |
public numeric |
getDefaultLogLevel()
Returns the Default Log Level |
public any |
getFilterAt(numeric index)
Returns the filter object at the specified index |
public numeric |
getFilterCount()
Returns the number of filters in the array |
public array |
getFilters()
Returns an array of filters in use by the firewall |
public any |
getLogReader()
I return the log reader component if avaliable |
public string |
getRequestIPAddress()
Returns the IP address of the requestor |
public string |
getVersion()
Returns the major.minor version number of the firewall: 2.0 |
public boolean |
getWebManagerEnabled()
Returns true if the log viewer is enabled |
public boolean |
hasAuthenticator()
Returns true if setAuthenticator has been called. |
public boolean |
hasFilterInstanceNamed([string name])
Returns true if there is a filter with the specified instance name |
public boolean |
isConfigured()
Returns true if the firewall has been configured. |
public any |
newAuthenticatorInstance(variablename authenticatorName)
returns a new instance of an authenticator object |
public any |
newFilterInstance(variableName filterName)
returns a new instance of a filter |
public any |
newListenerInstance(variableName listenerName)
returns a new instance of an event listener |
public any |
newLoggerInstance(variableName loggerName)
returns a new instance of a logger object |
public boolean |
processRequest([string ip_address="#cgi.remote_addr#"], [boolean abort="true"])
Called in the Application.cfc or Application.cfm to invoke the firewall |
public void |
reconfigure([any configurator="DefaultConfigurator"])
Call This method any time you make a configuration change, to reload the configuration |
public void |
registerEventListener(any listener)
Registers a listners.EventListener instance |
public void |
setAuthenticator(any authenticator)
Specify the authenticator object |
public void |
setConfigured(boolean configured)
Set by framework when firewall has been configured. |
public void |
setDatasource(variablename datasource)
Sets a datasource for the firewall that filters loggers, or listeners may optionally use. We recommend that you create a seperate database, and use a restricted login for the firewall. |
public void |
setDefaultBlockLevel(numeric level)
Sets the Default Block Level |
public void |
setDefaultFilterLevel(numeric level)
Sets the Default Filter Level |
public void |
setDefaultLogLevel(numeric level)
Sets the Default Log Level |
public void |
setVerboseLogging(boolean verbose)
Turns on or off verbose logging for all loggers. Note that you can also set this individually for each logger by calling their setVerbose function. |
public void |
setWebManagerEnabled(boolean enabled)
Turns support for a web interface to view logs on or off. Disabled by default. |
public string |
stringCleaner(string text, [string mode="escape"], [numeric maxLength="0"])
Attempts to remove or escape bad characters from a string. |
Method Detail |
public void addFilter(any filterInstance)
any filterInstance
- should be an instance of firewall.components.filters.BaseFilterpublic void addLogger(any logger)
any logger
- an instance of a a BaseLoggerpublic boolean allowRequest([string ip_address="#cgi.remote_addr#"])
[string ip_address="#cgi.remote_addr#"]
- Pass in an IP address, if cgi.remote_addr is not valid. This may be the case if your web server is behind a proxy.public void deRegisterEventListener(any listener)
any listener
- listeners.EventListener objectpublic void dumpConfiguration()
public any getAuthenticator()
public string getConfiguratorName()
public void getDatasource()
public date getDateConfigured()
public numeric getDefaultBlockLevel()
public numeric getDefaultFilterLevel()
public numeric getDefaultLogLevel()
public any getFilterAt(numeric index)
numeric index
public numeric getFilterCount()
public array getFilters()
public any getLogReader()
public string getRequestIPAddress()
public string getVersion()
public boolean getWebManagerEnabled()
public boolean hasAuthenticator()
public boolean hasFilterInstanceNamed([string name])
[string name]
public firewall init([any configurator="DefaultConfigurator"])
[any configurator="DefaultConfigurator"]
- The name of the configurator component, eg: StrictConfiguratorpublic boolean isConfigured()
public any newAuthenticatorInstance(variablename authenticatorName)
variablename authenticatorName
public any newFilterInstance(variableName filterName)
variableName filterName
public any newListenerInstance(variableName listenerName)
variableName listenerName
public any newLoggerInstance(variableName loggerName)
variableName loggerName
public boolean processRequest([string ip_address="#cgi.remote_addr#"], [boolean abort="true"])
[string ip_address="#cgi.remote_addr#"]
- Pass in an IP address, if cgi.remote_addr is not valid. This may be the case if your web server is behind a proxy.[boolean abort="true"]
- If true the request will be aborted with cfabort.public void reconfigure([any configurator="DefaultConfigurator"])
[any configurator="DefaultConfigurator"]
- The name of the configurator component, eg: StrictConfiguratorpublic void registerEventListener(any listener)
any listener
- listeners.EventListener objectpublic void setAuthenticator(any authenticator)
any authenticator
public void setConfigured(boolean configured)
boolean configured
public void setDatasource(variablename datasource)
variablename datasource
- The datasource namepublic void setDefaultBlockLevel(numeric level)
numeric level
public void setDefaultFilterLevel(numeric level)
numeric level
public void setDefaultLogLevel(numeric level)
numeric level
public void setVerboseLogging(boolean verbose)
boolean verbose
public void setWebManagerEnabled(boolean enabled)
boolean enabled
- Set to true to enable.public string stringCleaner(string text, [string mode="escape"], [numeric maxLength="0"])
string text
- The text to clean[string mode="escape"]
- emove will remove characters such as ; () and more.[numeric maxLength="0"]
- Maximum number of characters to output. If Zero length is not limited.