Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EA4AC43387 for ; Fri, 4 Jan 2019 01:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41FE920815 for ; Fri, 4 Jan 2019 01:58:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="UH3+MJoO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbfADB6B (ORCPT ); Thu, 3 Jan 2019 20:58:01 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:41899 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfADB6B (ORCPT ); Thu, 3 Jan 2019 20:58:01 -0500 Received: by mail-qk1-f195.google.com with SMTP id 189so20766174qkj.8 for ; Thu, 03 Jan 2019 17:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=59WluVjyV6EEGXfxwWIJGQ8ABPcE/7xRDzIJot9xock=; b=UH3+MJoOMmoRS7kD/rw6R0PWtuKbOug+/SbpMmK/TzUf1vXyPc3PnV3E/pyg/lxzAV VWKoRbVhzkU3CdY5Tt/lLpfnesA9Z2CDQrXtrZi2HFqUQxZyXyGvhYwhkr2zCXCjSSSI XLtvcmpL2e+p+Lp2874hnKCK/6e43PCEWigmQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=59WluVjyV6EEGXfxwWIJGQ8ABPcE/7xRDzIJot9xock=; b=mIJTQ/Ca45TNn52EXp9gc3M0MGHYOl2NpBhUEK0MzP1kFtU0FCGvrGPDMilNmjNq2t 1D+YlsJKs2vNzq6zzXhzzP1H9jRgoPCaWVpWPC1VQHW3m0fRd0VFKSlqSAOX4dQ8IO9M Lt9IWv5G4VlYMG9vWB8BWgD/Cjw+UkPg+yf6I16aRe2ntqRCTXKMoB4HQH9bS9J1scsr iqtVjhJKcziRMwrMXGGAyn+obnPNuQTjF02Fd0RH8F2J6vKCj45lo+3WJBlA8oUTiHTR 4Xag5ut6Iaohl89icTpFwbrw2fFHTxw6+ysJTu5hpqbUPOYtT54qtdEoJgRmz3V1vffF KEOQ== X-Gm-Message-State: AJcUukdOdBWAIKrOLDUCCjPNOHMOtZUmfuARPee31WFE1AqS7jgZrxm1 60put62zn45X5kaXdQeBfOMqpXckS44= X-Google-Smtp-Source: ALg8bN58ebLqpEIsPw6SglNnE/6lMgaZUbRF7YKCHdxEtTWyVaqDb6NGiEsTrEThZPhLu+iBd/Pd9w== X-Received: by 2002:a37:dcc1:: with SMTP id v184mr9409291qki.212.1546567080134; Thu, 03 Jan 2019 17:58:00 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id d193sm30908902qka.91.2019.01.03.17.57.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jan 2019 17:57:59 -0800 (PST) Subject: Re: [PATCH v3] Add sigrok contrib module To: Guido Trentalancia , selinux-refpolicy@vger.kernel.org References: <1546098044.20582.6.camel@trentalancia.com> <1546476773.4654.4.camel@trentalancia.com> <1546510654.6418.2.camel@trentalancia.com> <1546557614.4968.1.camel@trentalancia.com> From: Chris PeBenito Message-ID: <8c98d6b2-e6a9-277e-e545-90d65877dc2d@ieee.org> Date: Thu, 3 Jan 2019 20:52:53 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1546557614.4968.1.camel@trentalancia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/3/19 6:20 PM, Guido Trentalancia wrote: > Add a SELinux Reference Policy module for the sigrok > signal analysis software suite (command-line interface). > > Signed-off-by: Guido Trentalancia > --- > policy/modules/apps/sigrok.fc | 1 > policy/modules/apps/sigrok.if | 37 +++++++++++++++++++++++++++++++++++ > policy/modules/apps/sigrok.te | 39 +++++++++++++++++++++++++++++++++++++ > policy/modules/roles/unprivuser.te | 4 +++ > 4 files changed, 81 insertions(+) > > diff -pruN a/policy/modules/apps/sigrok.fc b/policy/modules/apps/sigrok.fc > --- a/policy/modules/apps/sigrok.fc 1970-01-01 01:00:00.000000000 +0100 > +++ b/policy/modules/apps/sigrok.fc 2018-12-25 21:33:17.512518983 +0100 > @@ -0,0 +1 @@ > +/usr/bin/sigrok-cli -- gen_context(system_u:object_r:sigrok_exec_t,s0) > diff -pruN a/policy/modules/apps/sigrok.if b/policy/modules/apps/sigrok.if > --- a/policy/modules/apps/sigrok.if 1970-01-01 01:00:00.000000000 +0100 > +++ b/policy/modules/apps/sigrok.if 2018-12-29 14:52:30.771773190 +0100 > @@ -0,0 +1,37 @@ > +## sigrok signal analysis software suite. > + > +######################################## > +## > +## Execute sigrok in its domain. > +## > +## > +## > +## Role allowed access. > +## > +## > +## > +## > +## User domain for the role. > +## > +## > +# > +interface(`sigrok_run',` > + gen_require(` > + type sigrok_t, sigrok_exec_t; > + attribute_role sigrok_roles; > + ') > + > + ######################################## > + # > + # Declarations > + # > + > + roleattribute $1 sigrok_roles; > + > + ######################################## > + # > + # Policy > + # > + > + domtrans_pattern($2, sigrok_exec_t, sigrok_t) > +') > diff -pruN a/policy/modules/apps/sigrok.te b/policy/modules/apps/sigrok.te > --- a/policy/modules/apps/sigrok.te 1970-01-01 01:00:00.000000000 +0100 > +++ b/policy/modules/apps/sigrok.te 2018-12-29 16:25:21.851742375 +0100 > @@ -0,0 +1,39 @@ > +policy_module(sigrok, 1.0.0) > + > +######################################## > +# > +# Declarations > +# > + > +attribute_role sigrok_roles; > +roleattribute system_r sigrok_roles; > + > +type sigrok_t; > +type sigrok_exec_t; > +userdom_user_application_domain(sigrok_t, sigrok_exec_t) > +role sigrok_roles types sigrok_t; > + > +######################################## > +# > +# Local policy > +# > + > +allow sigrok_t self:fifo_file rw_fifo_file_perms; > +allow sigrok_t self:netlink_kobject_uevent_socket create_socket_perms; > +allow sigrok_t self:tcp_socket create_socket_perms; > + > +corenet_tcp_connect_all_unreserved_ports(sigrok_t) > + > +dev_getattr_sysfs_dirs(sigrok_t) > +dev_read_sysfs(sigrok_t) > +dev_rw_generic_usb_dev(sigrok_t) > + > +files_read_etc_files(sigrok_t) > + > +term_use_unallocated_ttys(sigrok_t) > + > +userdom_use_user_ptys(sigrok_t) > + > +optional_policy(` > + udev_read_pid_files(sigrok_t) > +') > diff -pruN a/policy/modules/roles/unprivuser.te b/policy/modules/roles/unprivuser.te > --- a/policy/modules/roles/unprivuser.te 2017-05-13 21:22:22.837046352 +0200 > +++ b/policy/modules/roles/unprivuser.te 2018-12-28 20:07:33.588429238 +0100 > @@ -146,6 +146,10 @@ ifndef(`distro_redhat',` > ') > > optional_policy(` > + sigrok_run(user_r, user_t) > + ') > + > + optional_policy(` > spamassassin_role(user_r, user_t) > ') Merged. -- Chris PeBenito