1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup github 1.0 |
---|
6 | PortGroup python 1.0 |
---|
7 | |
---|
8 | github.setup fail2ban fail2ban 0.9.3 |
---|
9 | categories security python |
---|
10 | license GPL-2+ |
---|
11 | maintainers free.fr:fclaire openmaintainer |
---|
12 | platforms darwin |
---|
13 | supported_archs noarch |
---|
14 | |
---|
15 | description Fail2ban protects computer against brute-force attacks |
---|
16 | |
---|
17 | long_description Fail2ban scans log files (e.g. /var/log/apache/error_log) and \ |
---|
18 | bans IPs that show the malicious signs -- too many password failures, \ |
---|
19 | seeking for exploits, etc. Generally Fail2Ban then used to update \ |
---|
20 | firewall rules to reject the IP addresses for a specified amount \ |
---|
21 | of time, although any arbitrary other action (e.g. sending an email, \ |
---|
22 | or ejecting CD-ROM tray) could also be configured. Out of the box \ |
---|
23 | Fail2Ban comes with filters for various services (apache, curier, ssh, etc). |
---|
24 | |
---|
25 | homepage http://www.fail2ban.org/ |
---|
26 | |
---|
27 | distname ${version} |
---|
28 | |
---|
29 | checksums rmd160 1f1f1b7a504cbade13a3363cc9143d909168f062 \ |
---|
30 | sha256 146811530b7acf706db6d28068ee60806f6e0c80da14d89b732955a696728c46 |
---|
31 | |
---|
32 | python.default_version 27 |
---|
33 | |
---|
34 | set f2bconfdir ${prefix}/etc/${name} |
---|
35 | set f2bbindir ${prefix}/bin |
---|
36 | set f2brundir ${prefix}/var/run/${name} |
---|
37 | set f2bsock ${f2brundir}/${name}.sock |
---|
38 | set f2bpid ${f2brundir}/${name}.pid |
---|
39 | |
---|
40 | python.link_binaries_suffix |
---|
41 | |
---|
42 | patchfiles patch-setup.py.diff \ |
---|
43 | patch-fail2ban-client-configreader.py.diff \ |
---|
44 | patch-fail2ban-tests-misctestcase.py.diff \ |
---|
45 | patch-fail2ban-tests-utils.py.diff \ |
---|
46 | patch-config-fail2ban.conf.diff \ |
---|
47 | patch-config-jail.conf.diff \ |
---|
48 | patch-config-paths-common.conf.diff \ |
---|
49 | patch-config-paths-osx.conf.diff \ |
---|
50 | patch-config-action.d-osx-afctl.conf.diff \ |
---|
51 | patch-bin-fail2ban-client.diff \ |
---|
52 | patch-bin-fail2ban-server.diff \ |
---|
53 | patch-fail2ban-server-filterpoll.py.diff |
---|
54 | |
---|
55 | post-patch { |
---|
56 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/setup.py \ |
---|
57 | ${worksrcpath}/fail2ban/client/configreader.py \ |
---|
58 | ${worksrcpath}/fail2ban/tests/misctestcase.py \ |
---|
59 | ${worksrcpath}/fail2ban/tests/utils.py \ |
---|
60 | ${worksrcpath}/config/fail2ban.conf \ |
---|
61 | ${worksrcpath}/config/paths-common.conf \ |
---|
62 | ${worksrcpath}/bin/fail2ban-client \ |
---|
63 | ${worksrcpath}/bin/fail2ban-server |
---|
64 | } |
---|
65 | |
---|
66 | startupitem.create yes |
---|
67 | startupitem.start "export LANG=en_GB.UTF-8; if \[ -r ${f2bsock} -a ! -r ${f2bpid} \]; then rm ${f2bsock}; fi; ${f2bbindir}/${name}-client start" |
---|
68 | startupitem.stop "${f2bbindir}/${name}-client stop" |
---|
69 | |
---|
70 | destroot.keepdirs ${destroot}${f2brundir} |
---|
71 | |
---|
72 | post-destroot { |
---|
73 | # Adding dedicated OSX pf-icefloor action file |
---|
74 | xinstall -m 644 ${filespath}/pf-icefloor.conf ${destroot}${f2bconfdir}/action.d/ |
---|
75 | # Adding a suffix to config files |
---|
76 | set cfgfiles [concat [glob ${destroot}${f2bconfdir}/*.conf] [glob ${destroot}${f2bconfdir}/action.d/*.conf] [glob ${destroot}${f2bconfdir}/filter.d/*.conf]] |
---|
77 | foreach cfgfile ${cfgfiles} { |
---|
78 | move ${cfgfile} ${cfgfile}.${version} |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | post-activate { |
---|
83 | # If not already present we put default config files |
---|
84 | set cfgfiles [concat [glob ${f2bconfdir}/*.conf.${version}] [glob ${f2bconfdir}/action.d/*.conf.${version}] [glob ${f2bconfdir}/filter.d/*.conf.${version}]] |
---|
85 | foreach cfgfile ${cfgfiles} { |
---|
86 | regsub "\.${version}" ${cfgfile} {} origcfgfile |
---|
87 | if {![file exists ${origcfgfile}]} { |
---|
88 | file copy ${cfgfile} ${origcfgfile} |
---|
89 | } |
---|
90 | } |
---|
91 | } |
---|
92 | |
---|
93 | notes " |
---|
94 | Next step is to configure fail2ban. |
---|
95 | Start to read: |
---|
96 | ${f2bconfdir}/fail2ban.conf |
---|
97 | ${f2bconfdir}/jail.conf |
---|
98 | and create your own fail2ban.local and jail.local |
---|
99 | |
---|
100 | Start/stop fail2ban with: sudo port \[un\]load fail2ban |
---|
101 | |
---|
102 | More info at ${homepage} |
---|
103 | " |
---|
104 | |
---|
105 | livecheck.type regexm |
---|
106 | livecheck.url ${homepage}wiki/index.php/Downloads |
---|
107 | livecheck.regex <i>stable</i>.*?>${name}-(\[0-9.\]+)< |
---|