commit 92c75f7af0b4aa6e000ac1edd3475781c28550766501402b14111378f047addf Author: OBS User unknown Date: Wed Feb 11 03:32:18 2009 +0000 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fail2ban?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fail2ban-0.8.3.tar.bz2 b/fail2ban-0.8.3.tar.bz2 new file mode 100644 index 0000000..0f5af77 --- /dev/null +++ b/fail2ban-0.8.3.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b32fd9ee849bf36d23685a91d1d96f29a2fa383069d7d789e4956c9268dca5cd +size 64028 diff --git a/fail2ban.changes b/fail2ban.changes new file mode 100644 index 0000000..4dd04bb --- /dev/null +++ b/fail2ban.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Feb 4 18:19:39 CET 2009 - kssingvo@suse.de + +- initial version: 0.8.3 + diff --git a/fail2ban.init b/fail2ban.init new file mode 100644 index 0000000..cecea43 --- /dev/null +++ b/fail2ban.init @@ -0,0 +1,157 @@ +#!/bin/sh +# +# Template SUSE system startup script for example daemon fail2ban +# Copyright (C) 2009 Klaus Sinvogel, SUSE / Novell Inc. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, +# USA. +# +# +### BEGIN INIT INFO +# Provides: fail2ban +# Required-Start: $syslog $remote_fs $local_fs +# Should-Start: $time $network iptables +# Required-Stop: $syslog $remote_fs $local_fs +# Should-Stop: $time $network iptables +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: fail2ban daemon bans IPs with too many password failures +# Description: Start fail2ban to scan logfiles and ban IP addresses +# which make too many logfiles failures, and/or sent e-mails about +### END INIT INFO + +# Check for missing binaries (stale symlinks should not happen) +FAIL2BAN_BIN=/usr/bin/fail2ban-client +test -x $FAIL2BAN_BIN || { echo "$FAIL2BAN_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +# Check for existence of needed config file and read it +FAIL2BAN_CONFIG=/etc/sysconfig/fail2ban +test -r $FAIL2BAN_CONFIG || { echo "$FAIL2BAN_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +# Read config +. $FAIL2BAN_CONFIG + +. /etc/rc.status +rc_reset + +case "$1" in + start) + echo -n "Starting fail2ban " + ## Start daemon with startproc(8). If this fails + ## the return value is set appropriately by startproc. + /sbin/startproc $FAIL2BAN_BIN start + + # Remember status and be verbose + rc_status -v + ;; + stop) + echo -n "Shutting down fail2ban " + ## Stop daemon with built-in functionality 'stop' + /sbin/startproc $FAIL2BAN_BIN stop + + # Remember status and be verbose + rc_status -v + ;; + try-restart|condrestart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + # Remember status and be quiet + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 stop + $0 start + + # Remember status and be quiet + rc_status + ;; + force-reload) + ## Signal the daemon to reload its config. Most daemons + ## do this on signal 1 (SIGHUP). + ## If it does not support it, restart the service if it + ## is running. + + echo -n "Reload service fail2ban " + ## if it supports it: + /sbin/killproc -HUP $FAIL2BAN_BIN + #touch /var/run/fail2ban/fail2ban.pid + rc_status -v + + ## Otherwise: + #$0 try-restart + #rc_status + ;; + reload) + ## Like force-reload, but if daemon does not support + ## signaling, do nothing (!) + + # If it supports signaling: + echo -n "Reload service fail2ban " + /sbin/killproc -HUP $FAIL2BAN_BIN + #touch /var/run/fail2ban/fail2ban.pid + rc_status -v + + ## Otherwise if it does not support reload: + #rc_failed 3 + #rc_status -v + ;; + status) + echo -n "Checking for service fail2ban " + ## Check status with checkproc(8), if process is running + ## checkproc will return with exit status 0. + + # Return value is slightly different for the status command: + # 0 - service up and running + # 1 - service dead, but /var/run/ pid file exists + # 2 - service dead, but /var/lock/ lock file exists + # 3 - service not running (unused) + # 4 - service status unknown :-( + # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) + + # NOTE: checkproc returns LSB compliant status values. + /sbin/checkproc $FAIL2BAN_BIN + # NOTE: rc_status knows that we called this init script with + # "status" option and adapts its messages accordingly. + rc_status -v + ;; + probe) + ## Optional: Probe for the necessity of a reload, print out the + ## argument to this init script which is required for a reload. + ## Note: probe is not (yet) part of LSB (as of 1.9) + + test /etc/fail2ban/fail2ban.conf -nt /var/run/fail2ban/fail2ban.pid && echo reload + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; +esac +rc_exit diff --git a/fail2ban.spec b/fail2ban.spec new file mode 100644 index 0000000..62944fb --- /dev/null +++ b/fail2ban.spec @@ -0,0 +1,108 @@ +# +# spec file for package fail2ban (Version 0.8.3) +# +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + + +Name: fail2ban +License: GPL v2 or later +Group: Productivity/Networking/Security +Requires: python >= 2.5, logrotate, cron +BuildRequires: python-devel +PreReq: %fillup_prereq +AutoReqProv: on +Version: 0.8.3 +Release: 2 +Url: http://www.fail2ban.org/ +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Summary: fail2ban scans log files and bans IP addresses that makes too many failures +Source0: http://download.sourceforge.net/sourceforge/fail2ban/%{name}-%{version}.tar.bz2 +Source1: %{name}.init +Source2: %{name}.sysconfig +# Patch0: fail2ban-0.8.3-config.patch + +%description +fail2ban scans log files like /var/log/messages and bans IP addresses +that makes too many password failures. It updates firewall rules to +reject the IP address, can send e-mails, or set host.deny entries. +These rules can be defined by the user. Fail2Ban can read multiple log +files such as sshd or Apache web server ones. + + + +Authors: +-------- + Cyril Jaquier + +%prep +%setup +# %patch0 -p1 -b _orig +perl -pi -e 's;/usr/local/;/usr/;g' files/suse-initd + +%build +export CFLAGS="$RPM_OPT_FLAGS" +python setup.py build +gzip man/*.1 + +%install +python setup.py install \ + --root=$RPM_BUILD_ROOT \ + --prefix=%{_prefix} +install -d -m755 $RPM_BUILD_ROOT/%{_mandir}/man1 +for i in fail2ban-client fail2ban-regex fail2ban-server; do + install -m644 man/${i}.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1 +done +install -d -m755 $RPM_BUILD_ROOT/%{_sysconfdir}/init.d +install -d -m755 $RPM_BUILD_ROOT/usr/sbin +install -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/%{name} +ln -sf /etc/init.d/%{name} ${RPM_BUILD_ROOT}/usr/sbin/rc%{name} +install -d -m755 $RPM_BUILD_ROOT/var/adm/fillup-templates +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name} + +%post +%{fillup_only} + +%preun +%stop_on_removal %{name} + +%postun +%restart_on_update %{name} +%insserv_cleanup + +%clean +# [ "$RPM_BUILD_ROOT" != "" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; + +%files +%defattr(-, root, root) +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/action.d +%dir %{_sysconfdir}/%{name}/filter.d +%config %{_sysconfdir}/%{name}/*.conf +%config %{_sysconfdir}/%{name}/action.d/*.conf +%config %{_sysconfdir}/%{name}/filter.d/*.conf +%{_sysconfdir}/init.d/%{name} +/usr/bin/%{name}* +/usr/sbin/rc%{name} +/usr/share/%{name} +%dir /var/run/%{name} +/var/adm/fillup-templates/sysconfig.%{name} +%doc %{_mandir}/man1/* +%doc COPYING ChangeLog README TODO files/cacti + +%changelog +* Wed Feb 04 2009 kssingvo@suse.de +- initial version: 0.8.3 diff --git a/fail2ban.sysconfig b/fail2ban.sysconfig new file mode 100644 index 0000000..04a682e --- /dev/null +++ b/fail2ban.sysconfig @@ -0,0 +1,18 @@ +## Path: System/Security/Fail2ban +## Description: fail2ban options +## Type: string +## Default: fail2ban +## ServiceReload: fail2ban +## ServiceRestart: fail2ban +# +IDENT="fail2ban" +## Type: string +## Default: "fail2ban daemon" +DESCRIPTIVE="fail2ban daemon" +## Type: string +## Default: "" +# +# change FAIL2BAN_OPTIONS for arguments of start of cupsd +# e.g. FAIL2BAN_OPTIONS="-c /etc/fail2ban/fail2ban.conf" +FAIL2BAN_OPTIONS="" + diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4