Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: stephdl on April 22, 2014, 07:44:15 PM

Title: Autoblock_ssh
Post by: stephdl on April 22, 2014, 07:44:15 PM
Hi all

Just to high light a new feature available in SME9 (http://bugs.contribs.org/show_bug.cgi?id=8258) and waiting a release for SME8 (http://bugs.contribs.org/show_bug.cgi?id=8257) : Autoblock_ssh
The purpose is to block bad authentication trough ssh, a relevant wiki page is set : http://wiki.contribs.org/AutoBlock#Public_SSH_Acess

It is enabled by default for sme9 and disabled by default for sme8
Title: Re: Autoblock_ssh
Post by: mhr on October 14, 2014, 08:54:13 PM
This is indeed a very welcome feature. Unfortunately I'm not too familiar with iptables to further tweak it. My problem is that I'm using svn over ssh on that box. If I want to display the history, then eg. the diff to the previous revision, I'm already out of connections for 15 minutes. Sure, I can reduce the blocking time to less minutes, and up the hit number somewhat.

But is there a (relatively) easy way to whitelist a source IP?
Title: Re: Autoblock_ssh
Post by: guest22 on October 14, 2014, 09:52:10 PM
But is there a (relatively) easy way to whitelist a source IP?


Excellent question!
Title: Re: Autoblock_ssh
Post by: Daniel B. on October 14, 2014, 11:42:26 PM
If you need more control, I'd advise to disable the default autoblock feature, and instead install the fail2ban contrib. It'll still ban offenders, but only after failed auth attempts, you can manage a whitelist of hosts/network which will never been banned, and it'll also monitor other services (http, imap, ftp etc...)
Title: Re: Autoblock_ssh
Post by: mhr on October 15, 2014, 07:10:04 AM
Heh... I had fail2ban in the browser history. Don't know how I missed it first time! Thanks for the pointer!
Title: Re: Autoblock_ssh
Post by: stephdl on October 15, 2014, 11:30:59 AM
I would be interested on how whitelisted an ip.....do we have to add this ip or network as 'local ip/network' and how we can do that.

I have searched a bit and i saw that 'db networks' is not well documented.
Title: Re: Autoblock_ssh
Post by: Daniel B. on October 15, 2014, 11:32:15 AM
AFAIK, there's no whitelist support on the default AutoBlock feature
Title: Re: Autoblock_ssh
Post by: stephdl on October 15, 2014, 12:41:03 PM
Even if we had a new network with a flag 'local'
Title: Re: Autoblock_ssh
Post by: Jean-Philippe Pialasse on November 05, 2014, 05:15:22 AM
If you only need to defend ssh, I would rather install denyhosts than fail2ban.

you have whitelist options.
Title: Re: Autoblock_ssh
Post by: guest22 on November 05, 2014, 06:31:27 AM
If you only need to defend ssh, I would rather install denyhosts than fail2ban.


We can't test that for the contrib is outdated http://wiki.contribs.org/Denyhosts an not available for SME8 or SME9.
Title: Re: Autoblock_ssh
Post by: brianr on November 05, 2014, 07:59:12 AM
<deleted>
Title: Re: Autoblock_ssh
Post by: janet on November 05, 2014, 12:11:08 PM
stephdl

Why would you want or need this ?

If you configure public private key access (refer Howto), then you can only ssh into your SME server (securely) if you have the correct key, no need for any failed authentication blocking contrib or feature.
Title: Re: Autoblock_ssh
Post by: Jean-Philippe Pialasse on November 05, 2014, 04:49:29 PM
public/private key limit the risk of access, not the risk of burning server ressources due to buteforce attack and DDOS on ssh.

both are important ( no password login and protect from numerous login attempt)
Title: Re: Autoblock_ssh
Post by: Stefano on November 05, 2014, 09:51:30 PM
just put your ssh on a non standard and not common port and you cut 99.9999% of bruteforce attacks..

I have no sign of login attempts on my servers.. and no server is listening on 22..
Title: Re: Autoblock_ssh
Post by: stephdl on November 05, 2014, 10:41:35 PM
just put your ssh on a non standard and not common port and you cut 99.9999% of bruteforce attacks..

I have no sign of login attempts on my servers.. and no server is listening on 22..

Yes that's good for ssh, but for example fail2ban can protect sogo, dovecot, ftp, apache and many other services, but that's not a problem you have simply to remember this service use a non standard port and share it to communicate with friends :)

Software like fail2ban is a must have, and watch about who is attempting to login.
Title: Re: Autoblock_ssh
Post by: Stefano on November 05, 2014, 10:43:59 PM
I was referring to ssh only..

obviously we can't change port of standard services..