blob: 6767d80cfdb346b1a0541d57f9df523475e6b34e [file] [log] [blame]
Brad Bishopa48c0142020-01-06 09:48:41 -05001SUMMARY = "Daemon to ban hosts that cause multiple authentication errors."
2DESCRIPTION = "Fail2Ban scans log files like /var/log/auth.log and bans IP addresses having too \
3many failed login attempts. It does this by updating system firewall rules to reject new \
4connections from those IP addresses, for a configurable amount of time. Fail2Ban comes \
5out-of-the-box ready to read many standard log files, such as those for sshd and Apache, \
6and is easy to configure to read any log file you choose, for any error you choose."
7HOMEPAGE = "http://www.fail2ban.org"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008
Brad Bishopa48c0142020-01-06 09:48:41 -05009LICENSE = "GPL-2.0"
10LIC_FILES_CHKSUM = "file://COPYING;md5=ecabc31e90311da843753ba772885d9f"
Brad Bishop15ae2502019-06-18 21:44:24 -040011
Andrew Geissler8b139282021-03-05 15:22:30 -060012SRCREV ="eea1881b734b73599a21df2bfbe58b11f78d0a46"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050013SRC_URI = " git://github.com/fail2ban/fail2ban.git;branch=0.11 \
14 file://initd \
Brad Bishopa48c0142020-01-06 09:48:41 -050015 file://fail2ban_setup.py \
16 file://run-ptest \
Brad Bishop15ae2502019-06-18 21:44:24 -040017"
Brad Bishopa48c0142020-01-06 09:48:41 -050018
19inherit update-rc.d ptest setuptools3
20
21S = "${WORKDIR}/git"
22
23do_compile_prepend () {
24 cp ${WORKDIR}/fail2ban_setup.py ${S}/setup.py
Andrew Geissler8b139282021-03-05 15:22:30 -060025 cd ${S}
26 ./fail2ban-2to3
Brad Bishopa48c0142020-01-06 09:48:41 -050027}
28
29do_install_append () {
Andrew Geissler1fe918a2020-05-15 14:16:47 -050030 install -d ${D}/${sysconfdir}/fail2ban
31 install -d ${D}/${sysconfdir}/init.d
32 install -m 0755 ${WORKDIR}/initd ${D}${sysconfdir}/init.d/fail2ban-server
33 chown -R root:root ${D}/${bindir}
Brad Bishopa48c0142020-01-06 09:48:41 -050034}
35
36do_install_ptest_append () {
Andrew Geissler1fe918a2020-05-15 14:16:47 -050037 install -d ${D}${PTEST_PATH}
38 sed -i -e 's/##PYTHON##/${PYTHON_PN}/g' ${D}${PTEST_PATH}/run-ptest
Andrew Geissler8b139282021-03-05 15:22:30 -060039 install -D ${S}/fail2ban-testcases-all-python3 ${D}${PTEST_PATH}
Brad Bishopa48c0142020-01-06 09:48:41 -050040}
41
42FILES_${PN} += "/run"
43
44INITSCRIPT_PACKAGES = "${PN}"
45INITSCRIPT_NAME = "fail2ban-server"
46INITSCRIPT_PARAMS = "defaults 25"
47
48INSANE_SKIP_${PN}_append = "already-stripped"
49
Andrew Geissler1fe918a2020-05-15 14:16:47 -050050RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog} iptables sqlite3 python3-core python3-pyinotify"
51RDEPENDS_${PN} += " python3-logging python3-fcntl python3-json"
Brad Bishopa48c0142020-01-06 09:48:41 -050052RDEPENDS_${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban"