From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 finch.gentoo.org (Postfix) with ESMTPS id 256461582EF for ; Sat, 08 Mar 2025 23:55:42 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (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) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 139F03430BF for ; Sat, 08 Mar 2025 23:55:42 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id ED1EA11047A; Sat, 08 Mar 2025 23:55:08 +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 bobolink.gentoo.org (Postfix) with ESMTPS id E3988110479 for ; Sat, 08 Mar 2025 23:55:08 +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 99BDE340906 for ; Sat, 08 Mar 2025 23:55:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4EBF628BB for ; Sat, 08 Mar 2025 23:55:05 +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: <1741476403.ddf1e7068b3cebe62999bc7fc8e6ab4a0eedb7e8.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/knot.if policy/modules/services/knot.te X-VCS-Directories: policy/modules/services/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: ddf1e7068b3cebe62999bc7fc8e6ab4a0eedb7e8 X-VCS-Branch: master Date: Sat, 08 Mar 2025 23:55:05 +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: d05ac5bc-3309-40e0-bf3b-462e39b4cb11 X-Archives-Hash: df593af4309f940585f8c16562d64113 commit: ddf1e7068b3cebe62999bc7fc8e6ab4a0eedb7e8 Author: Nicolas PARLANT parhuet fr> AuthorDate: Sat Mar 1 23:00:20 2025 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Mar 8 23:26:43 2025 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=ddf1e706 Add setcap to knotd / add knotc_initrc_domtrans allow capabilities as it's the default behavior now allow knotc cmd in init script: knotc conf-check (by default) Signed-off-by: Nicolas PARLANT parhuet.fr> Signed-off-by: Jason Zaman gentoo.org> policy/modules/services/knot.if | 19 +++++++++++++++++++ policy/modules/services/knot.te | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/policy/modules/services/knot.if b/policy/modules/services/knot.if index 247bb6c94..af98c44ee 100644 --- a/policy/modules/services/knot.if +++ b/policy/modules/services/knot.if @@ -45,6 +45,25 @@ interface(`knot_run_client',` roleattribute $2 knot_roles; ') +######################################## +## +## Execute knotc in knot init +## scripts in the initrc domain. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`knotc_initrc_domtrans',` + gen_require(` + type knot_initrc_exec_t; + ') + + init_labeled_script_domtrans($1, knot_initrc_exec_t) +') + ######################################## ## ## Read knot config files. diff --git a/policy/modules/services/knot.te b/policy/modules/services/knot.te index d658d973c..9b5b83173 100644 --- a/policy/modules/services/knot.te +++ b/policy/modules/services/knot.te @@ -38,7 +38,7 @@ files_type(knot_var_lib_t) # allow knotd_t self:capability { dac_override dac_read_search setgid setpcap setuid }; -allow knotd_t self:process { getcap getsched setsched signal_perms }; +allow knotd_t self:process { getcap getsched setcap setsched signal_perms }; allow knotd_t self:tcp_socket create_stream_socket_perms; allow knotd_t self:udp_socket create_socket_perms; allow knotd_t self:unix_stream_socket create_stream_socket_perms;