server::action::Action Class Reference

Execute commands. More...

List of all members.

Public Member Functions

def __init__
def delCInfo
 Removes a "CInfo".
def execActionBan
 Executes the action "ban" command.
def execActionStart
 Executes the action "start" command.
def execActionStop
 Executes the action "stop" command.
def execActionUnban
 Executes the action "unban" command.
def executeCmd
 Executes a command.
def getActionBan
 Get the "ban" command.
def getActionCheck
 Get the "check" command.
def getActionStart
 Get the "start" command.
def getActionStop
 Get the "stop" command.
def getActionUnban
 Get the "unban" command.
def getCInfo
 Returns a "CInfo".
def getName
 Returns the action name.
def replaceTag
 Replaces tags in query with property values in aInfo.
def setActionBan
 Set the "ban" command.
def setActionCheck
 Set the "check" command.
def setActionStart
 Set the "start" command.
def setActionStop
 Set the "stop" command.
def setActionUnban
 Set the "unban" command.
def setCInfo
 Sets a "CInfo".
def setName
 Sets the action name.

Static Public Attributes

tuple executeCmd = staticmethod(executeCmd)
tuple replaceTag = staticmethod(replaceTag)

Detailed Description

Execute commands.

This class reads the failures from the Jail queue and decide if an action has to be taken. A BanManager take care of the banned IP addresses.

Definition at line 40 of file action.py.


Member Function Documentation

def server::action::Action::__init__ (   self,
  name 
)

Definition at line 42 of file action.py.

def server::action::Action::delCInfo (   self,
  key 
)

Removes a "CInfo".

Parameters:
key the property name

Definition at line 99 of file action.py.

def server::action::Action::execActionBan (   self,
  aInfo 
)

Executes the action "ban" command.

Returns:
True if the command succeeded

Definition at line 153 of file action.py.

def server::action::Action::execActionStart (   self  ) 

Executes the action "start" command.

Replaces the tags in the action command with value of "cInfo" and executes the resulting command.

Returns:
True if the command succeeded

Definition at line 127 of file action.py.

def server::action::Action::execActionStop (   self  ) 

Executes the action "stop" command.

Replaces the tags in the action command with value of "cInfo" and executes the resulting command.

Returns:
True if the command succeeded

Definition at line 223 of file action.py.

def server::action::Action::execActionUnban (   self,
  aInfo 
)

Executes the action "unban" command.

Returns:
True if the command succeeded

Definition at line 178 of file action.py.

def server::action::Action::executeCmd (   realCmd  ) 

Executes a command.

We need a shell here because commands are mainly shell script. They contain pipe, redirection, etc.

Todo:

Force the use of bash!?

Kill the command after a given timeout

Parameters:
realCmd the command to execute
Returns:
True if the command succeeded

Definition at line 302 of file action.py.

def server::action::Action::getActionBan (   self  ) 

Get the "ban" command.

Returns:
the command

Definition at line 145 of file action.py.

def server::action::Action::getActionCheck (   self  ) 

Get the "check" command.

Returns:
the command

Definition at line 195 of file action.py.

def server::action::Action::getActionStart (   self  ) 

Get the "start" command.

Returns:
the command

Definition at line 116 of file action.py.

def server::action::Action::getActionStop (   self  ) 

Get the "stop" command.

Returns:
the command

Definition at line 212 of file action.py.

def server::action::Action::getActionUnban (   self  ) 

Get the "unban" command.

Returns:
the command

Definition at line 170 of file action.py.

def server::action::Action::getCInfo (   self,
  key 
)

Returns a "CInfo".

Parameters:
key the property name

Definition at line 91 of file action.py.

def server::action::Action::getName (   self  ) 

Returns the action name.

Returns:
the name of the action

Definition at line 70 of file action.py.

def server::action::Action::replaceTag (   query,
  aInfo 
)

Replaces tags in query with property values in aInfo.

Parameters:
query the query string with tags
aInfo the properties
Returns:
a string
Replace tags in query

Definition at line 235 of file action.py.

def server::action::Action::setActionBan (   self,
  value 
)

Set the "ban" command.

Parameters:
value the command

Definition at line 136 of file action.py.

def server::action::Action::setActionCheck (   self,
  value 
)

Set the "check" command.

Parameters:
value the command

Definition at line 186 of file action.py.

def server::action::Action::setActionStart (   self,
  value 
)

Set the "start" command.

Parameters:
value the command

Definition at line 107 of file action.py.

def server::action::Action::setActionStop (   self,
  value 
)

Set the "stop" command.

Parameters:
value the command

Definition at line 203 of file action.py.

def server::action::Action::setActionUnban (   self,
  value 
)

Set the "unban" command.

Parameters:
value the command

Definition at line 161 of file action.py.

def server::action::Action::setCInfo (   self,
  key,
  value 
)

Sets a "CInfo".

CInfo are statically defined properties. They can be definied by the user and are used to set e-mail addresses, port, host or anything that should not change during the life of the server.

Parameters:
key the property name
value the property value

Definition at line 83 of file action.py.

def server::action::Action::setName (   self,
  name 
)

Sets the action name.

Parameters:
name the name of the action

Definition at line 62 of file action.py.


Member Data Documentation

tuple server::action::Action::executeCmd = staticmethod(executeCmd) [static]

Definition at line 316 of file action.py.

tuple server::action::Action::replaceTag = staticmethod(replaceTag) [static]

Definition at line 244 of file action.py.


The documentation for this class was generated from the following file:
Generated on Sun May 19 03:01:59 2013 for Fail2Ban by  doxygen 1.6.3