netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Guido Trentalancia <guido@trentalancia.com>
Cc: Jan Engelhardt <ej@inai.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables]: xtables: tolerate DNS lookup failures
Date: Thu, 20 Mar 2025 16:39:40 +0100	[thread overview]
Message-ID: <Z9w2vLdyQfWepMET@orbyte.nwl.cc> (raw)
In-Reply-To: <1741369231.5380.37.camel@trentalancia.com>

On Fri, Mar 07, 2025 at 06:40:31PM +0100, Guido Trentalancia wrote:
> I am not familiar with the application layer tools such as
> NetworkManager.
> 
> The point is that the underlying issue does not change with auxiliary
> tools: I believe iptables should not abort setting up all rules, just
> because one or more of them fail to resolve in DNS.

There is consensus amongst Netfilter developers that skipping rules or
even parts of them when loading a ruleset is a critical flaw in the
software because loaded ruleset behaviour is not deterministic anymore.
The usual security context demands that behaviour is exactly as
requested by the user, any bit flipped could disable the whole security
concept. "We printed a warning" is not an excuse to this.

In order to implement the desired behaviour, just call iptables
individually for each rule and ignore failures. You could also cache IP
addresses, try a new lookup during firewall service startup and fall
back to the cached entry if it fails.

My personal take is this: If a DNS reply is not deterministic, neither
is a rule based on it. If it is, one may well hard-code the lookup
result.

> As already said, if one or more rules fail then those specific hosts
> are most likely unreachable anyway.

No, it just means DNS has failed. The resulting rules use IP addresses
and there is no guarantee these are not reachable. You are making
assumptions based on your use-case, but the proposed behaviour will
affect all use-cases (and there is always that special one ... ;).

Cheers, Phil

  reply	other threads:[~2025-03-20 15:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 13:42 [PATCH iptables]: xtables: tolerate DNS lookup failures Guido Trentalancia
2025-03-07 14:07 ` Jan Engelhardt
2025-03-07 14:48   ` Reindl Harald
2025-03-07 15:31     ` Guido Trentalancia
2025-03-07 19:15       ` Reindl Harald
2025-03-07 19:32         ` Guido Trentalancia
2025-03-07 20:07           ` Reindl Harald
2025-03-07 20:37             ` Guido Trentalancia
2025-03-07 20:48               ` Reindl Harald
2025-03-07 20:58                 ` Guido Trentalancia
2025-03-08 17:35                   ` Jozsef Kadlecsik
2025-03-07 15:24   ` Guido Trentalancia
2025-03-07 15:46     ` Guido Trentalancia
2025-03-07 17:02       ` Jan Engelhardt
2025-03-07 17:15         ` Guido Trentalancia
2025-03-07 16:51     ` Jan Engelhardt
2025-03-07 17:09       ` Guido Trentalancia
2025-03-07 17:21         ` Jan Engelhardt
2025-03-07 17:40           ` Guido Trentalancia
2025-03-20 15:39             ` Phil Sutter [this message]
2025-03-21 11:21               ` Guido Trentalancia
2025-03-21 14:53                 ` Phil Sutter

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=Z9w2vLdyQfWepMET@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=ej@inai.de \
    --cc=guido@trentalancia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).