From patchwork Tue Aug 25 13:29:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 10164 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4hTpZ34ddHz3wqC for ; Tue, 25 Aug 2026 13:30:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE1" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4hTpYv1LlSz7cW for ; Tue, 25 Aug 2026 13:30:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4hTpYR6kFZz36W8 for ; Tue, 25 Aug 2026 13:30:03 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4hTpYP3HHfz2xKC for ; Tue, 25 Aug 2026 13:30:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4hTpYC2BVBz4l5 for ; Tue, 25 Aug 2026 13:29:50 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1787664592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHIheg9N7FRlzfERLUVdzPyKcudFf468qefe0VI6QZ4=; b=lNdnT/yYksGkVu4EDcuKbaAcXw1VcPq2j1xYKJsXKGAIgVoUt0q7cJRqxtry7YwasvJtvZ XxeOh0sRnaT2ypAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1787664592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHIheg9N7FRlzfERLUVdzPyKcudFf468qefe0VI6QZ4=; b=v2qhZblbJppmtp0u0UvvYJhNn6HBfwRqV6509HRb+p1oOfiU5vaMae2SYU9T3xvo1xJnky /taWoAw5FacieMstUIbZk7NuanKY+B/YzRoaYQ/x1ecxT2X7pmFhLs/aa/k42apRh60o/j KiBfpbQAkklk9zQsFDut73RrLU/Y6IkT/WQ3yCAZEGnsHhWbYizq1QndG/RaXCfLsOLlLr 61y4ctrUZg3ftFDUtX46lUpyuRhzE4wHWAaYxfZwhKBDr19WZbjxMh40+H6Y1klTVZWjxN 8XQCirEtJtlKi3yCYti7EWMWZ9br7N48Yeowfqh0qlj4hS14HB7nLxdv4VoAOQ== Message-ID: <8455e819-c886-45e5-88c7-d4c47e941df5@ipfire.org> Date: Tue, 25 Aug 2026 13:29:00 +0000 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] firewall: Restrict outgoing network access for Knot to DNS-related ports Since Knot and the RPZ zone sync tool only need access to destination ports 53 (UDP + TCP) or 853 (TCP) in case of DNS over TLS, keep their firewall rules constrained to these ports. Signed-off-by: Peter Müller --- src/initscripts/system/firewall | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall index a97758dc3..c7627bcab 100644 --- a/src/initscripts/system/firewall +++ b/src/initscripts/system/firewall @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2022 IPFire Team # +# Copyright (C) 2007-2026 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -443,7 +443,9 @@ iptables_init() { /usr/local/bin/captivectrl # Grant Knot Resolver access - iptables -A LOCAL_OUTPUT -m owner --uid-owner knot-resolver -j ACCEPT + iptables -A LOCAL_OUTPUT -m owner --uid-owner knot-resolver -p udp --dport 53 -j ACCEPT + iptables -A LOCAL_OUTPUT -m owner --uid-owner knot-resolver -p tcp --dport 53 -j ACCEPT + iptables -A LOCAL_OUTPUT -m owner --uid-owner knot-resolver -p tcp --dport 853 -j ACCEPT # If a Tor relay is enabled apply firewall rules if [ "${TOR_RELAY_ENABLED}" = "on" -a -n "${TOR_RELAY_PORT}" ]; then