FuseGuard Logo

fuseguard.components
Component firewall

firewall

The FuseGuard Web Application Firewall for ColdFusion

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 variablename getDatasource()
          Returns the datasource name specified with setDatasource
public date getDateConfigured()
          Returns the date at which the firewall was started, or reconfigured last.
public any getDefaultBlockHTML()
          Returns the Default Block HTML
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 boolean getFailOpen()
          If true an internal exception will not cause the request to be blocked
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 string getInstanceID()
          Returns the FuseGuard Instance ID
public string getLicenseKey()
          Returns the FuseGuard License Key
public any getLogReader()
          I return the log reader component if avaliable
public string getReInitializeKey()
          hisValue
public string getRequestIPAddress()
          Returns the IP address of the requestor
public any getURLBuilder()
          Returns the instance of BaseURLBuilder that is used to create urls within FuseGuard manager.
public boolean getUseXForwardedFor()
          Returns true if FuseGuard will attempt to use X-Forwarded-For header for the end user IP address
public string getVersion()
          Returns the major.minor version number of the firewall: 2.4
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"], [boolean outputBlockHTML="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 any runCloudLicense()
          Used to track hourly billing for cloud licenses.
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 FuseGuard database.
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 setFailOpen([boolean failOpen="false"])
          Set to false if you the request blocked when an internal exception occurrs.
public void setInstanceID([string key])
          Sets the FuseGuard Instance ID
public void setLicenseKey([string key])
          Sets the FuseGuard License Key
public void setReInitializeKey([string key])
          hisValue
public void setURLBuilder(any builder)
          Sets an instance of fuseguard.components.configurators.BaseURLBuilder to construct URL's used within FuseGuard manager UI.
public void setUseXForwardedFor([boolean enable="false"])
          If set true FuseGuard will attempt to use X-Forwarded-For HTTP header to determine the end users IP address. If set true and the header is not present the cgi.remote_addr default will be used.
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 boolean shouldReInitialize()
          Returns true if the reinit key is passed in the url properly
public any stopCloudLicenseThread()
          Stops execution of cloud license reporting thread, may not stop right away.
public string stringCleaner(string text, [string mode="escape"], [numeric maxLength="0"])
          Attempts to remove or escape bad characters from a string.
 

Method Detail

addFilter

public void addFilter(any filterInstance)
Adds a filter object to the firewall.

Parameters:
any filterInstance - should be an instance of firewall.components.filters.BaseFilter

addLogger

public void addLogger(any logger)
Adds a logger to the firewall.

Parameters:
any logger - an instance of a a BaseLogger

allowRequest

public boolean allowRequest([string ip_address="#cgi.remote_addr#"])
Invokes each filter, and returns false if the request should be blocked.

Parameters:
[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 or load balancer. Pass in the value x-forwarded-for to use the X-Forwarded-For header value.

deRegisterEventListener

public void deRegisterEventListener(any listener)
Registers a listners.EventListener instance

Parameters:
any listener - listeners.EventListener object

dumpConfiguration

public void dumpConfiguration()
Dumps the configuration of the firewall instance.


getAuthenticator

public any getAuthenticator()
Returns the authenticator object used for user authentication and management.


getConfiguratorName

public string getConfiguratorName()
Returns the name of the configurator used to configure this firewall instance


getDatasource

public variablename getDatasource()
Returns the datasource name specified with setDatasource


getDateConfigured

public date getDateConfigured()
Returns the date at which the firewall was started, or reconfigured last.


getDefaultBlockHTML

public any getDefaultBlockHTML()
Returns the Default Block HTML


getDefaultBlockLevel

public numeric getDefaultBlockLevel()
Returns the Default Block Level


getDefaultFilterLevel

public numeric getDefaultFilterLevel()
Returns the Default Filter Level


getDefaultLogLevel

public numeric getDefaultLogLevel()
Returns the Default Log Level


getFailOpen

public boolean getFailOpen()
If true an internal exception will not cause the request to be blocked


getFilterAt

public any getFilterAt(numeric index)
Returns the filter object at the specified index

Parameters:
numeric index

getFilterCount

public numeric getFilterCount()
Returns the number of filters in the array


getFilters

public array getFilters()
Returns an array of filters in use by the firewall


getInstanceID

public string getInstanceID()
Returns the FuseGuard Instance ID


getLicenseKey

public string getLicenseKey()
Returns the FuseGuard License Key


getLogReader

public any getLogReader()
I return the log reader component if avaliable


getReInitializeKey

public string getReInitializeKey()
hisValue


getRequestIPAddress

public string getRequestIPAddress()
Returns the IP address of the requestor


getURLBuilder

public any getURLBuilder()
Returns the instance of BaseURLBuilder that is used to create urls within FuseGuard manager.


getUseXForwardedFor

public boolean getUseXForwardedFor()
Returns true if FuseGuard will attempt to use X-Forwarded-For header for the end user IP address


getVersion

public string getVersion()
Returns the major.minor version number of the firewall: 2.4


getWebManagerEnabled

public boolean getWebManagerEnabled()
Returns true if the log viewer is enabled


hasAuthenticator

public boolean hasAuthenticator()
Returns true if setAuthenticator has been called.


hasFilterInstanceNamed

public boolean hasFilterInstanceNamed([string name])
Returns true if there is a filter with the specified instance name

Parameters:
[string name]

init

public firewall init([any configurator="DefaultConfigurator"])
Initializes the Firewall, and returns a reference to itself

Parameters:
[any configurator="DefaultConfigurator"] - The name of the configurator component, eg: StrictConfigurator

isConfigured

public boolean isConfigured()
Returns true if the firewall has been configured.


newAuthenticatorInstance

public any newAuthenticatorInstance(variablename authenticatorName)
returns a new instance of an authenticator object

Parameters:
variablename authenticatorName

newFilterInstance

public any newFilterInstance(variableName filterName)
returns a new instance of a filter

Parameters:
variableName filterName

newListenerInstance

public any newListenerInstance(variableName listenerName)
returns a new instance of an event listener

Parameters:
variableName listenerName

newLoggerInstance

public any newLoggerInstance(variableName loggerName)
returns a new instance of a logger object

Parameters:
variableName loggerName

processRequest

public boolean processRequest([string ip_address="#cgi.remote_addr#"], [boolean abort="true"], [boolean outputBlockHTML="true"])
Called in the Application.cfc or Application.cfm to invoke the firewall

Parameters:
[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.
[boolean outputBlockHTML="true"] - If true, it outputs the default block HTML

reconfigure

public void reconfigure([any configurator="DefaultConfigurator"])
Call This method any time you make a configuration change, to reload the configuration

Parameters:
[any configurator="DefaultConfigurator"] - The name of the configurator component, eg: StrictConfigurator

registerEventListener

public void registerEventListener(any listener)
Registers a listners.EventListener instance

Parameters:
any listener - listeners.EventListener object

runCloudLicense

public any runCloudLicense()
Used to track hourly billing for cloud licenses.


setAuthenticator

public void setAuthenticator(any authenticator)
Specify the authenticator object

Parameters:
any authenticator

setConfigured

public void setConfigured(boolean configured)
Set by framework when firewall has been configured.

Parameters:
boolean configured

setDatasource

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 FuseGuard database.

Parameters:
variablename datasource - The datasource name

setDefaultBlockLevel

public void setDefaultBlockLevel(numeric level)
Sets the Default Block Level

Parameters:
numeric level

setDefaultFilterLevel

public void setDefaultFilterLevel(numeric level)
Sets the Default Filter Level

Parameters:
numeric level

setDefaultLogLevel

public void setDefaultLogLevel(numeric level)
Sets the Default Log Level

Parameters:
numeric level

setFailOpen

public void setFailOpen([boolean failOpen="false"])
Set to false if you the request blocked when an internal exception occurrs.

Parameters:
[boolean failOpen="false"]

setInstanceID

public void setInstanceID([string key])
Sets the FuseGuard Instance ID

Parameters:
[string key]

setLicenseKey

public void setLicenseKey([string key])
Sets the FuseGuard License Key

Parameters:
[string key]

setReInitializeKey

public void setReInitializeKey([string key])
hisValue

Parameters:
[string key]

setURLBuilder

public void setURLBuilder(any builder)
Sets an instance of fuseguard.components.configurators.BaseURLBuilder to construct URL's used within FuseGuard manager UI.

Parameters:
any builder - An instance of configurators.BaseURLBuilder

setUseXForwardedFor

public void setUseXForwardedFor([boolean enable="false"])
If set true FuseGuard will attempt to use X-Forwarded-For HTTP header to determine the end users IP address. If set true and the header is not present the cgi.remote_addr default will be used.

Parameters:
[boolean enable="false"]

setVerboseLogging

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.

Parameters:
boolean verbose

setWebManagerEnabled

public void setWebManagerEnabled(boolean enabled)
Turns support for a web interface to view logs on or off. Disabled by default.

Parameters:
boolean enabled - Set to true to enable.

shouldReInitialize

public boolean shouldReInitialize()
Returns true if the reinit key is passed in the url properly


stopCloudLicenseThread

public any stopCloudLicenseThread()
Stops execution of cloud license reporting thread, may not stop right away.


stringCleaner

public string stringCleaner(string text, [string mode="escape"], [numeric maxLength="0"])
Attempts to remove or escape bad characters from a string.

Parameters:
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.