squid patch
Added httpd_squid_script_t
squid_conf_t can be a directory
Squid also needs additional ports to communicate with
dovecot and snmp try to read squid files. (Snuck in a couple of other fixes for dovecot and snmp)
policy/modules/services/squid.fc +2 -0
@@ -12,3 +12,5 @@ /var/run/squid\.pid -- gen_context(system_u:object_r:squid_var_run_t,s0) /var/spool/squid(/.*)? gen_context(system_u:object_r:squid_cache_t,s0) +/usr/lib/squid/cachemgr\.cgi -- gen_context(system_u:object_r:httpd_squid_script_exec_t,s0) +/usr/lib64/squid/cachemgr\.cgi -- gen_context(system_u:object_r:httpd_squid_script_exec_t,s0)
policy/modules/services/squid.if +21 -1
@@ -36,7 +36,7 @@ ') files_search_etc($1) - allow $1 squid_conf_t:file read_file_perms; + read_files_pattern($1, squid_conf_t, squid_conf_t) ') ########################################
@@ -112,3 +112,23 @@ interface(`squid_use',` refpolicywarn(`$0($*) has been deprecated.') ') + +######################################## +## <summary> +## dontaudit search squid cache dirs +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`squid_dontaudit_search_squid_cache',` + gen_require(` + type squid_cache_t; + ') + + dontaudit $1 squid_cache_t:dir search_dir_perms; +') +
policy/modules/services/squid.te +12 -0
@@ -89,6 +89,8 @@ corenet_tcp_bind_ftp_port(squid_t) corenet_tcp_bind_gopher_port(squid_t) corenet_udp_bind_gopher_port(squid_t) +corenet_tcp_bind_squid_port(squid_t) +corenet_udp_bind_squid_port(squid_t) corenet_tcp_connect_ftp_port(squid_t) corenet_tcp_connect_gopher_port(squid_t) corenet_tcp_connect_http_port(squid_t)
@@ -98,6 +100,7 @@ corenet_sendrecv_gopher_client_packets(squid_t) corenet_sendrecv_http_cache_server_packets(squid_t) corenet_sendrecv_http_cache_client_packets(squid_t) +corenet_sendrecv_squid_client_packets(squid_t) dev_read_sysfs(squid_t) dev_read_urand(squid_t)
@@ -181,3 +184,12 @@ #squid requires the following when run in diskd mode, the recommended setting allow squid_t tmpfs_t:file { read write }; ') dnl end TODO + +optional_policy(` + apache_content_template(squid) + corenet_tcp_connect_http_cache_port(httpd_squid_script_t) + squid_read_config(httpd_squid_script_t) + allow httpd_squid_script_t self:tcp_socket create_socket_perms; + sysnet_read_config(httpd_squid_script_t) + corenet_non_ipsec_sendrecv(httpd_squid_script_t) +')
policy/modules/services/snmp.te +15 -0
@@ -134,6 +134,11 @@ ') optional_policy(` + mta_read_config(snmpd_t) + mta_search_queue(snmpd_t) +') + +optional_policy(` nis_use_ypbind(snmpd_t) ')
@@ -146,9 +151,19 @@ ') optional_policy(` + sendmail_read_log(snmpd_t) +') + +optional_policy(` seutil_sigchld_newrole(snmpd_t) ') optional_policy(` + squid_read_config(snmpd_t) +') + +optional_policy(` udev_read_db(snmpd_t) ') + +
policy/modules/services/dovecot.te +5 -0
@@ -46,6 +46,7 @@ allow dovecot_t self:tcp_socket create_stream_socket_perms; allow dovecot_t self:unix_dgram_socket create_socket_perms; allow dovecot_t self:unix_stream_socket { create_stream_socket_perms connectto }; +allow dovecot_t self:netlink_route_socket r_netlink_socket_perms; domtrans_pattern(dovecot_t, dovecot_auth_exec_t, dovecot_auth_t)
@@ -140,6 +141,10 @@ udev_read_db(dovecot_t) ') +optional_policy(` + squid_dontaudit_search_squid_cache(dovecot_t) +') + ######################################## # # dovecot auth local policy
policy/modules/services/apache.fc +0 -1
@@ -21,7 +16,6 @@ /usr/lib/apache-ssl/.+ -- gen_context(system_u:object_r:httpd_exec_t,s0) /usr/lib/cgi-bin(/.*)? gen_context(system_u:object_r:httpd_sys_script_exec_t,s0) -/usr/lib/squid/cachemgr\.cgi -- gen_context(system_u:object_r:httpd_exec_t,s0) /usr/lib(64)?/apache(/.*)? gen_context(system_u:object_r:httpd_modules_t,s0) /usr/lib(64)?/apache2/modules(/.*)? gen_context(system_u:object_r:httpd_modules_t,s0) /usr/lib(64)?/apache(2)?/suexec(2)? -- gen_context(system_u:object_r:httpd_suexec_exec_t,s0)
policy/modules/kernel/corenetwork.te.in +1 -0
@@ -140,6 +147,7 @@ network_port(soundd, tcp,8000,s0, tcp,9433,s0) type socks_port_t, port_type; dnl network_port(socks) # no defined portcon type stunnel_port_t, port_type; dnl network_port(stunnel) # no defined portcon in current strict +network_port(squid, udp,3401,s0, tcp,3401,s0, udp,4827,s0, tcp,4827,s0, ) network_port(swat, tcp,901,s0) network_port(syslogd, udp,514,s0) network_port(telnetd, tcp,23,s0)
policy/modules/services/squid.te line 195
Quoted 13 lines · Daniel J Walsh
policy/modules/services/squid.te +9
-0@@ -181,3 +184,12 @@ #squid requires the following when run in diskd mode, the recommended setting allow squid_t tmpfs_t:file { read write }; ') dnl end TODO + +optional_policy(` + apache_content_template(squid) + corenet_tcp_connect_http_cache_port(httpd_squid_script_t) + squid_read_config(httpd_squid_script_t) + allow httpd_squid_script_t self:tcp_socket create_socket_perms; + sysnet_read_config(httpd_squid_script_t) + corenet_non_ipsec_sendrecv(httpd_squid_script_t) +')
This brings up a problem to which I currently don't have a good solution. Due to the encapsulation, the squid module doesn't actually know how many types are created or their names when using apache_content_template(), so httpd_squid_script_t can't be used here.
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.
Quoted 11 lines · Christopher J. PeBenito
Quoted 10 lines · Daniel J Walsh
policy/modules/services/squid.te +6
-0@@ -181,3 +184,12 @@ #squid requires the following when run in diskd mode, the recommended setting allow squid_t tmpfs_t:file { read write }; ') dnl end TODO + +optional_policy(` + apache_content_template(squid) + corenet_tcp_connect_http_cache_port(httpd_squid_script_t) + squid_read_config(httpd_squid_script_t) + allow httpd_squid_script_t self:tcp_socket create_socket_perms;
Quoted 9 lines
policy/modules/services/squid.te line 195
Quoted 3 lines
policy/modules/services/squid.te +3
-0+ sysnet_read_config(httpd_squid_script_t) + corenet_non_ipsec_sendrecv(httpd_squid_script_t) +')This brings up a problem to which I currently don't have a good solution. Due to the encapsulation, the squid module doesn't actually know how many types are created or their names when using
apache_content_template(), sohttpd_squid_script_tcan't be used here.
Yeah - there isn't really a good solution. You could argue that the types are actually for the squid module (otherwise it would be an interface rather than a template), but you still have the problem that a change to the template could result in different types.
We should think about this for when interfaces are pushed into the language.
Karl
--
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.
Quoted 7 lines · Daniel J Walsh
Added
httpd_squid_script_t
squid_conf_tcan be a directory
Squid also needs additional ports to communicate withdovecot and snmp try to read squid files. (Snuck in a couple of other fixes for dovecot and snmp)
Merged except for the apache template, plus:
policy/modules/services/squid.if line 133
Quoted 7 lines
policy/modules/services/squid.if +7
-0+interface(`squid_dontaudit_search_squid_cache',` + gen_require(` + type squid_cache_t; + ') + + dontaudit $1 squid_cache_t:dir search_dir_perms; +')
Dropped the second squid in the name.
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 line 139
Quoted 9 lines
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 renamed from policy/modules/services/snmp.te 2007-03-26 10:39:04.000000000 -0400 +3
-0@@ -134,6 +134,11 @@ ') optional_policy(` + mta_read_config(snmpd_t) + mta_search_queue(snmpd_t) +')
The second interface is missing.
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 line 142
Quoted 3 lines
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 renamed from policy/modules/services/snmp.te 2007-03-26 10:39:04.000000000 -0400 +2
-0optional_policy(` + sendmail_read_log(snmpd_t) +')
This one is missing too.
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.
Quoted 40 lines · Christopher J. PeBenito
Quoted 8 lines · Daniel J Walsh
Added
httpd_squid_script_t
squid_conf_tcan be a directory
Squid also needs additional ports to communicate withdovecot and snmp try to read squid files. (Snuck in a couple of other fixes for dovecot and snmp)
Merged except for the apache template, plus:
Review
Quoted 8 lines
(quoted diff) +7
-0+interface(`squid_dontaudit_search_squid_cache',` + gen_require(` + type squid_cache_t; + ') + + dontaudit $1 squid_cache_t:dir search_dir_perms; +')Dropped the second squid in the name.
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 line 140
Quoted 10 lines
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 renamed from policy/modules/services/snmp.te 2007-03-26 10:39:04.000000000 -0400 +3
-0@@ -134,6 +134,11 @@ ') optional_policy(` + mta_read_config(snmpd_t) + mta_search_queue(snmpd_t) +')The second interface is missing.
Quoted 8 lines
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 line 144
Quoted 4 lines
policy/modules/services/snmp.te 2007-04-11 17:07:34.000000000 -0400 renamed from policy/modules/services/snmp.te 2007-03-26 10:39:04.000000000 -0400 +2
-0optional_policy(` + sendmail_read_log(snmpd_t) +')This one is missing too.
Ok here is an updated patch with the missing interfaces.
snmp is trying to execute sys_module, we are dontauditing
Switched from using nis_use_ypbind to nsswitch, since snmp is using nsswitch
Also sneaking in a fix for manage sendmail_log_t.
policy/modules/services/snmp.te +5 -4
@@ -26,7 +26,7 @@ # Local policy # allow snmpd_t self:capability { dac_override kill net_admin sys_nice sys_tty_config }; -dontaudit snmpd_t self:capability sys_tty_config; +dontaudit snmpd_t self:capability { sys_module sys_tty_config }; allow snmpd_t self:fifo_file rw_fifo_file_perms; allow snmpd_t self:unix_dgram_socket create_socket_perms; allow snmpd_t self:unix_stream_socket create_stream_socket_perms;
@@ -135,18 +135,19 @@ optional_policy(` mta_read_config(snmpd_t) + mta_search_queue(snmpd_t) ') optional_policy(` - nis_use_ypbind(snmpd_t) + auth_use_nsswitch(snmpd_t) ') optional_policy(` - nscd_socket_use(snmpd_t) + rpc_search_nfs_state_data(snmpd_t) ') optional_policy(` - rpc_search_nfs_state_data(snmpd_t) + sendmail_read_log(snmpd_t) ') optional_policy(`
policy/modules/services/mta.if +19 -0
@@ -847,6 +847,25 @@ manage_files_pattern($1,mqueue_spool_t,mqueue_spool_t) ') +######################################## +## <summary> +## search mail queue dirs. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`mta_search_queue',` + gen_require(` + type mqueue_spool_t; + ') + + files_search_spool($1) + allow $1 mqueue_spool_t:dir search_dir_perms; +') + ####################################### ## <summary> ## Read sendmail binary.
policy/modules/services/sendmail.if +21 -1
@@ -76,6 +76,26 @@ ######################################## ## <summary> +## read sendmail logs. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +## <rolecap/> +# +interface(`sendmail_read_log',` + gen_require(` + type sendmail_log_t; + ') + + logging_search_logs($1) + read_files_pattern($1, sendmail_log_t, sendmail_log_t) +') + +######################################## +## <summary> ## Create, read, write, and delete sendmail logs. ## </summary> ## <param name="domain">
@@ -91,7 +111,7 @@ ') logging_search_logs($1) - allow $1 sendmail_log_t:file manage_file_perms; + manage_files_pattern($1, sendmail_log_t, sendmail_log_t) ') ########################################
Quoted 7 lines · Daniel J Walsh
Ok here is an updated patch with the missing interfaces.
snmp is trying to execute
sys_module, we are dontauditingSwitched from using
nis_use_ypbindto nsswitch, since snmp is using nsswitchAlso sneaking in a fix for manage
sendmail_log_t.
Merged.
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.