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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 70130158095 for ; Sat, 3 Sep 2022 19:10:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C6F98E084A; Sat, 3 Sep 2022 19:10:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 672CDE0825 for ; Sat, 3 Sep 2022 19:10:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9E8B5340FC1 for ; Sat, 3 Sep 2022 19:10:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 379FD5DE for ; Sat, 3 Sep 2022 19:10:17 +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: <1662230515.2765267d6d80ad23b388bd85d7c42c3e79b77864.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/container.if X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 2765267d6d80ad23b388bd85d7c42c3e79b77864 X-VCS-Branch: master Date: Sat, 3 Sep 2022 19:10:17 +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: 5ce0b7e8-4b63-45ed-8ba7-7a5527be7a43 X-Archives-Hash: c49c1f5ceff0ab147920e20bf3a5af2e commit: 2765267d6d80ad23b388bd85d7c42c3e79b77864 Author: Kenton Groombridge concord sh> AuthorDate: Fri May 20 14:58:25 2022 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Sep 3 18:41:55 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2765267d container: rework combined role interfaces Rename and rework slightly some of the newly added interfaces. Namely, make the "admin" interfaces use admin_pattern(). Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/container.if | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if index bc4a12f4..16b14602 100644 --- a/policy/modules/services/container.if +++ b/policy/modules/services/container.if @@ -229,8 +229,8 @@ template(`container_user_role',` allow $3 container_user_domain:process { ptrace signal_perms }; ps_process_pattern($3, container_user_domain) - container_admin_all_home_content($2) container_admin_all_user_runtime_content($2) + container_manage_all_home_content($2) optional_policy(` systemd_read_user_manager_state($1, container_engine_user_domain) @@ -301,8 +301,8 @@ template(`container_unconfined_role',` container_admin_all_files($2) container_admin_all_ro_files($2) - container_admin_all_home_content($2) container_admin_all_user_runtime_content($2) + container_manage_all_home_content($2) ') ######################################## @@ -1106,12 +1106,9 @@ interface(`container_admin_all_files',` type container_file_t; ') - allow $1 container_file_t:dir { manage_dir_perms relabel_dir_perms }; - allow $1 container_file_t:file { manage_file_perms relabel_file_perms }; - allow $1 container_file_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms }; - allow $1 container_file_t:sock_file { manage_sock_file_perms relabel_sock_file_perms }; - allow $1 container_file_t:chr_file { manage_chr_file_perms relabel_chr_file_perms }; - allow $1 container_file_t:blk_file { manage_blk_file_perms relabel_blk_file_perms }; + admin_pattern($1, container_file_t, container_file_t) + allow $1 container_file_t:chr_file manage_chr_file_perms; + allow $1 container_file_t:blk_file manage_blk_file_perms; ') ######################################## @@ -1129,12 +1126,9 @@ interface(`container_admin_all_ro_files',` type container_ro_file_t; ') - allow $1 container_ro_file_t:dir { manage_dir_perms relabel_dir_perms }; - allow $1 container_ro_file_t:file { manage_file_perms relabel_file_perms }; - allow $1 container_ro_file_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms }; - allow $1 container_ro_file_t:sock_file { manage_sock_file_perms relabel_sock_file_perms }; - allow $1 container_ro_file_t:chr_file { manage_chr_file_perms relabel_chr_file_perms }; - allow $1 container_ro_file_t:blk_file { manage_blk_file_perms relabel_blk_file_perms }; + admin_pattern($1, container_ro_file_t, container_ro_file_t) + allow $1 container_ro_file_t:chr_file manage_chr_file_perms; + allow $1 container_ro_file_t:blk_file manage_blk_file_perms; ') ######################################## @@ -1154,10 +1148,7 @@ interface(`container_admin_all_user_runtime_content',` type container_user_runtime_t; ') - allow $1 container_user_runtime_t:dir { manage_dir_perms relabel_dir_perms }; - allow $1 container_user_runtime_t:file { manage_file_perms relabel_file_perms }; - allow $1 container_user_runtime_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms }; - allow $1 container_user_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms }; + admin_pattern($1, container_user_runtime_t, container_user_runtime_t) ') ######################################## @@ -1172,7 +1163,7 @@ interface(`container_admin_all_user_runtime_content',` ## ## # -interface(`container_admin_all_home_content',` +interface(`container_manage_all_home_content',` gen_require(` type container_file_t, container_ro_file_t; type container_cache_home_t, container_conf_home_t;