Koozali.org: home of the SME Server

Autoblock_ssh

Online stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Autoblock_ssh
« on: April 22, 2014, 07:44:15 PM »
Hi all

Just to high light a new feature available in SME9 and waiting a release for SME8 : 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
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline mhr

  • **
  • 24
  • +0/-0
Re: Autoblock_ssh
« Reply #1 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?
...

guest22

Re: Autoblock_ssh
« Reply #2 on: October 14, 2014, 09:52:10 PM »
But is there a (relatively) easy way to whitelist a source IP?


Excellent question!

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: Autoblock_ssh
« Reply #3 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...)
C'est la fin du monde !!! :lol:

Offline mhr

  • **
  • 24
  • +0/-0
Re: Autoblock_ssh
« Reply #4 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!
...

Online stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: Autoblock_ssh
« Reply #5 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.
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: Autoblock_ssh
« Reply #6 on: October 15, 2014, 11:32:15 AM »
AFAIK, there's no whitelist support on the default AutoBlock feature
C'est la fin du monde !!! :lol:

Online stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: Autoblock_ssh
« Reply #7 on: October 15, 2014, 12:41:03 PM »
Even if we had a new network with a flag 'local'
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline Jean-Philippe Pialasse

  • *
  • 2,907
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Autoblock_ssh
« Reply #8 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.

guest22

Re: Autoblock_ssh
« Reply #9 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.

Offline brianr

  • *
  • 990
  • +2/-0
Re: Autoblock_ssh
« Reply #10 on: November 05, 2014, 07:59:12 AM »
<deleted>
« Last Edit: November 05, 2014, 08:01:11 AM by brianr »
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Autoblock_ssh
« Reply #11 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.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Jean-Philippe Pialasse

  • *
  • 2,907
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Autoblock_ssh
« Reply #12 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)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Autoblock_ssh
« Reply #13 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..

Online stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: Autoblock_ssh
« Reply #14 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.
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!