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 AF669158092 for ; Mon, 6 Jun 2022 15:14:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F3F25E085A; Mon, 6 Jun 2022 15:14:19 +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 D895FE085A for ; Mon, 6 Jun 2022 15:14:19 +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 EEBBB341A3A for ; Mon, 6 Jun 2022 15:14:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 83F484FB for ; Mon, 6 Jun 2022 15:13:47 +0000 (UTC) From: "Kenton Groombridge" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kenton Groombridge" Message-ID: <1654528388.822b048c53c7b0362a74333fba24a151569be6bc.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:concord-dev commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/phpfpm.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: 822b048c53c7b0362a74333fba24a151569be6bc X-VCS-Branch: concord-dev Date: Mon, 6 Jun 2022 15:13: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: e54a7445-8812-4586-b997-8b96eb5aad83 X-Archives-Hash: 1d0d789502f1e09845803e28647b8387 Message-ID: <20220606151347.br60GExPcWTMWBSX1RvAqgBmW_PRu2pvf0xKIzdCTwU@z> commit: 822b048c53c7b0362a74333fba24a151569be6bc Author: Kenton Groombridge gentoo org> AuthorDate: Fri Nov 12 01:27:06 2021 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Mon Jun 6 15:13:08 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=822b048c phpfpm: various fixes and new tunables Minor fixes for phpfpm and add several new tunables, primarily designed to get various webapps working under SELinux. Signed-off-by: Kenton Groombridge concord.sh> policy/modules/contrib/phpfpm.te | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/policy/modules/contrib/phpfpm.te b/policy/modules/contrib/phpfpm.te index cffae6d7..a1044f31 100644 --- a/policy/modules/contrib/phpfpm.te +++ b/policy/modules/contrib/phpfpm.te @@ -19,6 +19,49 @@ gen_tunable(phpfpm_use_ldap, false) ## gen_tunable(phpfpm_send_syslog_msg, false) +## +##

+## Allow phpfpm to execute shells. This +## is needed by some webapps. +##

+##
+gen_tunable(phpfpm_exec_shell, false) + +## +##

+## Allow phpfpm to connect to http ports. +##

+##
+gen_tunable(phpfpm_connect_http, false) + +## +##

+## Allow phpfpm to connect to pop ports. +##

+##
+gen_tunable(phpfpm_connect_pop, false) + +## +##

+## Allow phpfpm to connect to redis ports. +##

+##
+gen_tunable(phpfpm_connect_redis, false) + +## +##

+## Allow phpfpm to connect to sieve ports. +##

+##
+gen_tunable(phpfpm_connect_sieve, false) + +## +##

+## Allow phpfpm to connect to smtp ports. +##

+##
+gen_tunable(phpfpm_connect_smtp, false) + type phpfpm_t; type phpfpm_exec_t; init_daemon_domain(phpfpm_t, phpfpm_exec_t) @@ -44,6 +87,8 @@ allow phpfpm_t self:fifo_file rw_fifo_file_perms; allow phpfpm_t self:tcp_socket rw_stream_socket_perms; allow phpfpm_t self:udp_socket connected_socket_perms; allow phpfpm_t self:unix_stream_socket { accept create_stream_socket_perms }; +allow phpfpm_t self:unix_dgram_socket { create_socket_perms }; +dontaudit phpfpm_t self:capability net_admin; manage_files_pattern(phpfpm_t, phpfpm_log_t, phpfpm_log_t) logging_log_filetrans(phpfpm_t, phpfpm_log_t, file) @@ -86,6 +131,10 @@ apache_manage_all_rw_content(phpfpm_t) apache_read_sys_content(phpfpm_t) apache_dontaudit_search_modules(phpfpm_t) +optional_policy(` + apache_map_sys_content(phpfpm_t) +') + optional_policy(` mysql_stream_connect(phpfpm_t) mysql_tcp_connect(phpfpm_t) @@ -106,6 +155,30 @@ optional_policy(` ') ') +tunable_policy(`phpfpm_exec_shell',` + corecmd_exec_shell(phpfpm_t) +') + +tunable_policy(`phpfpm_connect_http',` + corenet_tcp_connect_http_port(phpfpm_t) +') + +tunable_policy(`phpfpm_connect_pop',` + corenet_tcp_connect_pop_port(phpfpm_t) +') + +tunable_policy(`phpfpm_connect_redis',` + corenet_tcp_connect_redis_port(phpfpm_t) +') + +tunable_policy(`phpfpm_connect_sieve',` + corenet_tcp_connect_sieve_port(phpfpm_t) +') + +tunable_policy(`phpfpm_connect_smtp',` + corenet_tcp_connect_smtp_port(phpfpm_t) +') + tunable_policy(`phpfpm_send_syslog_msg',` logging_send_syslog_msg(phpfpm_t) ')