Created
December 20, 2017 02:05
-
-
Save trexx/3b89778ffd428fa076767af13080e5c7 to your computer and use it in GitHub Desktop.
Fail2Ban using ngx_http_access_module.
This file contains 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 configuration file | |
# | |
# Author: Turan Asikoglu | |
# | |
# | |
[Definition] | |
# Option: actionstart | |
# Notes.: command executed once at the start of Fail2Ban. | |
# Values: CMD | |
# | |
actionstart = touch <file> | |
# Option: actionstop | |
# Notes.: command executed once at the end of Fail2Ban | |
# Values: CMD | |
# | |
actionstop = touch <file> | |
# 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: See jail.conf(5) man page | |
# Values: CMD | |
# | |
actionban = printf %%b "deny <ip>;\n" >> <file> | |
nginx -s reload | |
# Option: actionunban | |
# Notes.: command executed when unbanning an IP. Take care that the | |
# command is executed with Fail2Ban user rights. | |
# Tags: See jail.conf(5) man page | |
# Values: CMD | |
# | |
actionunban = echo "/deny <ip>;$/<br>d<br>w<br>q" | ed <file> | |
nginx -s reload | |
[Init] | |
# Option: file | |
# Notes.: fail2ban-blacklist.conf file path. | |
# Values: STR Default: /etc/nginx/fail2ban-blacklist.conf | |
# | |
file = /etc/nginx/fail2ban-blacklist.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment