All of lore.kernel.org
 help / color / mirror / Atom feed
From: trentbuck@gmail.com (Trent W. Buck)
To: netfilter@vger.kernel.org
Subject: Re: One more application available for nftables
Date: Mon, 18 Nov 2019 13:43:32 +1100	[thread overview]
Message-ID: <87v9rhdhuz.fsf@goll.lan> (raw)
In-Reply-To: b5512a97bad28c14e57ebf2f92c12f27@mailtower.de

Matt <matt-nft@mailtower.de> writes:

> I'd like to announce a new application which runs on nftables,
> I've named it "fail2nft".
> https://coolscript.org/index.php/Fail2nft

Here's my quick review as a non-expert bystander.
(This is a critique of the code, NOT the author!)

That page needs a section "why choose fail2nft over existing products?" :-)

 * sshguard is lex/yacc (C) that reads logs journal/syslog/NCSA
   and runs a helper script to add/remove block rules.
   Adding new match rules requires a recompile.
   It blocks everything by default (on Debian, via nftables).

   https://bitbucket.org/sshguard/sshguard/src/master/src/fw/sshg-fw-nft-sets.sh

   It's about 2KLOC (slightly bigger than fail2nft).

 * fail2ban is python and uses regular expressions to look for attacks.
   It's configured via a huge mess of .ini files.
   It blocks nothing (except SSH?) by default (on Debian, via xtables).

   https://github.com/fail2ban/fail2ban/blob/0.11/config/action.d/nftables.conf

   It's about 17KLOC (much bigger than fail2nft).

perlcritic (a.k.a. "use criticism;") was very unhappy about
https://coolscript.org/download/fail2nft-installer.pl and
https://coolscript.org/download/fail2nft.tar.gz:usr/local/fail2nft/fail2nft.pl

I recommend fixing pretty much everything perlcritic complains about.
(note that by default, it only emits "high severity" complaints.)

I recommend making fail2nft's git (or whatever VCS) repo publicly
visible, and having versioned release tarballs
(fail2nft-0.9.tar.gz, not fail2nft.tar.gz).


The persistence across reboots via sqlite is interesting.


I haven't nitpicked your
usr/local/fail2nft/install/usr/sbin/nftinit-*.nft in detail.
The overall style looks reasonable.

I suggest explicitly putting "fail2nft" in your table/chain names, and
running them at "priority filter - 5" or so (i.e. before the default
"priority filter").  At that point, your fail2nft table can do nothing
but drop attacker sets, and all the normal rules can live somewhere else.
(See the sshguard link above for an example.)

I know your index.php says it's not for routers yet, but I *strongly*
recommend you hook into INPUT *and* FORWARD, where currently you only
hook into INPUT.  This will handle the easy 80% of routers in only a
couple of extra lines.

I see you're matching vsftpd.  I very very strongly recommend
you... encourage your end users to switch from FTP to SFTP.  :-)
(Many (most?) Windows FTP clients can do SFTP these days.)


  reply	other threads:[~2019-11-18  2:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 14:55 Cannot add ip6 elements to a named set Matt
2019-10-04 14:58 ` Florian Westphal
2019-10-04 15:14   ` minor change recommendation for https://wiki.nftables.org Matt
2019-11-14 19:40 ` One more application available for nftables Matt
2019-11-18  2:43   ` Trent W. Buck [this message]
2019-11-19  8:36     ` Alessandro Vesely
2019-11-20 16:41     ` zrm
2019-11-21  3:04       ` Trent W. Buck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9rhdhuz.fsf@goll.lan \
    --to=trentbuck@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.