wok view fail2ban/receipt @ rev 13230

Move from undigest: glusterfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 14 13:38:58 2012 +0200 (2012-08-14)
parents 1716dac173ae
children 585734d0d3e1
line source
1 # SliTaz package receipt.
3 PACKAGE="fail2ban"
4 VERSION="0.8.7.1"
5 CATEGORY="network"
6 SHORT_DESC="Scans log files to bans IP that makes too many password failures."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="${PACKAGE}_${VERSION}.orig.tar.gz"
9 WEB_SITE="http://www.fail2ban.org/wiki/index.php/Main_Page"
10 WGET_URL="https://github.com/downloads/$PACKAGE/$PACKAGE/$TARBALL"
11 TAGS="monitor network"
12 CONFIG_FILES="/etc/fail2ban"
14 DEPENDS="iptables"
15 BUILD_DEPENDS="python wget"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 python setup.py install --root=$DESTDIR
22 }
24 # Rules to gen a SliTaz package suitable for Tazpkg.
25 genpkg_rules()
26 {
27 mkdir -p $fs/etc/logrotate.d $fs/etc/init.d
28 cp -a $install/* $fs
29 sed -i 's/= \\s\*(/= \\s*\\S+\\s\*(/' > /etc/fail2ban/filter.d/common.conf
30 sed -i -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \
31 -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf
32 cat >> $fs/etc/fail2ban/jail.conf <<EOT
33 [ssh-ddos]
35 enabled = true
36 port = ssh,sftp
37 filter = sshd-ddos
38 action = iptables-allports[name=SSHDDOS]
39 logpath = /var/log/messages
40 maxretry = 2
42 [fail2ban]
43 enabled = true
44 filter = fail2ban
45 action = iptables-allports[name=FAIL2BAN]
46 logpath = /var/log/fail2ban.log
47 maxretry = 5
48 findtime = 604800
49 bantime = 604800
50 EOT
51 ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban
52 cat > $fs/etc/logrotate.d/fail2ban <<EOT
53 /var/log/fail2ban.log {
54 weekly
55 rotate 10
56 compress
57 postrotate
58 /etc/init.d/fail2ban reload >/dev/null || true
59 endscript
60 }
61 EOT
62 }