Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

ipdict : Avoid brute force attacks

The lino.modlib.ipdict plugin protects a site against brute force attacks.

This plugin gets installed automatically when lino.core.site.Site.use_ipdict is set to True.

It eventually raises a warning “Too many authentication failures from {ipaddr}”.

This page contains code snippets (lines starting with >>>), which are being tested during our development workflow. The following snippet initializes the demo project used throughout this page.

>>> from lino import startup
>>> startup('lino_book.projects.chatter.settings')
>>> from lino.api.doctest import *

Plugin settings

lino.modlib.ipdict.max_failed_auth_per_ip

How many failed authentication attempts to accept before blacklisting an IP address.

Default is 4.

>>> dd.plugins.ipdict.max_failed_auth_per_ip
4
lino.modlib.ipdict.max_blacklist_time

How much time a blacklisted IP should remain blacklisted.

When an IP was blacklisted, got unlocked after max_blacklist_time and then received a successful login, then all sins of anonymous are erased

Default is one minute.

>>> dd.plugins.ipdict.max_blacklist_time
datetime.timedelta(seconds=60)