https://github.com/rexops/rex-fail2ban
Small fail2ban module
https://github.com/rexops/rex-fail2ban
Last synced: 12 months ago
JSON representation
Small fail2ban module
- Host: GitHub
- URL: https://github.com/rexops/rex-fail2ban
- Owner: RexOps
- Created: 2016-06-18T16:24:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-19T07:38:37.000Z (over 9 years ago)
- Last Synced: 2025-01-05T06:29:27.257Z (about 1 year ago)
- Language: Perl
- Size: 2.93 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rex Fail2ban module
This module setup fail2ban.
## Tasks
### setup
Call this task to install fail2ban on your system.
#### Parameters
* ensure - Default: latest
* service_ensure - Default: running
* fail2ban_conf, Location of configuration file - Default: /etc/fail2ban/fail2ban.conf
* fail2ban_conf_template, Template to use to configure fail2ban. - Default: templates/fail2ban/fail2ban.conf.tpl
* loglevel - Default: INFO
* logtarget - Default: /var/log/fail2ban.log
* syslogsocket - Default: auto
* socket - Default: /var/run/fail2ban/fail2ban.sock
* pidfile - Default: /var/run/fail2ban/fail2ban.pid
* dbfile - Default: /var/lib/fail2ban/fail2ban.sqlite3
* dbpurgeage - Default: 86400
#### Example
```perl
use Fail2ban;
task "setup", sub {
Fail2ban::setup;
};
```
```perl
use Fail2ban;
task "setup", sub {
Fail2ban::setup {
socket => "/tmp/fail2ban.sock",
};
};
```
## Resources
### action
Create a fail2ban action. Will place a file inside */etc/fail2ban/action.d*.
#### Parameters
* ensure - Default: present
* content - Content of the action.
#### Example
This will create the file */etc/fail2ban/action.d/myaction.conf*.
```perl
Fail2ban::action "myaction",
ensure => "present",
content => template("templates/myaction.tpl");
```
### filter
Create a fail2ban filter. Will place a file inside */etc/fail2ban/filter.d*.
#### Parameters
* ensure - Default: present
* content - Content of the filter.
#### Example
This will create the file */etc/fail2ban/filter.d/myfilter.conf*.
```perl
Fail2ban::filter "myfilter",
ensure => "present",
content => template("templates/myfilter.tpl");
```
### jail
Create a fail2ban jail. Will place a file inside */etc/fail2ban/jail.d*.
#### Parameters
* ensure - Default: present
* content - Content of the jail.
#### Example
This will create the file */etc/fail2ban/jail.d/myjail.conf*.
```perl
Fail2ban::jail "myjail",
ensure => "present",
content => template("templates/myjail.tpl");
```