All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Christoph Anton Mitterer <calestyo@scientia.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: nftables.service hardening ideas
Date: Fri, 31 Oct 2025 00:10:52 +0100	[thread overview]
Message-ID: <aQPwcOW3X-4OGuiq@strlen.de> (raw)
In-Reply-To: <7c3760d6afad70f7579311022748363f7d5f5c77.camel@scientia.org>

Christoph Anton Mitterer <calestyo@scientia.org> wrote:
> Hey.
> 
> On Tue, 2025-10-28 at 17:26 +0100, Florian Westphal wrote:
> > Christoph Anton Mitterer <calestyo@scientia.org> wrote:
> > > This would be ideas about further hardening nftables.service,
> > > primarily
> > > using the options from systemd.exec(5).
> > 
> > Whats the point?  nft will exit anyway.
> 
> Uhm... well the point of any sandboxing is always (at least trying to)
> prevent any attacks.

Sure, but then we're talking about e.g. bug in dns resolver/parser
or something like that.

In general I don't believe Linux is capable of isolating against
abusing userspace, unfortunately.  Especially with CAP_NET_ADMIN
(which is very broad and provides access to many facilities in
 the kernel) or with unprivilged user namespaces enabled (the default,
sigh).

> Sure, nftables is probably not the most likely program to be abused (in
> particular as it usually won't process untrusted input), but still even
> nftables can't be 100% sure to never be abused in something like
> secretly included malware or so.

In that case I think all bets are of.

> As with the first patchset my idea was simply that *if* a .service file
> is shared it could as well be proper and use as many sandboxing options
> from systemd as possible, serving as and example for e.g. downstream
> versions of such .service.

Ok, if you want then feel free to start to send patches.
(and CC Jan).

I think that enabling CAP_NET_ADMIN restriction is fine,
otoh if you think that this should be done then I believe
its better to patch nft and not rely on systemd for this.

  reply	other threads:[~2025-10-30 23:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27  3:36 nftables.service hardening ideas Christoph Anton Mitterer
2025-10-28 16:26 ` Florian Westphal
2025-10-29  0:55   ` Christoph Anton Mitterer
2025-10-30 23:10     ` Florian Westphal [this message]
2025-10-30 23:59       ` Christoph Anton Mitterer
2025-10-30 23:30 ` Pablo Neira Ayuso
2025-10-30 23:59   ` Christoph Anton Mitterer

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=aQPwcOW3X-4OGuiq@strlen.de \
    --to=fw@strlen.de \
    --cc=calestyo@scientia.org \
    --cc=netfilter-devel@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.