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 4BA371396D0 for ; Fri, 15 Sep 2017 03:42:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CFE16E0D33; Fri, 15 Sep 2017 03:42:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 97E37E0D31 for ; Fri, 15 Sep 2017 03:42:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 97C9333BEBE for ; Fri, 15 Sep 2017 03:42:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 80ABF908E for ; Fri, 15 Sep 2017 03:42:43 +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: <1505417684.8bfaafbdc8b78591c80c31a16ee2475fb7170c63.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/fakehwclock.fc policy/modules/contrib/fakehwclock.if policy/modules/contrib/fakehwclock.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 8bfaafbdc8b78591c80c31a16ee2475fb7170c63 X-VCS-Branch: master Date: Fri, 15 Sep 2017 03:42:43 +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-Archives-Salt: ec28de66-5b48-4571-bc7a-327208d1507c X-Archives-Hash: a6ee2cb2aef6e563236ed218c3db8ba5 commit: 8bfaafbdc8b78591c80c31a16ee2475fb7170c63 Author: Christian Göttsche googlemail com> AuthorDate: Tue Sep 12 09:54:23 2017 +0000 Commit: Jason Zaman gentoo org> CommitDate: Thu Sep 14 19:34:44 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=8bfaafbd fakehwclock: update - add initrc filecontext - deprecate domtrans/run interface in favor of new admin interface v2: - deprecate interfaces instead of dropping policy/modules/contrib/fakehwclock.fc | 6 ++++-- policy/modules/contrib/fakehwclock.if | 34 ++++++++++++++++++++++++++++++++++ policy/modules/contrib/fakehwclock.te | 3 +++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/policy/modules/contrib/fakehwclock.fc b/policy/modules/contrib/fakehwclock.fc index 0ab3bd87..85ea9317 100644 --- a/policy/modules/contrib/fakehwclock.fc +++ b/policy/modules/contrib/fakehwclock.fc @@ -1,7 +1,9 @@ /etc/fake-hwclock\.data -- gen_context(system_u:object_r:fakehwclock_backup_t,s0) -/usr/bin/fake-hwclock -- gen_context(system_u:object_r:fakehwclock_exec_t,s0) +/etc/rc\.d/init\.d/fake-hwclock -- gen_context(system_u:object_r:fakehwclock_initrc_exec_t,s0) -/usr/sbin/fake-hwclock -- gen_context(system_u:object_r:fakehwclock_exec_t,s0) +/usr/bin/fake-hwclock -- gen_context(system_u:object_r:fakehwclock_exec_t,s0) /usr/lib/systemd/system/fake-hwclock\.service -- gen_context(system_u:object_r:fakehwclock_unit_t,s0) + +/usr/sbin/fake-hwclock -- gen_context(system_u:object_r:fakehwclock_exec_t,s0) diff --git a/policy/modules/contrib/fakehwclock.if b/policy/modules/contrib/fakehwclock.if index 24cc7d1f..3e5afb14 100644 --- a/policy/modules/contrib/fakehwclock.if +++ b/policy/modules/contrib/fakehwclock.if @@ -11,6 +11,8 @@ ## # interface(`fakehwclock_domtrans',` + refpolicywarn(`$0($*) has been deprecated') + gen_require(` type fakehwclock_t, fakehwclock_exec_t; ') @@ -37,6 +39,8 @@ interface(`fakehwclock_domtrans',` ## # interface(`fakehwclock_run',` + refpolicywarn(`$0($*) has been deprecated') + gen_require(` attribute_role fakehwclock_roles; ') @@ -44,3 +48,33 @@ interface(`fakehwclock_run',` fakehwclock_domtrans($1) roleattribute $2 fakehwclock_roles; ') + +######################################## +## +## All the rules required to +## administrate an fake-hwclock environment. +## +## +## +## Domain allowed to transition. +## +## +## +## +## Role allowed access. +## +## +# +interface(`fakehwclock_admin',` + gen_require(` + type fakehwclock_t, fakehwclock_exec_t, fakehwclock_backup_t; + type fakehwclock_initrc_exec_t, fakehwclock_unit_t; + ') + + admin_process_pattern($1, fakehwclock_t) + + init_startstop_service($1, $2, fakehwclock_t, fakehwclock_initrc_exec_t, fakehwclock_unit_t) + + files_search_etc($1) + admin_pattern($1, fakehwclock_backup_t) +') diff --git a/policy/modules/contrib/fakehwclock.te b/policy/modules/contrib/fakehwclock.te index 0a896a38..20bc5a01 100644 --- a/policy/modules/contrib/fakehwclock.te +++ b/policy/modules/contrib/fakehwclock.te @@ -15,6 +15,9 @@ role fakehwclock_roles types fakehwclock_t; type fakehwclock_backup_t; files_type(fakehwclock_backup_t) +type fakehwclock_initrc_exec_t; +init_script_file(fakehwclock_initrc_exec_t) + type fakehwclock_unit_t; init_unit_file(fakehwclock_unit_t)