Forge Home

fail2ban

Controls fail2ban server and rules

10,576 downloads

9,754 latest version

3.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.4 (latest)
  • 0.0.2 (deleted)
  • 0.0.1 (deleted)
released Sep 24th 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'alkivi-fail2ban', '0.0.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add alkivi-fail2ban
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install alkivi-fail2ban --version 0.0.4

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

alkivi/fail2ban — version 0.0.4 Sep 24th 2014

Fail2ban Module

This module will install and configure a fail2ban server and allow you to add other rules

Usage

Minimal server configuration

class { 'fail2ban': }

This will do the typical install, configure and service management.

More server configuration

class { 'fail2ban'
  ignoreip   = ['127.0.0.1/8'],
  bantime    = 600,
  maxretry   = 3,
  backend    = 'auto',
  destemail  = 'root@localhost',
  banaction  = 'iptables-multiport',
  mta        = 'sendmail',
  protocol   = 'tcp',
  chain      = 'INPUT',
  action_    = '%(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]',
  action_mw  = '%(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]',
  action_mwl = '%(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
              %(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]',
  action     = '%(action_mwl)s',
  motd       = true,
}

Rules configuration

fail2ban::section{ 'apache':
    content => "enabled  = true
port     = http,https
filter   = apache-auth
logpath  = '/var/log/apache/*.log'
maxretry = 6"
}

Limitations

  • This module has been tested on Debian Wheezy, Squeeze.

License

All the code is freely distributable under the terms of the LGPLv3 license.

Contact

Need help ? contact@alkivi.fr

Support

Please log tickets and issues at our Github