From 1d80afd6eceb8264fa0b917cf4b5b139123cef41 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Mon, 15 Apr 2024 16:04:27 +0200 Subject: network/fail2ban: Updated for version 1.0.2, changed maintainer. Switch to python3 Signed-off-by: Matteo Bernardini Signed-off-by: Willy Sudiarto Raharjo --- network/fail2ban/README.SBo | 10 +++++++++ network/fail2ban/config/paths-slackware.conf | 4 ++-- network/fail2ban/doinst.sh | 11 ---------- network/fail2ban/fail2ban.SlackBuild | 32 +++++++++++++++++----------- network/fail2ban/fail2ban.info | 10 ++++----- network/fail2ban/patches/jail.conf.patch | 11 ---------- 6 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 network/fail2ban/patches/jail.conf.patch diff --git a/network/fail2ban/README.SBo b/network/fail2ban/README.SBo index 1771505629..2cd74a4b01 100644 --- a/network/fail2ban/README.SBo +++ b/network/fail2ban/README.SBo @@ -27,6 +27,16 @@ Making modifications to .local files is the recommended practice as per the software manual. Each .conf file is overridden by equivalent .local file. Please refer Configuration section in fail2ban manual. +NOTE: the default is /etc/ssh/sshd_config is + +SyslogFacility AUTH + +and that means that sshd logs failed logins in /var/log/messages via syslog. + +fail2ban instead looks for failed logins in /var/log/secure and to have sshd +send them there via syslog the directive AUTHPRIV is needed. + + Changelog: 08/03/2008 diff --git a/network/fail2ban/config/paths-slackware.conf b/network/fail2ban/config/paths-slackware.conf index 6bfd505303..d0fb0d65cc 100644 --- a/network/fail2ban/config/paths-slackware.conf +++ b/network/fail2ban/config/paths-slackware.conf @@ -24,9 +24,9 @@ syslog_daemon = /var/log/messages syslog_local0 = /var/log/messages -apache_error_log = /var/log/httpd/*error.log +apache_error_log = /var/log/httpd/*error_log -apache_access_log = /var/log/httpd/*access.log +apache_access_log = /var/log/httpd/*access_log # Default for Slackware provided below, # please change according to your proftpd config file. diff --git a/network/fail2ban/doinst.sh b/network/fail2ban/doinst.sh index ca16775b2e..1239d0323e 100644 --- a/network/fail2ban/doinst.sh +++ b/network/fail2ban/doinst.sh @@ -24,15 +24,4 @@ preserve_perms() { preserve_perms etc/rc.d/rc.fail2ban.new config etc/logrotate.d/fail2ban.new -config etc/fail2ban/fail2ban.conf.new -config etc/fail2ban/jail.conf.new -config etc/fail2ban/paths-common.conf.new -config etc/fail2ban/paths-slackware.conf.new config etc/bash_completion.d/fail2ban.new - -for conf_file in etc/fail2ban/action.d/*.new; do - config $conf_file -done -for conf_file in etc/fail2ban/filter.d/*.new; do - config $conf_file -done diff --git a/network/fail2ban/fail2ban.SlackBuild b/network/fail2ban/fail2ban.SlackBuild index 1ac086703e..a08000e8f7 100644 --- a/network/fail2ban/fail2ban.SlackBuild +++ b/network/fail2ban/fail2ban.SlackBuild @@ -3,6 +3,7 @@ # Slackware Package Build Script for fail2ban # Git Hub: https://github.com/fail2ban/fail2ban/ +# Copyright (c) 2024, Matteo Bernardini , Pisa, Italy # Copyright (c) 2008-2018, Nishant Limbachia, Hoffman Estates, IL, USA # # All rights reserved. @@ -28,7 +29,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM="fail2ban" -VERSION=${VERSION:-0.11.2} +VERSION=${VERSION:-1.0.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -43,9 +44,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -70,6 +68,10 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +sed -i 's|self.install_dir|"/usr/bin"|' setup.py +sed -i 's/^before = paths-debian.conf/before = paths-slackware.conf/' config/jail.conf + +./fail2ban-2to3 python setup.py install --root=$PKG # installing man pages @@ -78,15 +80,6 @@ install -m 0644 man/fail2ban-client.1 man/fail2ban-regex.1 \ man/fail2ban-server.1 man/fail2ban.1 man/fail2ban-testcases.1 $PKG/usr/man/man1 install -m 0644 man/jail.conf.5 $PKG/usr/man/man5 -# move config files to .new -( cd $PKG/etc/fail2ban - for file in $(find . -type f); do - mv $file "$file.new" - done -) - -( cd $PKG/etc/fail2ban; patch -p0 < $CWD/patches/jail.conf.patch ) - find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done @@ -113,6 +106,9 @@ mkdir -p $PKG/var/lib/fail2ban # remove /usr/share/doc rm -fr $PKG/usr/share/doc +# remove the /run directory in the package +rm -fr $PKG/run + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a CONTRIBUTING.md COPYING ChangeLog DEVELOP FILTERS MANIFEST \ README.md RELEASE THANKS TODO \ @@ -124,5 +120,15 @@ mkdir -p $PKG/install cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc +# Don't clobber existing configuration files +for i in etc/fail2ban/{,action.d,fail2ban.d,filter.d,jail.d}; do + for j in $(ls -1 $PKG/$i); do + if [ ! -d $PKG/$i/$j ]; then + mv $PKG/$i/$j $PKG/$i/$j.new + echo "config $i/$j.new" >> $PKG/install/doinst.sh + fi + done +done + cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/fail2ban/fail2ban.info b/network/fail2ban/fail2ban.info index 74bc0d4172..5afbf1a1fa 100644 --- a/network/fail2ban/fail2ban.info +++ b/network/fail2ban/fail2ban.info @@ -1,10 +1,10 @@ PRGNAM="fail2ban" -VERSION="0.11.2" +VERSION="1.0.2" HOMEPAGE="https://github.com/fail2ban/fail2ban/" -DOWNLOAD="https://github.com/fail2ban/fail2ban/archive/0.11.2/fail2ban-0.11.2.tar.gz" -MD5SUM="dbeaad971a1127320b949b0f29d7b1f9" +DOWNLOAD="https://github.com/fail2ban/fail2ban/archive/1.0.2/fail2ban-1.0.2.tar.gz" +MD5SUM="96582af04e60bf56617da9f9cbda0aa7" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Nishant Limbachia" -EMAIL="nishant@mnspace.net" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" diff --git a/network/fail2ban/patches/jail.conf.patch b/network/fail2ban/patches/jail.conf.patch deleted file mode 100644 index f5bd45c226..0000000000 --- a/network/fail2ban/patches/jail.conf.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- jail.conf.orig 2015-06-06 21:28:47.750986224 -0500 -+++ jail.conf.new 2015-06-06 21:29:11.158336003 -0500 -@@ -33,7 +33,7 @@ - [INCLUDES] - - #before = paths-distro.conf --before = paths-debian.conf -+before = paths-slackware.conf - - # The DEFAULT allows a global definition of the options. They can be overridden - # in each jail afterwards. -- cgit v1.2.3-65-gdbad