From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 22367138334 for ; Sun, 9 Dec 2018 11:49:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B8C4FE0929; Sun, 9 Dec 2018 11:49:03 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 87D3AE092A for ; Sun, 9 Dec 2018 11:49:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 700A1335CCD for ; Sun, 9 Dec 2018 11:49:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 434794E7 for ; Sun, 9 Dec 2018 11:48:58 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1542538607.fc20bbb5187bd1cb4527ebf38390d1a31b8593c4.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/services/ntp.if X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: fc20bbb5187bd1cb4527ebf38390d1a31b8593c4 X-VCS-Branch: master Date: Sun, 9 Dec 2018 11:48:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3f2918fe-ea1b-476a-991b-601e47e4b4dc X-Archives-Hash: 1e2ae093d0ee2550d91c39ef390d7205 commit: fc20bbb5187bd1cb4527ebf38390d1a31b8593c4 Author: David Sugar tresys com> AuthorDate: Sat Nov 17 04:23:43 2018 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Nov 18 10:56:47 2018 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=fc20bbb5 Add interfaces to control ntpd_unit_t systemd services Signed-off-by: Dave Sugar tresys.com> Signed-off-by: Jason Zaman perfinion.com> 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 31f71108..ff85b74b 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