Re: Blocking packets from suspicious ports

Willy Tarreau <w@1wt.eu> Wed, 04 May 2022 08:23 UTC

Return-Path: <w@1wt.eu>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B07F7C157B3E for <quic@ietfa.amsl.com>; Wed, 4 May 2022 01:23:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_PASS=-0.001] autolearn=unavailable autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LQe59ebR1oIE for <quic@ietfa.amsl.com>; Wed, 4 May 2022 01:23:28 -0700 (PDT)
Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by ietfa.amsl.com (Postfix) with ESMTP id B4554C157B49 for <quic@ietf.org>; Wed, 4 May 2022 01:23:27 -0700 (PDT)
Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 2448NJFD026376; Wed, 4 May 2022 10:23:19 +0200
Date: Wed, 04 May 2022 10:23:19 +0200
From: Willy Tarreau <w@1wt.eu>
To: Carsten Bormann <cabo@tzi.org>
Cc: Christian Huitema <huitema@huitema.net>, Paul Vixie <paul=40redbarn.org@dmarc.ietf.org>, IETF QUIC WG <quic@ietf.org>
Subject: Re: Blocking packets from suspicious ports
Message-ID: <20220504082319.GD26036@1wt.eu>
References: <6830cf87-e1b6-14bb-7b10-9341fdb6d941@huitema.net> <1b686f1e-912d-5c02-cf5f-a8afbdd924bb@redbarn.org> <20220503032335.GB20878@1wt.eu> <e8c90e2b-e0f1-82ca-8243-2b41412de513@huitema.net> <20220504040937.GA25251@1wt.eu> <c29d88ab-20f2-45d3-6398-bbc5be8e7246@huitema.net> <20220504065344.GA26036@1wt.eu> <098A8520-0935-4D13-875C-97EBB50CB347@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <098A8520-0935-4D13-875C-97EBB50CB347@tzi.org>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/A3sU3qZ_Y5eQhS3fkX3KKtuGA4c>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 May 2022 08:23:29 -0000

On Wed, May 04, 2022 at 09:48:52AM +0200, Carsten Bormann wrote:
> On 4. May 2022, at 08:53, Willy Tarreau <w@1wt.eu> wrote:
> > 
> > [...] This has
> > contributed to making active FTP unpopular, and nowadays it has become
> > safe to block SYN from sources < 1024 at the edge. UDP doesn't have such
> > a thing as a SYN flag and it's critical that traffic cannot be made
> > symmetrical, or there's no more infrastructure filtering and only
> > application level filtering.
> 
> Instead of collecting wafting lists of undesirable ports, would it make sense
> to more architecturally partition port numbers between those used by servers
> and those used by clients?

That's the point, and that has been done for more than 40 years now
by having unprivileged users only select ports >= 1024, resulting in
the range 1024:65535 being commonly used as the only valid source
range for incoming connections.

> Outside of specific applications (that could do with specific port number
> lists), we used to use ephemeral ports for clients, but not for servers.

Ephemeral ports also exist for passive FTP servers: the server binds to a
random port and advertises that port to the client which then connects to
it. But that's a marginal use case, as in general you want a server to run
on a well-known, or at least easily discoverable port.

> If servers predominantly reflect on their server ports, and server ports
> don't reach victim server ports, that would be a win.

Yes, that's the point, and on TCP you will rarely find a firewall that
lets you establish a connection to a port 80/443 from a similar port,
precisely due to the principle above that regular clients are not
supposed to use more than 1024:65535.

Regards,
Willy