Skip to content

Commit

Permalink
Add support for per-service bantime
Browse files Browse the repository at this point in the history
Per the fail2ban manual[0], jails can define their own bantime to
override the default.  Now specifying a 'bantime' key in
fail2ban_services will add the appropriate entry into the jail.

Fixes #16.

[0]: http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Jail_Options
  • Loading branch information
xiongchiamiov committed Mar 20, 2016
1 parent 71424b1 commit c91f264
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fail2ban_services:
protocol: tcp (optional)
action: action_ (optional)
banaction: iptables-multiport (optional)
bantime: 600 (optional)
findtime: 600 (optional)
```
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/fail2ban/jail.local.j2
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ protocol = {{ service.protocol }}
{% if service.findtime is defined %}
findtime = {{ service.findtime }}
{% endif %}
{% if service.bantime is defined %}
bantime = {{ service.bantime }}
{% endif %}
{% if service.action is defined %}
action = %({{ service.action }})s
{% endif %}
Expand Down

0 comments on commit c91f264

Please sign in to comment.