A video of this working example is available on YouTube and complete PYTHON source code and CODESYS project are available on GitHub.
The following is based on https://stefan.angrick.me/block-unauthorized-openvpn-logins-using-fail2ban.
Add a filter configuration under /etc/fail2ban/filter.d/openvpn.conf
. The contents would be something like (regular expressions may need adjustments):
[INCLUDES]
before = common.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Dribbler Tarbaby Community v.0.1.0 - Copyright 2013-2014 under GNU/GPL | |
// Original script by Mike ([email protected]) | |
// http://www.stopforumspam.com/forum/viewtopic.php?pid=41173 | |
// | |
// Contributors: | |
// John Darkhorse | |
// Derek Haupin ([email protected]) | |
// | |
// @@ WARNING @@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/program_options.hpp> | |
#include <sstream> | |
#include <fstream> | |
#include <iterator> | |
#include <algorithm> | |
namespace po = boost::program_options; | |
class Options | |
{ |