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 84E5515808C for ; Sat, 9 Apr 2022 19:28:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E323E09CC; Sat, 9 Apr 2022 19:28:51 +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 EF293E09BF for ; Sat, 9 Apr 2022 19:28:49 +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 E707B341785 for ; Sat, 9 Apr 2022 19:28:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 85833396 for ; Sat, 9 Apr 2022 19:28:47 +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: <1649532510.01b153cb47331dc2ba354100c74acb4e37393fc1.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 policy/modules/services/podman.if X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 01b153cb47331dc2ba354100c74acb4e37393fc1 X-VCS-Branch: master Date: Sat, 9 Apr 2022 19:28:47 +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: 2b1c572e-6388-4baa-bde8-422d2dff7727 X-Archives-Hash: f77659937491d749aa677927ad0d17a7 commit: 01b153cb47331dc2ba354100c74acb4e37393fc1 Author: Kenton Groombridge concord sh> AuthorDate: Thu Mar 31 18:44:24 2022 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Apr 9 19:28:30 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=01b153cb container, podman: allow containers to interact with conmon Allow containers to use inherited conmon file descriptors and read and write unnamed conmon pipes. Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/container.te | 5 +++++ policy/modules/services/podman.if | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/policy/modules/services/container.te b/policy/modules/services/container.te index d5f79b15..3d623229 100644 --- a/policy/modules/services/container.te +++ b/policy/modules/services/container.te @@ -248,6 +248,11 @@ tunable_policy(`container_use_samba',` fs_exec_cifs_files(container_domain) ') +optional_policy(` + podman_rw_conmon_pipes(container_domain) + podman_use_conmon_fds(container_domain) +') + optional_policy(` udev_read_runtime_files(container_domain) ') diff --git a/policy/modules/services/podman.if b/policy/modules/services/podman.if index 3d03884e..7523e33d 100644 --- a/policy/modules/services/podman.if +++ b/policy/modules/services/podman.if @@ -188,6 +188,47 @@ interface(`podman_run_conmon_user',` podman_domtrans_conmon_user($1) ') +######################################## +## +## Read and write conmon unnamed pipes. +## +## +## +## Domain allowed access. +## +## +# +interface(`podman_rw_conmon_pipes',` + gen_require(` + type podman_conmon_t; + type podman_conmon_user_t; + ') + + allow $1 podman_conmon_t:fifo_file rw_fifo_file_perms; + allow $1 podman_conmon_user_t:fifo_file rw_fifo_file_perms; +') + +######################################## +## +## Allow the specified domain to inherit +## file descriptors from conmon. +## +## +## +## Domain allowed access. +## +## +# +interface(`podman_use_conmon_fds',` + gen_require(` + type podman_conmon_t; + type podman_conmon_user_t; + ') + + allow $1 podman_conmon_t:fd use; + allow $1 podman_conmon_user_t:fd use; +') + ######################################## ## ## Role access for rootless podman.