Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2016, 02:19 PM   #1
Guyverix
Member
Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.
 
Posts: 13
Karma: 8624
Join Date: Dec 2012
Location: Washington
Device: Kindle Fire, Kindle Touch, Kindle App
Basic fail2ban configuration

Lately I have been getting hit pretty hard by random IP's attempting to get into my server. I have written a BASIC fail2ban config file and thought I would share it for other users who are running the Calibre webserver with authentication enabled. Only special thing to note is the second block that has the destination file for the webserver logs. I have it showing USER, that will need to be changed for your Linux installation.

I hope this will be useful for someone else out there..

Code:
/etc/fail2ban/filter.d/calibre.conf 

# Fail2Ban filter for calibre Web server with Authentication enabled
#

[INCLUDES]

# Read common prefixes. If any customizations available -- read them from
# common.local
before = common.conf


[Definition]

_daemon = calibre

#EXAMPLE MATCHES:                                                                                      
#182.18.42.147 - - [09/Jan/2016:15:08:19] "GET /manager/html HTTP/1.1" 401 726 "" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"
#80.65.51.221 - - [10/Jan/2016:09:02:03] "PUT / HTTP/1.0" 401 739 "" ""
#80.65.51.221 - - [10/Jan/2016:09:02:03] "POST / HTTP/1.0" 401 739 "" ""

#failregex = authProcessClientMessage: authentication failed from <HOST>$
failregex = ^<HOST> - - .*."POST.*." 401 .*$
            ^<HOST> - - .*."GET.*." 401 .*$
            ^<HOST> - - .*."PUT.*." 401 .*$

ignoreregex =

# Author: Guyverix
Code:
/etc/fail2ban/jail.local

[calibre]
enabled  = true
port     = 8080
filter   = calibre
logpath  = /home/<USER>/.config/calibre/server_access_log.txt
maxretry = 3
Guyverix is offline   Reply With Quote
Old 01-10-2016, 02:33 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I do dearly hope you also have remote password-based login disabled in favor of SSH keys.
eschwartz is offline   Reply With Quote
Advert
Old 01-15-2016, 01:11 PM   #3
Guyverix
Member
Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.Guyverix shines like a glazed doughnut.
 
Posts: 13
Karma: 8624
Join Date: Dec 2012
Location: Washington
Device: Kindle Fire, Kindle Touch, Kindle App
Quote:
Originally Posted by eschwartz View Post
I do dearly hope you also have remote password-based login disabled in favor of SSH keys.
Whitelisted IP address ranges actually. I only ssh in from a few places.
Guyverix is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen background color 2014 Kindle basic vs 2013 basic bounce Amazon Kindle 1 01-08-2015 03:50 PM
Tiles Configuration JSWolf Kobo Reader 6 12-09-2014 02:11 PM
360 Plus Configuration of fbreader180 unkilbeeg PocketBook 2 10-24-2012 07:12 PM
REALLY basic, basic, basic questions MrB Amazon Kindle 3 10-22-2012 06:43 AM
Configuration Files KLStringer Calibre 14 02-23-2011 12:01 AM


All times are GMT -4. The time now is 08:14 AM.


MobileRead.com is a privately owned, operated and funded community.