fail2ban : read whitelist from a database

Solution 1:

Sure, there is a way.

Fail2ban has an ignorecommand parameter, that you could use to check against SQL database. Here is an example using sqlite.

Note: there is parameter ignorecache, which makes it fast and minimizes load (overhead to check on every failure), but it is relative "fresh" - it was released firstly in 0.10.4 and 0.11.1.