Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 1 | SUMMARY = "Daemon to ban hosts that cause multiple authentication errors." |
| 2 | DESCRIPTION = "Fail2Ban scans log files like /var/log/auth.log and bans IP addresses having too \ |
| 3 | many failed login attempts. It does this by updating system firewall rules to reject new \ |
| 4 | connections from those IP addresses, for a configurable amount of time. Fail2Ban comes \ |
| 5 | out-of-the-box ready to read many standard log files, such as those for sshd and Apache, \ |
| 6 | and is easy to configure to read any log file you choose, for any error you choose." |
| 7 | HOMEPAGE = "http://www.fail2ban.org" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 9 | LICENSE = "GPL-2.0" |
| 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=ecabc31e90311da843753ba772885d9f" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 11 | |
Andrew Geissler | 8b13928 | 2021-03-05 15:22:30 -0600 | [diff] [blame] | 12 | SRCREV ="eea1881b734b73599a21df2bfbe58b11f78d0a46" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 13 | SRC_URI = " git://github.com/fail2ban/fail2ban.git;branch=0.11 \ |
| 14 | file://initd \ |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 15 | file://fail2ban_setup.py \ |
| 16 | file://run-ptest \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 17 | " |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 18 | |
| 19 | inherit update-rc.d ptest setuptools3 |
| 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | do_compile_prepend () { |
| 24 | cp ${WORKDIR}/fail2ban_setup.py ${S}/setup.py |
Andrew Geissler | 8b13928 | 2021-03-05 15:22:30 -0600 | [diff] [blame] | 25 | cd ${S} |
| 26 | ./fail2ban-2to3 |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | do_install_append () { |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 30 | 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 Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | do_install_ptest_append () { |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 37 | install -d ${D}${PTEST_PATH} |
| 38 | sed -i -e 's/##PYTHON##/${PYTHON_PN}/g' ${D}${PTEST_PATH}/run-ptest |
Andrew Geissler | 8b13928 | 2021-03-05 15:22:30 -0600 | [diff] [blame] | 39 | install -D ${S}/fail2ban-testcases-all-python3 ${D}${PTEST_PATH} |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | FILES_${PN} += "/run" |
| 43 | |
| 44 | INITSCRIPT_PACKAGES = "${PN}" |
| 45 | INITSCRIPT_NAME = "fail2ban-server" |
| 46 | INITSCRIPT_PARAMS = "defaults 25" |
| 47 | |
| 48 | INSANE_SKIP_${PN}_append = "already-stripped" |
| 49 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 50 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog} iptables sqlite3 python3-core python3-pyinotify" |
| 51 | RDEPENDS_${PN} += " python3-logging python3-fcntl python3-json" |
Brad Bishop | a48c014 | 2020-01-06 09:48:41 -0500 | [diff] [blame] | 52 | RDEPENDS_${PN}-ptest = "python3-core python3-io python3-modules python3-fail2ban" |