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 E6AFB158088 for ; Sun, 30 Jan 2022 01:22:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65ED32BC031; Sun, 30 Jan 2022 01:22:50 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 50A392BC031 for ; Sun, 30 Jan 2022 01:22:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 51FE13432F6 for ; Sun, 30 Jan 2022 01:22:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1E5A72BB for ; Sun, 30 Jan 2022 01:22:45 +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: <1643505162.c293797e2f2a99b76d81bb1fc89ffbd4d5955e0f.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.te X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: c293797e2f2a99b76d81bb1fc89ffbd4d5955e0f X-VCS-Branch: master Date: Sun, 30 Jan 2022 01:22:45 +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: dcb8fefb-b455-43cf-b38f-7bebcb87e74b X-Archives-Hash: e4e5ca11c7a9e64cad986981df2fbf11 commit: c293797e2f2a99b76d81bb1fc89ffbd4d5955e0f Author: Kenton Groombridge concord sh> AuthorDate: Sat Nov 27 20:08:52 2021 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Jan 30 01:12:42 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=c293797e container: add tunables for containers to use nfs and cifs Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/container.te | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/policy/modules/services/container.te b/policy/modules/services/container.te index 015d9f2d..35613b23 100644 --- a/policy/modules/services/container.te +++ b/policy/modules/services/container.te @@ -9,6 +9,20 @@ policy_module(container) ## gen_tunable(container_manage_cgroup, false) +## +##

+## Allow containers to use NFS filesystems. +##

+##
+gen_tunable(container_use_nfs, false) + +## +##

+## Allow containers to use CIFS filesystems. +##

+##
+gen_tunable(container_use_samba, false) + ######################################## # # Declarations @@ -216,6 +230,22 @@ tunable_policy(`container_manage_cgroup',` fs_manage_cgroup_files(container_domain) ') +tunable_policy(`container_use_nfs',` + fs_manage_nfs_dirs(container_domain) + fs_manage_nfs_files(container_domain) + fs_manage_nfs_named_sockets(container_domain) + fs_read_nfs_symlinks(container_domain) + fs_exec_nfs_files(container_domain) +') + +tunable_policy(`container_use_samba',` + fs_manage_cifs_dirs(container_domain) + fs_manage_cifs_files(container_domain) + fs_manage_cifs_named_sockets(container_domain) + fs_read_cifs_symlinks(container_domain) + fs_exec_cifs_files(container_domain) +') + optional_policy(` udev_read_runtime_files(container_domain) ') @@ -476,6 +506,27 @@ ifdef(`init_systemd',` init_run_bpf(container_engine_domain) ') +tunable_policy(`container_use_nfs',` + fs_manage_nfs_dirs(container_engine_domain) + fs_manage_nfs_files(container_engine_domain) + fs_manage_nfs_named_sockets(container_engine_domain) + fs_read_nfs_symlinks(container_engine_domain) + fs_mount_nfs(container_engine_domain) + fs_unmount_nfs(container_engine_domain) + fs_exec_nfs_files(container_engine_domain) + kernel_rw_fs_sysctls(container_engine_domain) +',` + kernel_dontaudit_search_fs_sysctls(container_engine_domain) +') + +tunable_policy(`container_use_samba',` + fs_manage_cifs_dirs(container_engine_domain) + fs_manage_cifs_files(container_engine_domain) + fs_manage_cifs_named_sockets(container_engine_domain) + fs_read_cifs_symlinks(container_engine_domain) + fs_exec_cifs_files(container_engine_domain) +') + optional_policy(` # to verify container image signatures gpg_exec(container_engine_domain)