From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 06:52:30 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B790106564A for ; Thu, 18 Sep 2008 06:52:30 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 200B28FC18 for ; Thu, 18 Sep 2008 06:52:29 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id m8I6qJqQ056364; Thu, 18 Sep 2008 07:52:20 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.7.1 smtp.infracaninophile.co.uk m8I6qJqQ056364 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1221720741; bh=DJ7usje9KoFD7T rcmGZt9IlIVD4rxETg09L+V4i52QE=; h=Message-ID:Date:From:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Cc:Content-Type: Date:From:In-Reply-To:Message-ID:Mime-Version:References:To; z=Mes sage-ID:=20<48D1FA96.2080406@infracaninophile.co.uk>|Date:=20Thu,=2 018=20Sep=202008=2007:52:06=20+0100|From:=20Matthew=20Seaman=20|Organization:=20Infracaninophile|User -Agent:=20Thunderbird=202.0.0.16=20(X11/20080726)|MIME-Version:=201 .0|To:=20Nathan=20Lay=20|CC:=20"Marc=20G.=20Four nier"=20,=20freebsd-questions@freebsd.org|Subject: =20Re:=20Auto=20blacklist=20ssh=20connections=20...|References:=20< 14143EECEC1CC52A4BC39AC3@ganymede.hub.org>=20<48D1C3CA.30309@comcas t.net>|In-Reply-To:=20<48D1C3CA.30309@comcast.net>|X-Enigmail-Versi on:=200.95.6|Content-Type:=20multipart/signed=3B=20micalg=3Dpgp-sha 256=3B=0D=0A=20protocol=3D"application/pgp-signature"=3B=0D=0A=20bo undary=3D"------------enigADBA50EBB425DB9AB324B3CC"; b=O1hPj5wAOfh9 9wDTa2SGoHD5ipTBd5kS0pY15Vt67mcp8KoZ+pf0PYnJiE70c81CMtQeQSiyHcJ4DRy aAckT/uyJWAF9blIU5DghP/DqGds724Bqu1pd8UJeRr+nZpodBaFB/2pOabfkc0lR6v CYnMZ42s9HvS/FnnjuKa4kEEI= Message-ID: <48D1FA96.2080406@infracaninophile.co.uk> Date: Thu, 18 Sep 2008 07:52:06 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.16 (X11/20080726) MIME-Version: 1.0 To: Nathan Lay References: <14143EECEC1CC52A4BC39AC3@ganymede.hub.org> <48D1C3CA.30309@comcast.net> In-Reply-To: <48D1C3CA.30309@comcast.net> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigADBA50EBB425DB9AB324B3CC" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Thu, 18 Sep 2008 07:52:21 +0100 (BST) X-Virus-Scanned: ClamAV 0.93.3/8275/Thu Sep 18 02:16:55 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: "Marc G. Fournier" , freebsd-questions@freebsd.org Subject: Re: Auto blacklist ssh connections ... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 06:52:30 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigADBA50EBB425DB9AB324B3CC Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Nathan Lay wrote: > I employed this solution: > http://johan.fredin.info/openbsd/block_ssh_bruteforce.html >=20 > You have to enable pf, but man it works and it works well! Agreed. I use a slight modification of this configuration on a number of firewalls. As specified in the page referenced above, the rule set causes /any/ too-rapid spate of SSH connections to get you locked out, and that includes legitimate users too. Simple=20 modification is to add a whitelist table for addresses that you never want to lock out: table const { \ 12.34.56.78 \ ... \ } persist table persist [...] block drop in log quick on $ext_if from [...] pass in on $ext_if proto tcp \ from ! to $ext_if port ssh \ flags S/SA keep state \ (max-src-conn-rate 3/30, overload flush global) pass in on $ext_if proto tcp \ from to $ext_if port ssh \ flags S/SA keep state Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enigADBA50EBB425DB9AB324B3CC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkjR+qMACgkQ8Mjk52CukIySMwCggOBspALMFCTH/81hWDQZ88+S M3wAn2jvb3+AIlNCPyoOsKVkwrJQrobS =ClgD -----END PGP SIGNATURE----- --------------enigADBA50EBB425DB9AB324B3CC--