wok-next view fail2ban/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents d43bf7aae921
children e19ff076dc63
line source
1 # SliTaz package receipt.
3 PACKAGE="fail2ban"
4 VERSION="0.9.0"
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 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.fail2ban.org/wiki/index.php/Main_Page"
11 WGET_URL="https://codeload.github.com/$PACKAGE/$PACKAGE/tar.gz/$VERSION"
12 TAGS="monitor network"
13 CONFIG_FILES="/etc/fail2ban"
15 DEPENDS="iptables"
16 BUILD_DEPENDS="python"
18 compile_rules() {
19 python -B setup.py install --root=$install
20 }
22 genpkg_rules() {
23 mkdir -p $fs/etc/logrotate.d $fs/etc/init.d
24 cp -a $install/* $fs
25 sed -i 's/= \\s\*(/= \\s*\\S+\\s\*(/' $fs/etc/fail2ban/filter.d/common.conf
26 sed -i -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \
27 -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf
29 cp -a $stuff/etc/fail2ban/ $fs/etc/
30 cp -a $stuff/etc/init.d $fs/etc/
32 cat >> $fs/etc/fail2ban/jail.conf <<EOT
33 [apache-noscript]
34 enabled = false
35 port = http,https
36 filter = apache-noscript
37 action = iptables-allports[name=APACHE-NOSCRIPT]
38 logpath = /var/log/apache/*errors
39 maxretry = 2
41 [apache-proxy]
42 enabled = false
43 port = http,https
44 filter = apache-proxy
45 action = iptables-allports[name=APACHE-PROXY]
46 logpath = /var/log/apache/*access
47 bantime = 172800
48 maxretry = 2
50 [apache-w00tw00t]
51 enabled = false
52 filter = apache-w00tw00t
53 action = iptables[name=Apache-w00tw00t,port=80,protocol=tcp]
54 logpath = /var/log/apache/*access
55 maxretry = 1
56 bantime = 172800
58 [lighttpd-fastcgi]
59 enabled = false
60 port = http,https
61 filter = lighttpd-fastcgi
62 action = iptables-allports[name=LIGHTTPD-FASTCGI]
63 logpath = /var/log/lighttpd/*error*.log
64 maxretry = 2
66 [ssh-ddos]
67 enabled = true
68 port = ssh,sftp
69 filter = sshd-ddos
70 action = iptables-allports[name=SSHDDOS]
71 logpath = /var/log/messages
72 maxretry = 2
74 [fail2ban]
75 enabled = true
76 filter = fail2ban
77 action = iptables-allports[name=FAIL2BAN]
78 logpath = /var/log/fail2ban.log
79 maxretry = 5
80 findtime = 604800
81 bantime = 604800
82 EOT
83 #ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban
84 cat > $fs/etc/logrotate.d/fail2ban <<EOT
85 /var/log/fail2ban.log {
86 weekly
87 rotate 10
88 compress
89 postrotate
90 /etc/init.d/fail2ban reload >/dev/null || true
91 endscript
92 }
93 EOT
94 }