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 D4F7515808B for ; Sat, 9 Apr 2022 19:28:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0F887E09BB; 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 DE622E09BB for ; Sat, 9 Apr 2022 19:28:49 +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 ADE56341799 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 4C52AD0 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.2c2c9b394efb09bf61c6bd82d470d76d3e8d30b4.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 policy/modules/services/podman.te X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 2c2c9b394efb09bf61c6bd82d470d76d3e8d30b4 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: e2e87732-7d72-48a0-a4ac-0e02f78c292d X-Archives-Hash: 22453d028628db0ba1426d759ae5c103 commit: 2c2c9b394efb09bf61c6bd82d470d76d3e8d30b4 Author: Kenton Groombridge concord sh> AuthorDate: Fri Mar 11 05:07:56 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=2c2c9b39 container, podman: allow podman to create and write config files Podman 4.0 now creates the CNI network config files if they do not exist. Signed-off-by: Kenton Groombridge concord.sh> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/container.if | 38 ++++++++++++++++++++++++++++++++++++ policy/modules/services/podman.te | 4 ++++ 2 files changed, 42 insertions(+) diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if index e9217f63..bf5ecfb5 100644 --- a/policy/modules/services/container.if +++ b/policy/modules/services/container.if @@ -738,6 +738,44 @@ interface(`container_mountpoint',` typeattribute $1 container_mountpoint_type; ') +######################################## +## +## Allow the specified domain to +## create container config files. +## +## +## +## Domain allowed access. +## +## +# +interface(`container_create_config_files',` + gen_require(` + type container_config_t; + ') + + create_files_pattern($1, container_config_t, container_config_t) +') + +######################################## +## +## Allow the specified domain to +## write container config files. +## +## +## +## Domain allowed access. +## +## +# +interface(`container_write_config_files',` + gen_require(` + type container_config_t; + ') + + write_files_pattern($1, container_config_t, container_config_t) +') + ######################################## ## ## Allow the specified domain to diff --git a/policy/modules/services/podman.te b/policy/modules/services/podman.te index dfb8e5da..5df45d32 100644 --- a/policy/modules/services/podman.te +++ b/policy/modules/services/podman.te @@ -39,6 +39,10 @@ allow podman_t podman_conmon_t:unix_stream_socket { connectto rw_stream_socket_p container_engine_executable_entrypoint(podman_t) +# podman 4.0.0 now creates OCI networking configs +container_create_config_files(podman_t) +container_write_config_files(podman_t) + domtrans_pattern(podman_t, podman_conmon_exec_t, podman_conmon_t) logging_send_syslog_msg(podman_t)