Created
February 4, 2014 06:54
-
-
Save rwohleb/8799199 to your computer and use it in GitHub Desktop.
Fail2ban action for reporting to BadIPs.com
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
# Fail2Ban action for reporting to badips.com | |
# | |
# Author: Robert Wohleb | |
# | |
[Definition] | |
# Option: actionstart | |
# Notes.: command executed once at the start of Fail2Ban. | |
# Values: CMD | |
# | |
actionstart = if [ -n "<key>" ]; then wget -q -O /dev/null http://www.badips.com/set/key/<key>; fi | |
# Option: actionstop | |
# Notes.: command executed once at the end of Fail2Ban | |
# Values: CMD | |
# | |
actionstop = | |
# Option: actioncheck | |
# Notes.: command executed once before each actionban command | |
# Values: CMD | |
# | |
actioncheck = | |
# Option: actionban | |
# Notes.: command executed when banning an IP. Take care that the | |
# command is executed with Fail2Ban user rights. | |
# Tags: <ip> IP address | |
# <failures> number of failures | |
# <time> unix timestamp of the ban time | |
# Values: CMD | |
# | |
actionban = wget -q -O /dev/null http://www.badips.com/add/<category>/<ip> | |
# Option: actionunban | |
# Notes.: command executed when unbanning an IP. Take care that the | |
# command is executed with Fail2Ban user rights. | |
# Tags: <ip> IP address | |
# <failures> number of failures | |
# <time> unix timestamp of the ban time | |
# Values: CMD | |
# | |
actionunban = | |
[Init] | |
# Option: category | |
# Notes.: used as the category to send to badips.com | |
# Values: [ STRING ] Default: ssh | |
category = ssh | |
# Option: key | |
# Notes.: used as the API key to send to badips.com | |
# Values: [ STRING ] Default: | |
key = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can then add it to specific jails rather than the global ban action if you prefer. Here is an example: