Updated policy
Subsystems (2)
Added booleans to turn on httpd connecting to mysql/postgres as well as relay.
nis_signal_ypbind requires you to be able to read pidfile.
mount command wants access to tty. needs to be able to search rpc_pipefs in Fedora.
Makefile +1 -1
@@ -92,7 +92,7 @@ # enable MLS if requested. ifneq ($(findstring -mls,$(TYPE)),) - override M4PARAM += -D enable_mls + override M4PARAM += -D enable_mls -D separate_secadm override CHECKPOLICY += -M override CHECKMODULE += -M endif
policy/global_tunables +6 -0
@@ -68,6 +68,12 @@ ## Allow http daemon to tcp connect gen_tunable(httpd_can_network_connect,false) +## allow httpd to connect to mysql/posgresql +gen_tunable(httpd_can_network_connect_db, false) + +## allow httpd to connect to mysql/posgresql +gen_tunable(httpd_can_network_relay, false) + ## Allow httpd cgi support gen_tunable(httpd_enable_cgi,false)
policy/modules/services/apache.te +15 -8
@@ -226,14 +226,6 @@ corenet_udp_bind_all_nodes(httpd_t) corenet_tcp_bind_http_port(httpd_t) corenet_tcp_bind_http_cache_port(httpd_t) -# allow httpd to connect to mysql/posgresql -corenet_tcp_connect_postgresql_port(httpd_t) -corenet_tcp_connect_mysqld_port(httpd_t) -# allow httpd to work as a relay -corenet_tcp_connect_gopher_port(httpd_t) -corenet_tcp_connect_ftp_port(httpd_t) -corenet_tcp_connect_http_port(httpd_t) -corenet_tcp_connect_http_cache_port(httpd_t) dev_read_sysfs(httpd_t) dev_read_rand(httpd_t)
@@ -304,6 +296,21 @@ miscfiles_manage_public_files(httpd_t) ') +# allow httpd to connect to mysql/posgresql +tunable_policy(`httpd_can_network_connect_db',` + corenet_tcp_connect_postgresql_port(httpd_t) + corenet_tcp_connect_mysqld_port(httpd_t) +') + +# allow httpd to connect to mysql/posgresql +tunable_policy(`httpd_can_network_relay',` + # allow httpd to work as a relay + corenet_tcp_connect_gopher_port(httpd_t) + corenet_tcp_connect_ftp_port(httpd_t) + corenet_tcp_connect_http_port(httpd_t) + corenet_tcp_connect_http_cache_port(httpd_t) +') + tunable_policy(`httpd_can_network_connect',` allow httpd_t self:tcp_socket create_socket_perms; allow httpd_t self:udp_socket create_socket_perms;
policy/modules/services/nis.if +2 -0
@@ -150,8 +150,10 @@ interface(`nis_signal_ypbind',` gen_require(` type ypbind_t; + type ypbind_var_run_t; ') + allow $1 ypbind_var_run_t:file read; allow $1 ypbind_t:process signal; ')
policy/modules/system/mount.te +2 -3
@@ -47,6 +47,7 @@ fs_use_tmpfs_chr_dev(mount_t) term_use_console(mount_t) +term_use_generic_pty(mount_t) # required for mount.smbfs corecmd_exec_sbin(mount_t)
@@ -94,9 +95,7 @@ optional_policy(`portmap',` # for nfs - #allow portmap_t mount_t:udp_socket { sendto recvfrom }; - #allow mount_t portmap_t:udp_socket { sendto recvfrom }; - #allow mount_t rpc_pipefs_t:dir search; + allow mount_t rpc_pipefs_t:dir search; corenet_tcp_sendrecv_all_if(mount_t) corenet_raw_sendrecv_all_if(mount_t) corenet_udp_sendrecv_all_if(mount_t)
Quoted 2 lines · Daniel J Walsh
Added booleans to turn on httpd connecting to mysql/postgres as well as relay.
merged.
Quoted 1 line
nis_signal_ypbindrequires you to be able to read pidfile.
Not going to merge this, for a couple reasons. First, it would still be good to have an interface that allows just the signal, for the case that the signaler already knows the PID. Second, it introduces a large info flow backchannel, since ypbid can write it's pid file. This is a candidate for a more abstract interface whose implementation would be to call the signal interface and the read pid interface.
Quoted 1 line
mount command wants access to tty
This sounds specific to targeted since its devpts_t, shouldn't it be in a ifdef(`targeted_policy' ?
Quoted 2 lines
needs to be able to search
rpc_pipefs
in Fedora.
Added an interface to handle this, rather than the raw rule.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
postfix mysql
In reply to Daniel J WalshBased on a similar policy update, I guess that what I have been adding to the postfix policy to enable it to use the mysql backend could be achieved with a boolean and merged upsteam?
ifdef(mysqld.te', tunable_policy(postfix_can_network_connect_db', can_unix_connect(postfix_smtpd_t, mysqld_t)
allow postfix_smtpd_t mysqld_var_run_t:dir { search }; allow postfix_smtpd_t mysqld_var_run_t:sock_file { write };
can_unix_connect(postfix_pipe_t, mysqld_t)
allow postfix_pipe_t mysqld_var_run_t:dir { search }; allow postfix_pipe_t mysqld_var_run_t:sock_file { write };
can_unix_connect(postfix_master_t, mysqld_t)
allow postfix_master_t mysqld_var_run_t:dir { search }; allow postfix_master_t mysqld_var_run_t:sock_file { write };
can_unix_connect(postfix_cleanup_t, mysqld_t)
allow postfix_cleanup_t mysqld_var_run_t:dir { search }; allow postfix_cleanup_t mysqld_var_run_t:sock_file { write };
can_unix_connect(postfix_postdrop_t, mysqld_t)
allow postfix_postdrop_t mysqld_var_run_t:dir { search }; allow postfix_postdrop_t mysqld_var_run_t:sock_file { write }; ')
# Why postfix_cleanup/postdrop needs access to this charset file? (/usr/share/mysql/charsets/Index)
# beats me:
allow postfix_cleanup_t usr_t:file { getattr read };
allow postfix_postdrop_t usr_t:file { getattr read };
')
')--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.