wok view fail2ban/receipt @ rev 13257

fail2ban: add filter.d/lighttpd-fastcgi.conf
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 17 12:21:42 2012 +0200 (2012-08-17)
parents 19fbe1c329d0
children 6be450c86868
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 [lighttpd-fastcgi]
35 enabled = false
36 port = http,https
37 filter = lighttpd-fastcgi
38 logpath = /var/log/lighttpd/*error*.log
39 maxretry = 2
41 [ssh-ddos]
43 enabled = true
44 port = ssh,sftp
45 filter = sshd-ddos
46 action = iptables-allports[name=SSHDDOS]
47 logpath = /var/log/messages
48 maxretry = 2
50 [fail2ban]
51 enabled = true
52 filter = fail2ban
53 action = iptables-allports[name=FAIL2BAN]
54 logpath = /var/log/fail2ban.log
55 maxretry = 5
56 findtime = 604800
57 bantime = 604800
58 EOT
59 ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban
60 cat > $fs/etc/logrotate.d/fail2ban <<EOT
61 /var/log/fail2ban.log {
62 weekly
63 rotate 10
64 compress
65 postrotate
66 /etc/init.d/fail2ban reload >/dev/null || true
67 endscript
68 }
69 EOT
70 }