wok-6.x view fail2ban/receipt @ rev 13206
fail2ban: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 06 14:55:22 2012 +0200 (2012-08-06) |
parents | fb8f84758977 |
children | 19fbe1c329d0 |
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 -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \
30 -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf
31 cat >> $fs/etc/fail2ban/jail.conf <<EOT
32 [ssh-ddos]
34 enabled = true
35 port = ssh,sftp
36 filter = sshd-ddos
37 action = iptables-allports[name=SSHDDOS]
38 logpath = /var/log/messages
39 maxretry = 2
41 EOT
42 ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban
43 cat > $fs/etc/logrotate.d/fail2ban <<EOT
44 /var/log/fail2ban.log {
45 weekly
46 rotate 10
47 compress
48 postrotate
49 /etc/init.d/fail2ban reload >/dev/null || true
50 endscript
51 }
52 EOT
53 }