Service Plugins

x84.fail2ban

fail2ban module for x/84.

To enable, add to default.ini:

[fail2ban]
enabled = yes

The following options are available, but not required:

  • ip_blacklist: space-separated list of IPs on permanent blacklist.
  • ip_whitelist: space-separated list of IPs to always allow.
  • max_attempted_logins: max no. of logins allowed for given time window
  • max_attempted_logins_window: the length (in seconds) of the time window for which logins will be tracked (sliding scale).
  • initial_ban_length: ban length (in seconds) when an IP is blacklisted.
  • ban_increment_length: amount of time (in seconds) to add to a ban on subsequent login attempts
x84.fail2ban.get_fail2ban_function()[source]

Return a function used to ban aggressively-connecting clients.

This is analogous to the ‘fail2ban’ utility, for example, telnet or ssh connect scanners.

Returns a function which may be passed an IP address, returning True if the connection from address ip should be accepted.

Returns:function accepting ip address, returning boolean
Return type:callable

x84.msgpoll

x84net message poll for x/84.

x84.msgpoll.do_poll(networks)[source]

Message polling process.

Function is called periodically by poller().

x84.msgpoll.get_last_msg_id(last_file)[source]

Get the “last message id” by data file last_file.

x84.msgpoll.get_networks()[source]

Get list configured message networks.

x84.msgpoll.get_token(network)[source]

get token for authentication

x84.msgpoll.main(background_daemon=True)[source]

Entry point to configure and begin network message polling.

Called by x84/engine.py, function main() as unmanaged thread.

Parameters:background_daemon (bool) – When True (default), this function returns and web modules are served in an unmanaged, background (daemon) thread. Otherwise, function call to main() is blocking.
Return type:None
x84.msgpoll.poll_network_for_messages(net)[source]

Poll for new messages of network, net.

x84.msgpoll.poller(poll_interval)[source]

Blocking function periodically polls configured message networks.

x84.msgpoll.prepare_message(msg, network, parent)[source]

turn a Msg object into a dict for transfer

x84.msgpoll.publish_network_messages(net)[source]

Push messages to network, net.

x84.msgpoll.pull_rest(net, last_msg_id)[source]

pull messages for a given network newer than the ‘last’ message idx

x84.msgpoll.push_rest(net, msg, parent)[source]

push message for a given network and append an origin line