fail2ban.server.jails module

class fail2ban.server.jails.Jails

Bases: Mapping

Handles the jails.

This class handles the jails. Creation, deletion or access to a jail must be done through this class. This class is thread-safe which is not the case of the jail itself, including filter and actions. This class is based on Mapping type, and the add method must be used to add additional jails.

Methods

add(name, backend[, db])

Adds a jail.

get(k[,d])

items()

keys()

values()

exists

add(name, backend, db=None)

Adds a jail.

Adds a new jail if not already present which should use the given backend.

Parameters:
namestr

The name of the jail.

backendstr

The backend to use.

dbFail2BanDb

Fail2Ban’s persistent database instance.

Raises:
DuplicateJailException

If jail name is already present.

exists(name)