Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301139 - net-analyzer/fail2ban-0.8.4: logrotate script purges fail2ban chains from iptables when run.
Summary: net-analyzer/fail2ban-0.8.4: logrotate script purges fail2ban chains from ipt...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement with 1 vote (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 21:13 UTC by Harley Peters
Modified: 2010-11-05 15:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harley Peters 2010-01-15 21:13:52 UTC
When the included logrotate script is used it will purge the chains created by fail2ban from iptables. (remove all banned ip addresses.)

The line:
/usr/bin/fail2ban-client reload 1>/dev/null || true

Should be changed to:
/usr/bin/fail2ban-client set logtarget /var/log/fail2ban.log 1>/dev/null || true

In the case of fail2ban reload does more than just reload the config.


Reproducible: Always

Steps to Reproduce:
1.Install fail2ban.
2.Enable some rules.
3.Confirm fail2ban has banned some ip's.
4.Monitor when the log file is rotated by logrotate and watch your banned ip's get removed from iptables.

Actual Results:  
All banned ip's get removed when log file is rotated.

Expected Results:  
Log file should get rotated without removing banned ip's from iptables.
Comment 1 Michael Kefeder 2010-05-18 05:11:50 UTC
I can confirm this problem, and that the proposed fix works.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2010-11-05 15:01:28 UTC
+*fail2ban-0.8.4-r1 (05 Nov 2010)
+
+  05 Nov 2010; Markos Chandras <hwoarang@gentoo.org>
+  +files/fail2ban-0.8.4-hashlib.patch, files/fail2ban-logrotate,
+  +fail2ban-0.8.4-r1.ebuild, +files/fail2ban-0.8.4-sshd-breakin.patch:
+  Bugfix revision. Fixes bug 260337,283629,301139,315073,343955. Thanks to
+  Robert Trace <bugzilla-gentoo@farcaster.org>, Harley Peters
+  <harley@thepetersclan.com> for the patches.
+