mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
15
package/fail2ban/Config.in
Normal file
15
package/fail2ban/Config.in
Normal file
@@ -0,0 +1,15 @@
|
||||
config BR2_PACKAGE_FAIL2BAN
|
||||
bool "fail2ban"
|
||||
depends on BR2_PACKAGE_PYTHON
|
||||
help
|
||||
Fail2ban scans log files (e.g. /var/log/apache/error_log) and
|
||||
bans IPs that show the malicious signs -- too many password
|
||||
failures, seeking for exploits, etc. Out of the box Fail2Ban
|
||||
comes with filters for various services (apache, courier,
|
||||
ssh, etc).
|
||||
|
||||
Fail2Ban is able to reduce the rate of incorrect
|
||||
authentications attempts however it cannot eliminate the risk
|
||||
that weak authentication presents.
|
||||
|
||||
https://www.fail2ban.org
|
||||
23
package/fail2ban/S60fail2ban
Normal file
23
package/fail2ban/S60fail2ban
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting fail2ban: "
|
||||
start-stop-daemon -S -q -m -p /var/run/fail2ban.pid \
|
||||
-b -x fail2ban-server -- -xf start
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping fail2ban: "
|
||||
start-stop-daemon -K -q -p /var/run/fail2ban.pid
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart)
|
||||
"$0" stop
|
||||
sleep 1
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
3
package/fail2ban/fail2ban.hash
Normal file
3
package/fail2ban/fail2ban.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# sha256 locally computed
|
||||
sha256 d6ca1bbc7e7944f7acb2ba7c1065953cd9837680bc4d175f30ed155c6a372449 fail2ban-0.10.4.tar.gz
|
||||
sha256 a75fec0260742fe6275d63ff6a5d97b924b28766558306b3fa4069763096929b COPYING
|
||||
35
package/fail2ban/fail2ban.mk
Normal file
35
package/fail2ban/fail2ban.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
################################################################################
|
||||
#
|
||||
# fail2ban
|
||||
#
|
||||
################################################################################
|
||||
|
||||
FAIL2BAN_VERSION = 0.10.4
|
||||
FAIL2BAN_SITE = $(call github,fail2ban,fail2ban,$(FAIL2BAN_VERSION))
|
||||
FAIL2BAN_LICENSE = GPL-2.0+
|
||||
FAIL2BAN_LICENSE_FILES = COPYING
|
||||
FAIL2BAN_SETUP_TYPE = distutils
|
||||
|
||||
define FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||
$(SED) '/^socket/c\socket = /run/fail2ban.sock' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||
$(SED) '/^pidfile/c\pidfile = /run/fail2ban.pid' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||
$(SED) '/^dbfile/c\dbfile = None' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||
endef
|
||||
FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||
|
||||
define FAIL2BAN_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 755 package/fail2ban/S60fail2ban \
|
||||
$(TARGET_DIR)/etc/init.d/S60fail2ban
|
||||
endef
|
||||
|
||||
define FAIL2BAN_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 $(@D)/files/fail2ban.service.in \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -fs ../../../../usr/lib//systemd/system/fail2ban.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/fail2ban.service
|
||||
$(SED) 's,@BINDIR@,/usr/bin,g' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
$(SED) '/^PIDFile/c\PIDFile=/run/fail2ban.pid' $(TARGET_DIR)/usr/lib/systemd/system/fail2ban.service
|
||||
endef
|
||||
|
||||
$(eval $(python-package))
|
||||
Reference in New Issue
Block a user