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 4C91E158021 for ; Wed, 12 Oct 2022 13:35:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2A751E097C; Wed, 12 Oct 2022 13:35:05 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 750B7E0974 for ; Wed, 12 Oct 2022 13:35:04 +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 18163340D23 for ; Wed, 12 Oct 2022 13:35:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 20533614 for ; Wed, 12 Oct 2022 13:35:00 +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: <1662235474.177905ccd86a2aa56ca764bc5aa256eef76c2d91.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: 177905ccd86a2aa56ca764bc5aa256eef76c2d91 X-VCS-Branch: concord-dev Date: Wed, 12 Oct 2022 13:35:00 +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: c97ba6b5-2af0-4c6f-a5c8-272183a06c99 X-Archives-Hash: 55a12e6f55e3404a095caea1d2e6091c commit: 177905ccd86a2aa56ca764bc5aa256eef76c2d91 Author: Kenton Groombridge gentoo org> AuthorDate: Fri Nov 12 01:27:06 2021 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Sat Sep 3 20:04:34 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=177905cc 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 gentoo.org> 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) ') 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 6263B158094 for ; Sat, 3 Sep 2022 20:04:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9B5BCE087E; Sat, 3 Sep 2022 20:04:54 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 87B1AE087E for ; Sat, 3 Sep 2022 20:04:54 +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 B5321340FA5 for ; Sat, 3 Sep 2022 20:04:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9185A5C0 for ; Sat, 3 Sep 2022 20:04:50 +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: <1662235474.177905ccd86a2aa56ca764bc5aa256eef76c2d91.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master 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: 177905ccd86a2aa56ca764bc5aa256eef76c2d91 X-VCS-Branch: master Date: Sat, 3 Sep 2022 20:04:50 +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: 71761d5a-1a47-41de-9223-850c69b8bd89 X-Archives-Hash: b35be73ffcfa39bde42ec60fb3378749 Message-ID: <20220903200450.IPQ5_2OJsiZL1amcGBO8iSQYwfDotnt5PWHPqiFopxw@z> commit: 177905ccd86a2aa56ca764bc5aa256eef76c2d91 Author: Kenton Groombridge gentoo org> AuthorDate: Fri Nov 12 01:27:06 2021 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Sat Sep 3 20:04:34 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=177905cc 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 gentoo.org> 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) ')