From patchwork Mon Jul 12 21:05:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 223 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 61F2027BC83; Mon, 12 Jul 2021 22:06:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 34EA527BC81 for ; Mon, 12 Jul 2021 22:06:23 +0100 (BST) Received: from localhost ([::1]:35198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m338A-0005z7-3b for patchwork@mira.cbaines.net; Mon, 12 Jul 2021 17:06:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m337q-0005xE-Ou for guix-patches@gnu.org; Mon, 12 Jul 2021 17:06:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m337q-0004Ne-F3 for guix-patches@gnu.org; Mon, 12 Jul 2021 17:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m337q-0001wo-6t for guix-patches@gnu.org; Mon, 12 Jul 2021 17:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49540] [PATCH 0/2] services: nftables: Make it extandable Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Jul 2021 21:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49540 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49540@debbugs.gnu.org Cc: iyzsong@member.fsf.org, solene@perso.pw X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16261239577473 (code B ref -1); Mon, 12 Jul 2021 21:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2021 21:05:57 +0000 Received: from localhost ([127.0.0.1]:38959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m337k-0001wT-MA for submit@debbugs.gnu.org; Mon, 12 Jul 2021 17:05:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:50750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m337i-0001wJ-Je for submit@debbugs.gnu.org; Mon, 12 Jul 2021 17:05:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m337i-0005qm-Dz for guix-patches@gnu.org; Mon, 12 Jul 2021 17:05:54 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m337g-0004Dz-2e for guix-patches@gnu.org; Mon, 12 Jul 2021 17:05:53 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id A05F6E000A; Mon, 12 Jul 2021 21:05:47 +0000 (UTC) From: Brice Waegeneire Date: Mon, 12 Jul 2021 23:05:43 +0200 Message-Id: <20210712210543.16598-1-brice@waegenei.re> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.183.196; envelope-from=brice@waegenei.re; helo=relay4-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This patchset make "nftables-service-type" extendable, so other services could open port. I wrote this to be able to use libvirt with nftables (another patch is comming about that) like this: --8<---------------cut here---------------start------------->8--- (simple-service 'nftables-libvirt nftables-service-type (list "# Libvirt? add rule inet guix forward ct state established,related accept add rule inet guix forward iifname \"virbr*\" accept add chain inet guix libvirt insert rule inet guix input iifname \"virbr*\" jump libvirt insert rule inet guix libvirt udp dport 53 accept insert rule inet guix libvirt tcp dport 53 accept insert rule inet guix libvirt udp dport 67 accept ")) --8<---------------cut here---------------end--------------->8--- So this should make it possible to implement Solene's "simple-firewall-service"¹ by simply extending "nftables-service-type". Also, now, stopping nftables only remove the "guix" table so other software can use their own namespaces without being purged when that service is stopped. WDYT? ¹ Brice Waegeneire (2): services: nftables: Only manage delete our own table. services: nftables: Make it extendable. gnu/services/networking.scm | 51 +++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 10 deletions(-)