LinuxQuestions.org
Review your favorite Linux distribution.
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 03-24-2014, 03:04 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
apache log file issue with fail2ban


Brief history, had fail2ban working for a number of years, but new server, new apache and problems. Note, its working for other services, ftp, ssh etc but apache is proving stubborn.

The extract from my error log is:
Code:
[Mon Mar 24 18:29:45.307161 2014] [auth_basic:error] [pid 25683:tid 139705060378368] [client 212.159.xxx.yyy:51592] AH01618: user  not found: /members/index2.htm
Previous server/apache would have shown:
Code:
[Mon Mar 24 17:17:44 2014] [error] [client 212.159.xxx.yyy] user  not found: /members/index.htm
fail2ban simply doesnt pick anything up, I've tried running:
Code:
fail2ban-regex /var/logfilelocation "[[]client <HOST>[]] user .* not found"
and it doesnt pick anything up, this is straight from the apache-auth.conf file

Note, when I copy the old style log and run the same test, it picks up ok, so I'm guessing I need a modified search string, any help?
 
Old 03-24-2014, 03:54 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Since the mod_auth_basic code actually prints
Code:
AH01618: user %s not found: %s"
I made it:
Code:
fail2ban-regex /var/log/file '\[client <HOST>:.*\] .*: user .* not found: .*'
which works for me.
 
1 members found this post helpful.
Old 03-24-2014, 05:30 PM   #3
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Original Poster
Rep: Reputation: 32
So...

From the apache-auth.conf file, I could effectively remove:


Code:
failregex = ^%(_apache_error_client)s user .* (authentication failure|not found|password mism
atch)\s*$
and replace with:
Code:
failregex = \[client <HOST>:.*\] .*: user .* not found: .*
            \[client <HOST>:.*\] .*: user .* authentication failure: .*
            \[client <HOST>:.*\] .*: user .* password mismatch: .*
 
  


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
Fail2ban Log NotAComputerGuy Linux - Security 7 01-10-2013 07:17 PM
Fail2ban.log error. Havnt had before. :S dirtydog7655 Linux - Software 1 02-24-2011 03:55 PM
[SOLVED] Configuring Conky to read log file entries - apache + fail2ban djsmiley2k Linux - Desktop 1 04-26-2010 04:29 AM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 04:14 PM
Apache Proxy log issue knarfling Linux - Server 2 12-20-2007 08:57 PM

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

All times are GMT -5. The time now is 05:42 PM.

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