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=-11.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, 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 8559EC43387 for ; Sat, 12 Jan 2019 20:04:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57F4E20836 for ; Sat, 12 Jan 2019 20:04:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="LJLxGvIG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726452AbfALUEt (ORCPT ); Sat, 12 Jan 2019 15:04:49 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:33382 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfALUEt (ORCPT ); Sat, 12 Jan 2019 15:04:49 -0500 Received: by mail-qt1-f193.google.com with SMTP id l11so22634038qtp.0 for ; Sat, 12 Jan 2019 12:04:48 -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=GaU3y18uK+niqg2PXq/8Sy6LuPUJMwWL3LCw9+1FQJM=; b=LJLxGvIG9IFffzQ6J+IWxeZoesY0ApYi7RlRnl+FRIMpR0PPSa7I00LNzsdDWIEKdB SXwTnuo6qpaS7O55OTheUsOsvUAdUJ3TkBJ7H5p09dowun16FRaR78P7UegXbTbDtyqT V1Aj9jiUsCbJqzbS616/1wis7H0WDs+5y7R6I= 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=GaU3y18uK+niqg2PXq/8Sy6LuPUJMwWL3LCw9+1FQJM=; b=sRM1l/5hoFEZ/UFEiYAoATdqYrt2Ik+z9M4mPclT5gkt8v61DsrTecgGBgqy4Oiu+G Uw5uM0QNRqWkqRrybhn7shDgWQRycBwtihoFaa8wDVzVc1WWKNyLeESJ/2CEGsgmKUI3 eBNBkEYZm5/zvQGM5fX5RYpFb0cvzpBSQw4j+PilF76e9sHXZruCeaNfjfGCcBL555xh eJrsd1cDmecTO4evWnWhj4cr6cVO49urafXSqyIiBHxHQ6s4mRzip2zFfxzTPHGfrzjB BopA0k1fhwMRvCYmQTU4cUwS8bUVxmTjHn870KcpanCYuhb3QZDx05BFN1jKl8cpKE4K yDIg== X-Gm-Message-State: AJcUukexmK3yQgvZ2OQzJSMTQSiXDmyr0dzqZamIACoJ9kuT4zWFXeZ/ n3l1WDqbrvLNcCJjUytnbBeZ6t/9HYw= X-Google-Smtp-Source: ALg8bN5hAow2F+wKdKeB6COCkrYFTo3rdIrhWx4QetkNZzRmkAwroKLQIK4Q+G3ykXqq1JbXxl4qqg== X-Received: by 2002:a0c:aee1:: with SMTP id n33mr18456405qvd.169.1547323487490; Sat, 12 Jan 2019 12:04:47 -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 l30sm38795342qte.44.2019.01.12.12.04.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 12:04:47 -0800 (PST) Subject: Re: [PATCH] Add interface to create unit files with specified type via filetrans. To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190111153011.27275-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: <3fa66aad-edc4-7d66-accd-676b8255928b@ieee.org> Date: Sat, 12 Jan 2019 14:30:31 -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: <20190111153011.27275-1-dsugar@tresys.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/11/19 10:30 AM, Sugar, David wrote: > This is adding an interface to perform a filetrans when creating > systemd unit files (in systemd_unit_t directory). Something like this > is required if creating new unit files for systemd and you want them > to have something other than the generic systemd_unit_t type. I'm not against this change, but why wouldn't they be installed by the package manager? It seems less likely that this would be otherwise needed. > Signed-off-by: Dave Sugar > --- > policy/modules/system/init.if | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if > index 5beb21e9..caed4867 100644 > --- a/policy/modules/system/init.if > +++ b/policy/modules/system/init.if > @@ -3040,6 +3040,40 @@ interface(`init_reload_all_units',` > allow $1 { init_script_file_type systemdunit }:service reload; > ') > > +######################################## > +## > +## Create systemd_unit_t objects with a private > +## type using a type_transition. > +## > +## > +## > +## Domain allowed access. > +## > +## > +## > +## > +## Private file type. > +## > +## > +## > +## > +## Object classes to be created. > +## > +## > +## > +## > +## The name of the object being created. > +## > +## > +# > +interface(`init_unit_filetrans',` > + gen_require(` > + type systemd_unit_t; > + ') > + > + filetrans_pattern($1, systemd_unit_t, $2, $3, $4) > +') > + > ######################################## > ## > ## Allow unconfined access to send instructions to init > -- Chris PeBenito