Subversion Repositories ALCASAR

Rev

Rev 2488 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2488 Rev 2497
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: fail2ban.sh 2488 2018-02-25 14:53:54Z lucas.echard $
2
# $Id: fail2ban.sh 2497 2018-02-26 02:00:25Z tom.houdayer $
3
 
3
 
4
FAIL_CONF="/etc/fail2ban/fail2ban.conf"
-
 
5
JAIL_CONF="/etc/fail2ban/jail.conf"
4
JAIL_CONF="/etc/fail2ban/jail.conf"
6
DIR_FILTER="/etc/fail2ban/filter.d/"
5
DIR_FILTER="/etc/fail2ban/filter.d/"
7
ACTION_ALLPORTS="/etc/fail2ban/action.d/iptables-allports.conf"
6
ACTION_ALLPORTS="/etc/fail2ban/action.d/iptables-allports.conf"
8
 
7
 
9
#########################################################
8
#########################################################
10
## Mise à jour du fichier de configuration de fail2ban ##
-
 
11
#########################################################
-
 
12
[ -f $FAIL_CONF ] && [ ! -e $FAIL_CONF.default ] && mv $FAIL_CONF $FAIL_CONF.default
-
 
13
cat << EOF > $FAIL_CONF
-
 
14
 
-
 
15
[Definition]
-
 
16
 
-
 
17
# Option:  loglevel
-
 
18
# Notes.:  Set the log level output.
-
 
19
#          1 = ERROR
-
 
20
#          2 = WARN
-
 
21
#          3 = INFO
-
 
22
#          4 = DEBUG
-
 
23
# Values:  NUM  Default:  3
-
 
24
#
-
 
25
loglevel = 3
-
 
26
 
-
 
27
# Option:  logtarget
-
 
28
# Notes.:  Set the log target. This could be a file, SYSLOG, STDERR or STDOUT.
-
 
29
#          Only one log target can be specified.
-
 
30
# Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
-
 
31
#
-
 
32
logtarget = /var/log/fail2ban.log
-
 
33
 
-
 
34
# Option: socket
-
 
35
# Notes.: Set the socket file. This is used to communicate with the daemon. Do
-
 
36
#         not remove this file when Fail2ban runs. It will not be possible to
-
 
37
#         communicate with the server afterwards.
-
 
38
# Values: FILE  Default:  /var/run/fail2ban/fail2ban.sock
-
 
39
#
-
 
40
socket = /var/run/fail2ban/fail2ban.sock
-
 
41
 
-
 
42
# Option: pidfile
-
 
43
# Notes.: Set the PID file. This is used to store the process ID of the
-
 
44
#         fail2ban server.
-
 
45
# Values: [ FILE ]  Default: /var/run/fail2ban/fail2ban.pid
-
 
46
#
-
 
47
pidfile = /var/run/fail2ban/fail2ban.pid
-
 
48
EOF
-
 
49
 
-
 
50
#########################################################
-
 
51
## Mise à jour de la configuration de jail de fail2ban ##
9
## Mise à jour de la configuration de jail de fail2ban ##
52
#########################################################
10
#########################################################
53
[ -f $JAIL_CONF ] && [ ! -e $JAIL_CONF.default ] && mv $JAIL_CONF $JAIL_CONF.default
11
[ -f $JAIL_CONF ] && [ ! -e $JAIL_CONF.default ] && mv $JAIL_CONF $JAIL_CONF.default
54
cat << EOF > $JAIL_CONF
12
cat << EOF > $JAIL_CONF
55
 
13