From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.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,URIBL_BLOCKED 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 209DEC43441 for ; Sun, 18 Nov 2018 00:03:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB87320815 for ; Sun, 18 Nov 2018 00:03:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="BCP2fiQa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB87320815 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ieee.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbeKRKVd (ORCPT ); Sun, 18 Nov 2018 05:21:33 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:45678 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbeKRKVd (ORCPT ); Sun, 18 Nov 2018 05:21:33 -0500 Received: by mail-qk1-f196.google.com with SMTP id d135so43419662qkc.12 for ; Sat, 17 Nov 2018 16:03:06 -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=aQTkybznprQ5ATnXlZS5sH3a/gQp4LLwIWEAk5ccdpY=; b=BCP2fiQavzptwIQfqNxjnkc5xzLmz1lKkmyN4tUUUL0sMILOGv7x7/FjBNmsQqwo74 eFpPFkDVB90tsCPtyzxQyEk1Fyb3d05vjoE0GSIQDw7p64uASDnzNZpcUZnRRXSdEISo eP7S+a2oL6lqbYqVeu+v3uFTziop7fWEtz2oc= 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=aQTkybznprQ5ATnXlZS5sH3a/gQp4LLwIWEAk5ccdpY=; b=t3avEigVScpwE/XOGRd9y/U5B9NVC6rtZyUCiTNjAHnYpBBQSs92QEP5WCnLiaqnhN o4uu6p2FqV68Yuf1JQT+8fhpLg85Hk7XAd/FDO+lHwu0/N261xv770n4BdSOCbiwVVTh +h9eHaEh4UoCJQyoF5AZKg2fBtyc8al8+2PT0+fIV4T77MdSX8Po8ohn8JRH5tFrIbW8 ED5ix18S/r0uVxKjOOLav/saFqZsRr86lbCbwfdxuJwHOgEnLEqnVzmDLuUTRPEFbTAr r4eU9PaR4IotVfJ+jwvFg/Ue2xUuvkas+o3a7meIQ3wVVAwtOet59GWg8jPQLgWX4DQe qYSA== X-Gm-Message-State: AGRZ1gJ1bk1rubLaXoipyjbDYuxEqmjZRNjz2NL6cISm8Efn/011KdDq VB+QLYT5R7GQidIkp8/zuxReislTDZg= X-Google-Smtp-Source: AJdET5endHcxlefCoOgpswXPu6uY3Iu0CnkR1ceFHWrUHYgWm1fp0ldkup150IMeGt5mDT4XkhiFVg== X-Received: by 2002:ac8:3565:: with SMTP id z34mr15784831qtb.272.1542499385722; Sat, 17 Nov 2018 16:03:05 -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 c77sm24395483qkh.82.2018.11.17.16.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 16:03:05 -0800 (PST) Subject: Re: [PATCH 1/2] Add interfaces to control ntpd_unit_t systemd services To: David Sugar , "selinux-refpolicy@vger.kernel.org" References: <20181117042305.23949-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: Date: Sat, 17 Nov 2018 18:54:01 -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: <20181117042305.23949-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 11/16/18 11:23 PM, David Sugar wrote: > Signed-off-by: Dave Sugar > --- > policy/modules/services/ntp.if | 63 ++++++++++++++++++++++++++++++++++ > 1 file changed, 63 insertions(+) > > diff --git a/policy/modules/services/ntp.if b/policy/modules/services/ntp.if > index 00c7620b..f1a90c55 100644 > --- a/policy/modules/services/ntp.if > +++ b/policy/modules/services/ntp.if > @@ -177,6 +177,69 @@ interface(`ntp_rw_shm',` > fs_search_tmpfs($1) > ') > > +######################################## > +## > +## Allow specified domain to enable/disable ntpd unit > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`ntp_enabledisable',` > + ifdef(`init_systemd',` > + gen_require(` > + type ntpd_unit_t; > + class service { enable disable }; > + ') > + > + allow $1 ntpd_unit_t:service { enable disable }; > + ') > +') > + > +######################################## > +## > +## Allow specified domain to start/stop ntpd unit > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`ntp_startstop',` > + ifdef(`init_systemd',` > + gen_require(` > + type ntpd_unit_t; > + class service { start stop }; > + ') > + > + allow $1 ntpd_unit_t:service { start stop }; > + ') > +') > + > +######################################## > +## > +## Allow specified domain to get status of ntpd unit > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`ntp_status',` > + ifdef(`init_systemd',` > + gen_require(` > + type ntpd_unit_t; > + class service status; > + ') > + > + allow $1 ntpd_unit_t:service status; > + ') > +') > + > ######################################## > ## > ## All of the rules required to Merged. -- Chris PeBenito