From 3aeb1a9f4e9094b9882b7f7daddbf687161968f6 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sat, 16 Mar 2013 13:57:42 +1100 Subject: [PATCH] ENH: jail.conf man page --- man/jail.conf.5 | 145 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 man/jail.conf.5 diff --git a/man/jail.conf.5 b/man/jail.conf.5 new file mode 100644 index 00000000..7a841f7d --- /dev/null +++ b/man/jail.conf.5 @@ -0,0 +1,145 @@ +.TH JAIL.CONF.5 "fail2ban" "jail.conf(5)" +.SH NAME +jail.conf \- configuration for the fail2ban server +.SH SYNOPSIS +.B jail.conf / jail.local + +.B action.d/*.conf action.d/*.local + +.B filter.d/*.conf filter.d/*.local +.SH DESCRIPTION +Fail2ban has three configuration file types. Action files are the commands for banning and unbanning IP address, +Filter files tell fail2ban how authentication failures occur, and Jail configurations that map the two together. + +There are *.conf files that are distributed by fail2ban and *.local file that contain user overwritten files. +It is recommend that *.conf files are not changed. *.local files are where users overwrite their default settings. +For instance if you require the default [ssh-iptables-ipset] jail create a jail.local with The jail.conf file is + the configuration for the fail2ban server. Only overwride the settings you need to change and the rest come from +the default *.conf file. + +[ssh-iptables-ipset] + +enabled = true + +.SH DEFAULT +The following options are applicable to all jails. Their meaning is in the default jail.conf file. +.TP +\fBignoreip\fR +.TP +\fBbantime\fR +.TP +\fBfindtime\fR +.TP +\fBmaxretry\fR +.TP +\fBbackend\fR +.TP +\fBusedns\fR +.TP +.SH ACTION FILES +Action files specify which commands are executed to ban an IP address. They are located in /etc/fail2ban/action.d. + +Like jail.conf files if you desire local changes create a [actionname].local file in the /etc/fail2ban/action.d directory +and override the required settings. + +The action files are ini files that have two sections, \fBdefination\fR and \fBinit\fR . + +The [init] section allows for settings relevant to the action. In jail.conf/jail.local these can be overwritten for a particular jail. + +The commands are specified in the [defination] section as below.. + +The commands are executed through a system shell so shell redirection and process control is allowed. The commands should +return 0 to indicate success which will prevent fail2ban attempting to retry (up to \fBmaxretry\fR times to ban the IP again. + +The following action parameters are in the [defination] section. +.TP +\fBactionstart\fR +This is the commands that are executed when the jail starts. +.TP +\fBactionstop\fR +This is the commands that are executed when the jail stops. +.TP +\fBactioncheck\fR +This is the command that is before each other action. It checks to see if the environment is ok. +.TP +\fBactionban\fR +This is the command that bans the IP address. +.TP +\fBactionunban\fR +This is the command that unbans the IP address after \fBbantime\fR. + +Tags are in <>. All the elements of [init] are tags that are replaced in all action commands. Tags can be added by the +\fBfail2ban-client\fR using the setctag command. + +More that one command is allowed. Each command needs to be on a new line and indented with whitespace with no blank lines. The following defines +two commands to be executed. + +actionban = iptables -I fail2ban- --source -j DROP + + echo ip=, match=, time=