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 BA3FC158090 for ; Sun, 22 Sep 2024 00:03:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 820E6E29AE; Sun, 22 Sep 2024 00:03:38 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 64AE0E29AE for ; Sun, 22 Sep 2024 00:03:38 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4D779343177 for ; Sun, 22 Sep 2024 00:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 747A327FB for ; Sun, 22 Sep 2024 00:03:35 +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: <1726957709.2e1192a4f76b25a7f91cdda83ffddaea56723119.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/services/, policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/services/container.if policy/modules/system/iptables.te X-VCS-Directories: policy/modules/services/ policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 2e1192a4f76b25a7f91cdda83ffddaea56723119 X-VCS-Branch: master Date: Sun, 22 Sep 2024 00:03:35 +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: a91b4c09-ab80-4f53-9cfd-7b5e269a49e5 X-Archives-Hash: bc576d4830195f417d63b70f668a5682 commit: 2e1192a4f76b25a7f91cdda83ffddaea56723119 Author: Kenton Groombridge gentoo org> AuthorDate: Fri Aug 9 19:23:24 2024 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Sep 21 22:28:29 2024 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2e1192a4 iptables: allow reading container engine tmp files When multus creates a new network, iptables rules get written to /tmp and iptables will be called to load them. Signed-off-by: Kenton Groombridge gentoo.org> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/container.if | 20 ++++++++++++++++++++ policy/modules/system/iptables.te | 5 +++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if index c9f4aa934..902c31b89 100644 --- a/policy/modules/services/container.if +++ b/policy/modules/services/container.if @@ -480,6 +480,26 @@ interface(`container_search_engine_tmp',` allow $1 container_engine_tmp_t:dir search_dir_perms; ') +######################################## +## +## Allow the specified domain to read +## container engine temporary files. +## +## +## +## Domain allowed access. +## +## +# +interface(`container_read_engine_tmp_files',` + gen_require(` + type container_engine_tmp_t; + ') + + container_search_engine_tmp($1) + allow $1 container_engine_tmp_t:file read_file_perms; +') + ######################################## ## ## Allow the specified domain to manage diff --git a/policy/modules/system/iptables.te b/policy/modules/system/iptables.te index 684d91a25..7c401fa50 100644 --- a/policy/modules/system/iptables.te +++ b/policy/modules/system/iptables.te @@ -105,11 +105,12 @@ sysnet_dns_name_resolve(iptables_t) userdom_use_inherited_user_terminals(iptables_t) - - optional_policy(` # iptables may try to rw /ptmx in a container container_dontaudit_rw_chr_files(iptables_t) + + # iptables reads firewall rules written to tmp + container_read_engine_tmp_files(iptables_t) ') optional_policy(`