From patchwork Thu May 1 08:29:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rutherther X-Patchwork-Id: 42202 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 D56E127BC4B; Thu, 1 May 2025 09:30:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 569CA27BC49 for ; Thu, 1 May 2025 09:30:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uAPJ3-0006u6-1U; Thu, 01 May 2025 04:30:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uAPIy-0006ra-MZ for guix-patches@gnu.org; Thu, 01 May 2025 04:30:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uAPIy-0004t6-CD for guix-patches@gnu.org; Thu, 01 May 2025 04:30:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=HvtqxdUhB1XZhD2YEOg09WfD7tw1zYGhLDzD3Eewz1I=; b=Gxi1plHsa6+uPSAQ/vtTnUfGpEGF9mcivkEdqIgUkKGxr3Q231zYhPpICqsceCspTBlU3tKY3ZUpF/yY4sys0kdXslQeHbacfYQLA7DiUkNEikCiIwJ7p81vfJTCBN7x/0EuHPdi1XKvXOoEP2i0eg18/+gnf0gHYIMY7zIFXZwy36VXAtb+wVUqD/mafcE2bxyGhRwxG80+o6pe8e+ioOspLMsC6SjJhfJMug3k9ma4SgA+NB9pvj/J4gQja7I34aD5S2Ihsvk7LTy4hwN2FHUymdLmv85sJPSU+Eq9covCRe8thvYU/mJOWjd3R3Wh03fqsCbNov8eZW5yhzzqhg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uAPIy-0005yo-76 for guix-patches@gnu.org; Thu, 01 May 2025 04:30:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78179] [PATCH 4/4] services: Add wireshark-service-type. Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 May 2025 08:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78179 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78179@debbugs.gnu.org Cc: Rutherther Received: via spool by 78179-submit@debbugs.gnu.org id=B78179.174608820022748 (code B ref 78179); Thu, 01 May 2025 08:30:04 +0000 Received: (at 78179) by debbugs.gnu.org; 1 May 2025 08:30:00 +0000 Received: from localhost ([127.0.0.1]:48393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAPIu-0005uj-5M for submit@debbugs.gnu.org; Thu, 01 May 2025 04:30:00 -0400 Received: from ditigal.xyz ([2a01:4f8:1c1b:6a1c::]:59382 helo=mail.ditigal.xyz) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uAPIq-0005tq-CL for 78179@debbugs.gnu.org; Thu, 01 May 2025 04:29:57 -0400 Received: by cerebrum (OpenSMTPD) with ESMTPSA id d571cb5d (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Thu, 1 May 2025 08:29:54 +0000 (UTC) Date: Thu, 1 May 2025 10:29:37 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ditigal.xyz; i=@ditigal.xyz; q=dns/txt; s=20240917; t=1746088194; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=OQ+1oVJH9DYNtDsZlfVLQrkHCCfRCONFPmRyczTdx8w=; b=h68UHR/MTagT725lVxE7dvIezFUfhrU0c3gRVrEMs9dFEIGaQIZtMnn++t+7oZwj+yFgl j9kMA5rtxrjscT1dLLoSUvUqubnQ37LMJb7VzzN/++1YQgHTXEhHP+IaoiZtv53m8KbT/vq W4doxqz1I94vnA2ReJsF5bR6sfznQNs= 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: , Reply-to: Rutherther X-ACL-Warn: , Rutherther via Guix-patches X-Patchwork-Original-From: Rutherther via Guix-patches via From: Rutherther Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Adds wireshark service that puts wireshark to the profile and dumpcap to privileged programs so that any user can use wireshark on the system. * gnu/services/networking.scm (wireshark-configuration): New variable. * gnu/services/networking.scm (wireshark-privileged-program): New variable. * gnu/services/networking.scm (wireshark-service-type): New variable. Change-Id: Id4b0ce02fecc43592784bf22aaafa83b63c599d4 --- gnu/services/networking.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 67653e2cbf..cd418f5f16 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -51,6 +51,7 @@ (define-module (gnu services networking) #:use-module (gnu system shadow) #:use-module (gnu system pam) #:use-module ((gnu system file-systems) #:select (file-system-mapping)) + #:use-module (gnu system privilege) #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -290,7 +291,12 @@ (define-module (gnu services networking) keepalived-configuration keepalived-configuration? - keepalived-service-type)) + keepalived-service-type + + wireshark-configuration + wireshark-configuration? + wireshark-configuration-wireshark + wireshark-service-type)) ;;; Commentary: ;;; @@ -2726,4 +2732,31 @@ (define keepalived-service-type "Run @uref{https://www.keepalived.org/, Keepalived} routing software."))) +(define-configuration wireshark-configuration + (wireshark + (file-like wireshark) + "wireshark package.") + (no-serialization)) + +(define (wireshark-privileged-programs config) + (list + (privileged-program + (program + (file-append (wireshark-configuration-wireshark config) "/privileged/dumpcap")) + (capabilities "cap_net_raw,cap_net_admin=eip")))) + +(define wireshark-service-type + (service-type + (name 'wireshark) + (extensions + (list + (service-extension profile-service-type + (compose list wireshark-configuration-wireshark)) + (service-extension privileged-program-service-type + wireshark-privileged-programs))) + (default-value (wireshark-configuration)) + (description "Run wireshark. https://www.wireshark.org/ + +All users of the system will be able to run dumpcap without special permissions."))) + ;;; networking.scm ends here