Commit Graph

101 Commits (b185e7cb04206aac48f33414685f4d54662dfdf0)

Author SHA1 Message Date
sebres e3b061e94b - `files/fail2ban.service` renamed as template to `files/fail2ban.service.in`;
- setup process generates `build/fail2ban.service` from `files/fail2ban.service.in` using distribution related bin-path;
- bug-fixing by running setup with option `--dry-run` (note: specify option `--dry-run` before `install`, like `python setup.py --dry-run install`);
- test cases extended to cover dry-run.
2017-08-23 13:01:29 +02:00
sebres 1a562bed0f Merge remote-tracking branch 'master' into 0.10
# Conflicts:
#	config/filter.d/asterisk.conf
2017-07-19 08:57:23 +02:00
Serg G. Brester 99b668a3cc Merge pull request #1390 from khumarahn/xxx
ensure /var/run/fail2ban is created in systemd service file
2017-07-11 15:53:42 +02:00
oliverdorn 4a65e069e1 Solution for issue #1665
Solves the issue of authentic GoogleBots being banned by apache-fakegooglebots.
2017-01-13 08:59:45 +01:00
Hank Leininger 9fbf713d7d
Wait up to 30 seconds on "stop" to avoid errors.
The fail2ban server can take several seconds to shut down.  This can
make Gentoo's start-stop-service time out and decide that stopping has
failed, even if it actually succeeds a few seconds later.

The default timeout for start-stop-service if --retry is not specified
appears to be 5 seconds.  Increase that to 30 seconds to be sure that if
fail2ban-server is going to be able to stop, it has time to do so.
2016-12-28 11:14:32 -05:00
sebres 45174c5eaf if fail2ban running as systemd-service, for logging to the systemd-journal, the `logtarget` could be set to STDOUT
small fixes by logging in stdout (+ system targets also allowed in lowercase now)
2016-11-24 12:13:47 +01:00
sebres 1cd67ecaa2 automatically creates /var/run/fail2ban before start fail2ban (systems which /var/run/ is virtual resp. memory mount device) 2016-11-24 11:37:18 +01:00
sebres 528a7a5abb systemd service update:
- starting service in normal mode (without forking)
- does not restart if service exited normally (exit-code 0, e.g. stopped via fail2ban-client)
- does not restart if service can not start (exit-code 255, e.g. wrong configuration, etc.)
- service can be additionally started/stopped with commands (fail2ban-client, fail2ban-server)
2016-11-22 11:14:27 +01:00
Viktor Szépe a406c6eb3a By the author:
> Yes, scripting is not supported in path.

https://bitbucket.org/tildeslash/monit/issues/372/webadmin-shows-only-the-first-part-of#comment-27946048
2016-09-22 20:29:26 +00:00
sebres 932708de9e fixed --pidfile bug, introduced in gh-1322:
gentoo-initd fixed --pidfile bug: `--pidfile` is option of start-stop-daemon, not argument of fail2ban (see gh-1434)
closes gh-1434
2016-05-20 11:01:00 +02:00
Alexey Korepanov 5773eb71b8 ensure /var/run/fail2ban is created in systemd service file 2016-04-12 21:20:19 +01:00
Jack Suter fb779a78c5 gentoo-initd: Use start-stop-daemon in order to handle crashes better
Currently, if fail2ban is killed (or crashes), its status will be
reported by '/etc/init.d/fail2ban status' as 'running' even though it
is not. Attempting to restart the service also fails, because Gentoo
unsuccessfully tries to stop the service.

By using start-stop-daemon and providing a pidfile, Gentoo will
instead report the status as 'crashed' and allow the service to be
restarted as normal.
2016-02-16 01:46:27 -05:00
Yaroslav Halchenko 3dc57af19c Merge branch 'logrotate' of https://github.com/sbraz/fail2ban
* 'logrotate' of https://github.com/sbraz/fail2ban:
  Remove compression and count from logrotate
2016-02-10 18:41:01 -05:00
Louis Sautier 869d99dd37
Remove compression and count from logrotate
Initially reported at https://bugs.gentoo.org/show_bug.cgi?id=549856
2016-01-29 00:15:48 +01:00
Louis Sautier 294a7790a9
gentoo-initd: do not hide useful output
Gentoo applies a patch for this: https://bugs.gentoo.org/show_bug.cgi?id=536320
2016-01-28 23:40:36 +01:00
Yaroslav Halchenko 9f15d02910 Merge pull request #1251 from fastest963/master
Added PartOf to service file so f2b restarts when deps do
2015-12-18 09:21:43 -05:00
sarneaud 5b88a84fe8 Small fixes for Gentoo initd script
These fixes are pretty pedantic, but they do simplify the script a
little.

* Checking the existence of a file/directory before creating/deleting
  it adds complexity and raciness.  There are better options.
* mkdir -p does the job of making sure a directory exists.  (It only
  fails if there's a filesystem error or something.)
* Likewise, rm -f doesn't fail if the file doesn't exist.
* rm -r isn't neccessary because the socket shouldn't be a directory.
  (If it is for some reason, that should be an error.)
2015-11-28 15:03:09 +11:00
James Hartig 9905396eb8 Added PartOf to service file so f2b restarts when deps do 2015-11-11 23:10:35 -05:00
Paul Menzel 078e2048f2 files: Strip trailing whitespace from files
Run the command `StripWhitespace` from the [Vim Better Whitespace
Plugin](https://github.com/ntpeters/vim-better-whitespace).
2015-10-08 16:18:08 +02:00
Ville Skyttä 67a94733a9 logrotate: Do not rotate empty logs
As a useful side effect, prevents "Unable to contact server. Is it
running?" mails from cron when fail2ban hasn't been (intentionally)
running nor thus logging anything either.
2015-09-13 11:05:33 +03:00
Ville Skyttä 63c7ceb81d logrotate: Remove outdated Fedora comment 2015-09-13 10:57:51 +03:00
Edward Beckett 03460d5ed0 Update gen_badbots
Added plus char to the regex for escaping user-agent strings.
2015-09-06 01:05:52 -04:00
Yaroslav Halchenko c96415da27 added $named and ufw to debian-initd (Debian bug #776572) 2015-01-29 08:32:20 -05:00
Yaroslav Halchenko d65c4f8f5d moved debian's initd file to files/debian-initd from debian branch 2014-12-30 16:45:35 -05:00
Viktor Szépe 971c3d93fe Monit config
Copy it to `/etc/monit/monitrc.d/fail2ban`
More info: https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/monit-debian-setup.sh#L113
2014-12-24 14:45:48 +01:00
Yaroslav Halchenko caa851e5c8 RF: moving logwatch setup/sample logs under files/logwatch 2014-09-14 09:48:14 -04:00
Yaroslav Halchenko 2a51a0176a BF: minor type for delignoreregex in bash completions 2014-06-10 03:42:07 -04:00
Cameron Norman 2a14e48f0b A few final touches on the Upstart job
(a) use static-network-up, since it is more generic than the started networking event
(b) do not hook into network deconfiguration to speed up shutdown
(c) expect fork, per the use of the "-f" option
(d) use a variable for the run directory to make changing it simpler
(e) handle the situation of a left over socket file
(f) use the -f option to be able to track the PID
2014-04-22 21:55:51 -07:00
Cameron Norman 39ad5b7474 Update Upstart job: uses stop command in pre-stop, removes PID file in post-stop 2014-04-19 15:10:19 -07:00
Cameron Norman 0ef5027234 Change Upstart job to track PID of the server
This only works correctly if the client does not fork itself when starting the server (which forks twice further).
2014-04-19 14:12:20 -07:00
Cameron Norman 0c8e72f452 Update fail2ban.upstart
No longer directly exec the server, do not remove the PID file because it is unnecessary to do so. No longer respawns because Upstart can not track the process with the starter command.
2014-04-11 17:09:08 -07:00
Cameron Norman 4115b62a01 Update fail2ban.upstart
It was actually a little problematic :)
2014-04-11 16:49:56 -07:00
Cameron Norman 5e3f5db8b7 Create fail2ban.upstart
Add Upstart job.
2014-04-11 08:50:55 -07:00
Ruben Kerkhof ebed0d23c9 Add documentation link to systemd service file
So systemctl help fail2ban.service works

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2014-03-24 14:20:49 +00:00
Steven Hiscocks c7c203964c ENH: Add iptables and firewalld to "After" for systemd service file.
Also remove no longer supported syslog.target.
Closes #658
2014-03-22 17:28:49 +00:00
Steven Hiscocks a9b9c6ea03 Merge branch 'logging' into 0.9
Conflicts:
	fail2ban/server/actions.py
                jail getName()->name
	fail2ban/server/filter.py
                jail getName()->name
2014-02-23 23:03:56 +00:00
Steven Hiscocks 212d05dc0b ENH: Add action elements to bash-completion 2014-02-22 16:57:21 +00:00
Steven Hiscocks 5630c56c75 ENH: Change logging levels and make info more verbose 2014-02-20 23:01:40 +00:00
Daniel Black 3ee6e993c6 MRG: merge ChangeLog for nagios fix 2014-01-06 22:09:10 +11:00
alasdairdc 5428f5bbc3 Update check_fail2ban
Removed unnecessary reference to as yet undeclared $jail_name when checking a specific jail.
2014-01-06 10:43:32 +00:00
Daniel Black b5b581555c BF: nagios fix 2014-01-03 19:56:49 +11:00
alasdairdc 2e5a2b26fb Updated check_fail2ban to return performance data for all jails and applied to specific jail code 2013-12-17 17:48:19 +00:00
alasdairdc 5f623596ee Updated check_fail2ban to return performance data for all jails
Allows perf data from all jails to enable pnp4nagios to display a chart per jail when run with the command:
check_fail2ban -p -w 1 -c 5 -P /usr/bin/fail2ban-client

sample output:
CHECK FAIL2BAN ACTIVITY - CRITICAL - 9 detected jails with 5 current banned IP(s) | apache-noscript.currentBannedIP=0 sendmail.currentBannedIP=0 postfix.currentBannedIP=0 ssh-probe.currentBannedIP=3 ssh-ddos.currentBannedIP=0 apache-multiport.currentBannedIP=0 apache.currentBannedIP=0 ssh.currentBannedIP=2 apache-overflows.currentBannedIP=0
2013-12-17 17:45:50 +00:00
Daniel Black e30c80e468 Merge pull request #478 from grooverdan/fedora-initscript-fix
BF: files/redhat-initd from upstream
2013-12-08 15:00:43 -08:00
Daniel Black 008952035d BF: files/redhat-initd - as per http://pkgs.fedoraproject.org/cgit/fail2ban.git/tree/fail2ban-init.patch 2013-12-06 08:08:11 +11:00
Daniel Black b5d6310d28 BF: create flushlogs command to prevent logrotation clobbering logtarget. Closes gh-458 2013-12-04 20:51:30 +11:00
Yaroslav Halchenko 6f321068f1 NF: gen_badbots script to (re)generate/update config/filter.d/apache-badbots.conf 2013-11-07 14:25:57 -08:00
Yaroslav Halchenko f1487bfb74 Merge pull request #240 from jpmx/master
bug fixed on redhat-initd

per @opoplawski  blessing
2013-08-31 06:57:42 -07:00
Orion Poplawski 67497db6e5 Change /tmp/fail2ban.sock to /var/run/fail2ban/fail2ban.sock 2013-08-08 20:28:55 -06:00
JP Espinosa 32b271c36e Update redhat-initd
- Using `-x` to remove previous socket on start
- Using Should- to wait for iptables and wrappers
2013-06-03 12:34:47 -04:00