Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7251329ybi; Mon, 8 Jul 2019 17:56:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbN0Kl3U1M6waxLcmmR51waTG5O8eRyNFAdaoQaAC1y7qYh6EBUzV39HYKVqtWHVslfFk7 X-Received: by 2002:a17:902:1081:: with SMTP id c1mr28783974pla.200.1562633773986; Mon, 08 Jul 2019 17:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562633773; cv=none; d=google.com; s=arc-20160816; b=bIXlvHnnlAYOTl9kyuFYJKRy2C4RjjOx/r4712pJba9uaUGGYdIbo5I1lnVDFh0uxc vHXDFI7PRq0om2pnlKXG2U3glpBC5JNvvjj/2jxIgziyRIuNkOFRxW+lGGQLwJvNBX70 9hShtHjVrgmgc80vSuBQbb5DYwoUWnO+EAurWpRC0r9oNwGXWv5Kl+Rj/mlkhpbEcuKb w9Jb0nG7NYXeYYSXoihK/wTcRQMKiWPHen7AN+DDcP2P/ml2udfJB4Nu97cIwZEavU6L +pJk8UrF1YvHlq7cj4O1NG4lXuwElE/zUgzx5nNd6u7ATq7UBm1BwfFFS0OFu0A+c50I C6bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=zlMmBW0APdMcrkzExzDm3LEvEJ0ghAPHTBu53I9a6vY=; b=RRoQV8rOHKV74UWT2iTZH+PP3XzVJzFj29FbXjYxv6j78RN9ygtWO0zd99vRZMZIJI +kFNqJ1dNXHXdsmcrpJb6hF4V4poKJji8/DrlRXI5tiVXE4ptNFMSjVL1Rk0eFT9izFY sTCFg4OD0C8S0NGOZAg4GnnGqPrYyuV7yW0dAzil/AyWN6FryRz+LgT982g4gcwzo5iP wvIKe3cp5R96Ak5yEpCoTNmnLzNiCmbWzP59cJBf0VKm8YNEhfet7AfpRUcSUGAcLyRh HMiqlE3qIf8SLrYj58uSYLwLLI2smv3xhd5SgQSfYKGuOZHlALNdwPnzKG9dOHRYoQg3 xPYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=Yk1JRcIS; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si18916138plp.1.2019.07.08.17.56.12; Mon, 08 Jul 2019 17:56:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=Yk1JRcIS; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfGIAuB (ORCPT + 11 others); Mon, 8 Jul 2019 20:50:01 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:45272 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfGIAuB (ORCPT ); Mon, 8 Jul 2019 20:50:01 -0400 Received: by mail-qk1-f196.google.com with SMTP id s22so14764297qkj.12 for ; Mon, 08 Jul 2019 17:50:01 -0700 (PDT) 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=zlMmBW0APdMcrkzExzDm3LEvEJ0ghAPHTBu53I9a6vY=; b=Yk1JRcISUEkhreI1PnAZGAaWvZIrbnQNbIelSBkOqM3aPXDt8EWaxj0pqBpVYjHog3 TD5VXEZR75V97bguWZg7Ythst4y72PuCDFnEKLENVAbNFdiQO2VZT1J7MN7xXQtpNtVr BsiPgJBduAGB7EjymO2OtHQYT6Pp1LYZFRsxo= 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=zlMmBW0APdMcrkzExzDm3LEvEJ0ghAPHTBu53I9a6vY=; b=sABlf1neO17Ny4OkfIuoq3xazlQxXBr4CdPdWnkvJ/fasdUWtLiusAEoO805iDhuYI 3rM2kbV+kkDobJqoReyIAc4xacKNncobr2AY94LTVfIsUNd/kDDyI2wzEEwKLPTKuLnP V1ghFxBDE6lGTWGNxIIWdiaHNpWXjRraxBq3eX+k3OxBBsgyNwU1S9QXvUnxl6k4eYF1 nI6Nqgf+Z+Lpmh3yDJMEGUeW11+90K1zcoxFilbvNxxiOc+B3Ma2wTYjwR2w/9dLfN9D IJi7q3L2N01azLalwknJRuE6loXk3ZJXVYcghoL4UcrDnc/+CYoyfZFibON0orA96a4n CBZQ== X-Gm-Message-State: APjAAAU/qE240UDosFbG+rEPOQbbx0qTsBzzNbXIQ5WyX1G/JSAWbYhO uXz0Jp+MH/wXT8t/Fc/UUO0wXC/AFC0= X-Received: by 2002:a37:6a87:: with SMTP id f129mr16475550qkc.183.1562633400557; Mon, 08 Jul 2019 17:50:00 -0700 (PDT) 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 o21sm7820781qtq.16.2019.07.08.17.49.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2019 17:50:00 -0700 (PDT) Subject: Re: [PATCH 5/5] Allow rpm scripts to alter systemd services To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190702153014.14097-1-dsugar@tresys.com> <20190702153014.14097-6-dsugar@tresys.com> From: Chris PeBenito Message-ID: <5d31d72b-c6a6-7f28-1d86-3cb6d817b618@ieee.org> Date: Mon, 8 Jul 2019 20:40:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190702153014.14097-6-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 7/2/19 11:30 AM, Sugar, David wrote: > In RPM scripts it is common to enable/start services that are being > installed. This allows rpm_script_t to manage sysemd units > > type=USER_AVC msg=audit(1561033935.758:283): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: denied { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpdate.service" cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' > type=USER_AVC msg=audit(1561033935.837:286): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: denied { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpd.service" cmdline="systemctl preset ntpd.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' > > type=USER_AVC msg=audit(1561059114.937:239): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc: denied { reload } for auid=n/a uid=0 gid=0 cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=system exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?' > > Signed-off-by: Dave Sugar > --- > policy/modules/admin/rpm.te | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te > index 111fcb01..c572c741 100644 > --- a/policy/modules/admin/rpm.te > +++ b/policy/modules/admin/rpm.te > @@ -345,6 +345,8 @@ auth_dontaudit_getattr_shadow(rpm_script_t) > auth_use_nsswitch(rpm_script_t) > > init_domtrans_script(rpm_script_t) > +init_manage_all_units(rpm_script_t) > +init_reload(rpm_script_t) > init_telinit(rpm_script_t) > > libs_exec_ld_so(rpm_script_t) Merged. -- Chris PeBenito