LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-30-2014, 03:11 PM   #1
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
fail2ban.log and rsyslog


Using rsyslog on 5.8.6 on my Client, I can't seem to get /var/log/fail2ban.log from the client over to my rsyslogd 7.6.3 Server.

Fail2ban on the client is v0.8.6

in /etc/fail2ban/fail2ban.conf
Code:
# Fail2Ban configuration file
[Definition]
loglevel = 3
logtarget = SYSLOG
syslog-facility = 22
syslog-target = /var/log/fail2ban.log
in /etc/rsyslog.conf I set:
Code:
# 04/30/2014 11:44:50 AM
$ModLoad imfile
# File /var/log/fail2ban.log
$InputFileName /var/log/fail2ban.log
$InputFileTag c9mail_fail2ban
$InputFileStateFile state-fail2ban-entries
$InputFileSeverity severity
$InputFileFacility facility
$InputRunFileMonitor

*.* @<ip>:514
This gives me fail2ban* files on the rsyslog host-server:
Code:
fail2ban.filter.log
fail2ban.jail.log
fail2ban.server.log
But there's no record of any IPs that are banned.
I tried setting one manually using fail2ban-client using
Code:
fail2ban-client set zimbra banip 46.201.148.246
but this barfs with
Code:
WARNING 'socket' not defined in 'Definition'. Using default value
46.201.148.246
I "may" have to wait for fail2ban to do a ban automatically to see /var/log/firewall.log populated.

I have bounced rsyslogd and fail2ban during this time and it has made little difference.

So, is there something I have missed?

Thanks!

Last edited by Habitual; 04-30-2014 at 03:13 PM. Reason: changed subject.
 
Old 04-30-2014, 03:12 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
First thought is permissions.
 
Old 04-30-2014, 03:19 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Thanks.

kernel.log works file, so I compared:
Code:
-rw-r----- 1 root   adm 20834 Apr 30 19:48 /var/log/fail2ban.log
-rw-r----- 1 syslog adm  4818 Apr 30 20:09 /var/log/kern.log
and set:
Code:
-rw-r----- 1 syslog adm 20834 Apr 30 19:48 /var/log/fail2ban.log
-rw-r----- 1 syslog adm  4818 Apr 30 20:09 /var/log/kern.log
and bounced:
I did get a "new" file that I expect to be where I'd see some f2b 'actions' set, fail2ban.actions.log

but it only shows:
Code:
Apr 30 20:17:00 cirrhus9a fail2ban.actions: INFO   Set banTime = 31556926
Apr 30 20:17:00 cirrhus9a fail2ban.actions: INFO   Set banTime = 31556926
Small 'progress' I guess.
 
Old 04-30-2014, 03:25 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Well, its a start anyway! As you are certainly aware, it is best to start at the first step of setup, and work to the end and doublecheck everything, before filing a bug report

What is your rsyslog config of kernel compared to fail2ban?

Do you have selinux enabled? I've had trouble with rsyslog and varnish because of selinux.

Last edited by szboardstretcher; 04-30-2014 at 03:27 PM.
 
Old 04-30-2014, 03:40 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
Well, its a start anyway! As you are certainly aware, it is best to start at the first step of setup, and work to the end and doublecheck everything, before filing a bug report

What is your rsyslog config of kernel compared to fail2ban?

Do you have selinux enabled? I've had trouble with rsyslog and varnish because of selinux.
You edit almost as much as I do!

I set this after comparing to another f2b client I have and noticed these entries missing.
Code:
socket = /var/run/fail2ban/fail2ban.sock
pidfile = /var/run/fail2ban/fail2ban.pid
in /etc/fail2ban/fail2ban.conf and bounced f2b and now I am able to use
Code:
fail2ban-client set zimbra banip 46.201.148.246
without error AND this shows up in fail2ban.actions.log on the rsyslog-server:
Code:
Apr 30 20:35:01 cirrhus9a fail2ban.actions: WARNING [zimbra] Ban 46.201.148.246
It's a Good Day!

Thanks!
 
1 members found this post helpful.
Old 04-30-2014, 03:43 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
I probably over-edit. But it seems like after I reply, i have more ideas... :/ Im slow like that.

Wonderful my friend, glad it worked out. Thanks for posting the solution!

On another note, I used zimbra for a minute, but ended up using Zentyal community instead. Here is a link:

http://www.zentyal.org/

Very nice SBS with good AD compatibility.

Last edited by szboardstretcher; 04-30-2014 at 03:44 PM.
 
Old 04-30-2014, 03:52 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
I probably over-edit. But it seems like after I reply, i have more ideas... :/ Im slow like that.
Me too.
I have 3 brain cells left and 2 are fighting at the moment.
Once the remaining one calls "timeout", then I have a chance to think and re-edit.

Plus, I don't get of the terminal much, so I don't communicate with people too well.

It's hard for me to communicate to others in simplistic terms what the issue is.
My brain goes full throttle 24/7/365

Peace.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Failing to save iptables log to a custom file yzT! Linux - Security 2 02-16-2014 04:09 AM
[SOLVED] How to save the output to a log file without wiping the previous contents greatcz Linux - Newbie 2 07-25-2010 10:14 AM
[SOLVED] Add existing unix user to existing LDAP antoniemail Linux - Server 7 06-23-2010 12:54 PM
how to add existing files to existing imported kdevelop project?? santana Programming 1 05-22-2007 09:53 AM
IPTABLES how to add/edit/delete rules in existing chain? debug019 Linux - Newbie 1 11-11-2004 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration