diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 722f767d..d97bbc52 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -4,6 +4,7 @@ apt (Erich Schubert) clamav (Erich Schubert) dpkg (Erich Schubert) + mozilla mplayer rhgb thunderbird diff --git a/refpolicy/policy/global_tunables b/refpolicy/policy/global_tunables index ed18162a..6af4c0a1 100644 --- a/refpolicy/policy/global_tunables +++ b/refpolicy/policy/global_tunables @@ -376,6 +376,13 @@ gen_tunable(cdrecord_read_content,false) ## gen_tunable(cron_can_relabel,false) +## +##

+## Disable transitions to user mozilla domains +##

+##
+gen_tunable(disable_mozilla_trans,false) + ## ##

## Disable transitions to user thunderbird domains @@ -392,6 +399,13 @@ gen_tunable(disable_thunderbird_trans,false) ## gen_tunable(mail_read_content,false) +## +##

+## Control mozilla content access +##

+##
+gen_tunable(mozilla_read_content,false) + ## ##

## Allow pppd to be run for a regular user diff --git a/refpolicy/policy/modules/apps/mozilla.fc b/refpolicy/policy/modules/apps/mozilla.fc new file mode 100644 index 00000000..7218f9fb --- /dev/null +++ b/refpolicy/policy/modules/apps/mozilla.fc @@ -0,0 +1,34 @@ +# +# /bin +# +/usr/bin/netscape -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/bin/mozilla -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/bin/mozilla-snapshot -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/bin/epiphany-bin -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/bin/mozilla-[0-9].* -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/bin/mozilla-bin-[0-9].* -- gen_context(system_u:object_r:mozilla_exec_t,s0) + +# +# /etc +# +/etc/mozpluggerrc -- gen_context(system_u:object_r:mozilla_conf_t,s0) + +# +# /lib +# +/usr/lib(64)?/galeon/galeon -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/netscape/.+/communicator/communicator-smotif\.real -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/netscape/base-4/wrapper -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/mozilla[^/]*/reg.+ -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/mozilla[^/]*/mozilla-.* -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/firefox[^/]*/mozilla-.* -- gen_context(system_u:object_r:mozilla_exec_t,s0) +/usr/lib(64)?/[^/]*firefox[^/]*/firefox-bin -- gen_context(system_u:object_r:mozilla_exec_t,s0) + +# netscape/mozilla +ifdef(`strict_policy',` +HOME_DIR/\.galeon(/.*)? gen_context(system_u:object_r:ROLE_mozilla_home_t,s0) +HOME_DIR/\.netscape(/.*)? gen_context(system_u:object_r:ROLE_mozilla_home_t,s0) +HOME_DIR/\.mozilla(/.*)? gen_context(system_u:object_r:ROLE_mozilla_home_t,s0) +HOME_DIR/\.phoenix(/.*)? gen_context(system_u:object_r:ROLE_mozilla_home_t,s0) +HOME_DIR/\.java(/.*)? gen_context(system_u:object_r:ROLE_mozilla_home_t,s0) +') diff --git a/refpolicy/policy/modules/apps/mozilla.if b/refpolicy/policy/modules/apps/mozilla.if new file mode 100644 index 00000000..70f04e49 --- /dev/null +++ b/refpolicy/policy/modules/apps/mozilla.if @@ -0,0 +1,412 @@ +##

Policy for Mozilla and related web browsers + +####################################### +## +## The per user domain template for the mozilla module. +## +## +##

+## This template creates a derived domains which are used +## for mozilla web browser. +##

+##

+## This template is invoked automatically for each user, and +## generally does not need to be invoked directly +## by policy writers. +##

+##
+## +## +## The prefix of the user domain (e.g., user +## is the prefix for user_t). +## +## +## +## +## The type of the user domain. +## +## +## +## +## The role associated with the user domain. +## +## +# +template(`mozilla_per_userdomain_template',` + + ######################################## + # + # Declarations + # + type $1_mozilla_t; + domain_type($1_mozilla_t) + domain_entry_file($1_mozilla_t,mozilla_exec_t) + role $3 types $1_mozilla_t; + + type $1_mozilla_home_t alias $1_mozilla_rw_t; + files_poly_member($1_mozilla_home_t) + userdom_user_home_content($1,$1_mozilla_home_t) + + type $1_mozilla_tmpfs_t; + files_tmpfs_file($1_mozilla_tmpfs_t) + + ######################################## + # + # Local policy + # + allow $1_mozilla_t self:capability { sys_nice setgid setuid }; + allow $1_mozilla_t self:process { sigkill signal setsched getsched setrlimit }; + allow $1_mozilla_t self:fifo_file { getattr read write }; + allow $1_mozilla_t self:shm { unix_read unix_write read write destroy create }; + allow $1_mozilla_t self:sem create_sem_perms; + allow $1_mozilla_t self:socket create_socket_perms; + allow $1_mozilla_t self:unix_stream_socket { listen accept }; + # Browse the web, connect to printer + allow $1_mozilla_t self:tcp_socket create_socket_perms; + + # for bash - old mozilla binary + can_exec($1_mozilla_t, mozilla_exec_t) + + # X access, Home files + allow $1_mozilla_t $1_mozilla_home_t:dir manage_dir_perms; + allow $1_mozilla_t $1_mozilla_home_t:file manage_file_perms; + allow $1_mozilla_t $1_mozilla_home_t:lnk_file create_lnk_perms; + fs_search_auto_mountpoints($1_mozilla_t) + + # Mozpluggerrc + allow $1_mozilla_t mozilla_conf_t:file r_file_perms; + + allow $1_mozilla_t $2:fd use; + allow $1_mozilla_t $2:process sigchld; + allow $1_mozilla_t $2:unix_stream_socket connectto; + allow $2 $1_mozilla_t:fd use; + allow $2 $1_mozilla_t:shm { associate getattr }; + allow $2 $1_mozilla_t:shm { unix_read unix_write }; + allow $2 $1_mozilla_t:unix_stream_socket connectto; + + # X access, Home files + allow $2 $1_mozilla_home_t:dir manage_dir_perms; + allow $2 $1_mozilla_home_t:file manage_file_perms; + allow $2 $1_mozilla_home_t:lnk_file create_lnk_perms; + allow $2 $1_mozilla_home_t:{ dir file lnk_file } { relabelfrom relabelto }; + userdom_search_user_home_dirs($1,$1_mozilla_t) + + allow $1_mozilla_t $1_mozilla_tmpfs_t:dir rw_dir_perms; + allow $1_mozilla_t $1_mozilla_tmpfs_t:file manage_file_perms; + allow $1_mozilla_t $1_mozilla_tmpfs_t:lnk_file create_lnk_perms; + allow $1_mozilla_t $1_mozilla_tmpfs_t:sock_file manage_file_perms; + allow $1_mozilla_t $1_mozilla_tmpfs_t:fifo_file manage_file_perms; + fs_tmpfs_filetrans($1_mozilla_t,$1_mozilla_tmpfs_t,{ dir file lnk_file sock_file fifo_file }) + + # Unrestricted inheritance from the caller. + allow $2 $1_mozilla_t:process { noatsecure siginh rlimitinh }; + allow $1_mozilla_t $2:process signull; + + # Allow the user domain to signal/ps. + allow $2 $1_mozilla_t:dir { search getattr read }; + allow $2 $1_mozilla_t:{ file lnk_file } { read getattr }; + allow $2 $1_mozilla_t:process getattr; + # We need to suppress this denial because procps tries to access + # /proc/pid/environ and this now triggers a ptrace check in recent kernels + # (2.4 and 2.6). Might want to change procps to not do this, or only if + # running in a privileged domain. + dontaudit $2 $1_mozilla_t:process ptrace; + + allow $2 $1_mozilla_t:process signal_perms; + + kernel_read_kernel_sysctls($1_mozilla_t) + kernel_read_network_state($1_mozilla_t) + # Access /proc, sysctl + kernel_read_system_state($1_mozilla_t) + kernel_read_net_sysctls($1_mozilla_t) + + corecmd_search_sbin($1_mozilla_t) + # Look for plugins + corecmd_list_bin($1_mozilla_t) + # for bash - old mozilla binary + corecmd_exec_shell($1_mozilla_t) + corecmd_exec_bin($1_mozilla_t) + + # Browse the web, connect to printer + corenet_tcp_sendrecv_generic_if($1_mozilla_t) + corenet_raw_sendrecv_generic_if($1_mozilla_t) + corenet_tcp_sendrecv_all_nodes($1_mozilla_t) + corenet_raw_sendrecv_all_nodes($1_mozilla_t) + corenet_tcp_sendrecv_http_port($1_mozilla_t) + corenet_tcp_sendrecv_http_cache_port($1_mozilla_t) + corenet_tcp_sendrecv_ftp_port($1_mozilla_t) + corenet_tcp_sendrecv_ipp_port($1_mozilla_t) + corenet_non_ipsec_sendrecv($1_mozilla_t) + corenet_tcp_bind_all_nodes($1_mozilla_t) + corenet_tcp_connect_http_port($1_mozilla_t) + corenet_tcp_connect_http_cache_port($1_mozilla_t) + corenet_tcp_connect_ftp_port($1_mozilla_t) + corenet_tcp_connect_ipp_port($1_mozilla_t) + corenet_tcp_connect_generic_port($1_mozilla_t) + # Should not need other ports + corenet_dontaudit_tcp_sendrecv_generic_port($1_mozilla_t) + corenet_dontaudit_tcp_bind_generic_port($1_mozilla_t) + + dev_read_urand($1_mozilla_t) + dev_write_sound($1_mozilla_t) + dev_read_sound($1_mozilla_t) + dev_dontaudit_rw_dri($1_mozilla_t) + + files_read_etc_runtime_files($1_mozilla_t) + files_read_usr_files($1_mozilla_t) + files_read_etc_files($1_mozilla_t) + # /var/lib + files_read_var_lib_files($1_mozilla_t) + # interacting with gstreamer + files_read_var_files($1_mozilla_t) + files_read_var_symlinks($1_mozilla_t) + + fs_search_inotifyfs($1_mozilla_t) + fs_rw_tmpfs_files($1_mozilla_t) + + libs_use_ld_so($1_mozilla_t) + libs_use_lib_files($1_mozilla_t) + libs_use_shared_libs($1_mozilla_t) + + logging_send_syslog_msg($1_mozilla_t) + + miscfiles_read_fonts($1_mozilla_t) + + # Browse the web, connect to printer + sysnet_dns_name_resolve($1_mozilla_t) + sysnet_read_config($1_mozilla_t) + + userdom_manage_user_home_content_dirs($1,$1_mozilla_t) + userdom_manage_user_home_content_files($1,$1_mozilla_t) + userdom_manage_user_home_content_symlinks($1,$1_mozilla_t) + userdom_manage_user_tmp_dirs($1,$1_mozilla_t) + userdom_manage_user_tmp_files($1,$1_mozilla_t) + userdom_manage_user_tmp_sockets($1,$1_mozilla_t) + + xserver_user_client_template($1,$1_mozilla_t,$1_mozilla_tmpfs_t) + + tunable_policy(`allow_execmem',` + allow $1_mozilla_t self:process { execmem execstack }; + ') + + tunable_policy(`use_nfs_home_dirs',` + fs_manage_nfs_dirs($1_mozilla_t) + fs_manage_nfs_files($1_mozilla_t) + fs_manage_nfs_symlinks($1_mozilla_t) + ') + + tunable_policy(`use_samba_home_dirs',` + fs_manage_cifs_dirs($1_mozilla_t) + fs_manage_cifs_files($1_mozilla_t) + fs_manage_cifs_symlinks($1_mozilla_t) + ') + + # Type transition + tunable_policy(`! disable_mozilla_trans',` + domain_auto_trans($2, mozilla_exec_t, $1_mozilla_t) + ') + + # Uploads, local html + tunable_policy(`mozilla_read_content && use_nfs_home_dirs',` + fs_list_auto_mountpoints($1_mozilla_t) + files_list_home($1_mozilla_t) + fs_read_nfs_files($1_mozilla_t) + fs_read_nfs_symlinks($1_mozilla_t) + + ',` + files_dontaudit_list_home($1_mozilla_t) + fs_dontaudit_list_auto_mountpoints($1_mozilla_t) + fs_dontaudit_read_nfs_files($1_mozilla_t) + fs_dontaudit_list_nfs($1_mozilla_t) + ') + + tunable_policy(`mozilla_read_content && use_samba_home_dirs',` + fs_list_auto_mountpoints($1_mozilla_t) + files_list_home($1_mozilla_t) + fs_read_cifs_files($1_mozilla_t) + fs_read_cifs_symlinks($1_mozilla_t) + ',` + files_dontaudit_list_home($1_mozilla_t) + fs_dontaudit_list_auto_mountpoints($1_mozilla_t) + fs_dontaudit_read_cifs_files($1_mozilla_t) + fs_dontaudit_list_cifs($1_mozilla_t) + ') + + tunable_policy(`mozilla_read_content',` + userdom_list_user_tmp($1,$1_mozilla_t) + userdom_read_user_tmp_files($1,$1_mozilla_t) + userdom_read_user_tmp_symlinks($1,$1_mozilla_t) + userdom_search_user_home_dirs($1,$1_mozilla_t) + userdom_read_user_home_content_files($1,$1_mozilla_t) + userdom_read_user_home_content_symlinks($1,$1_mozilla_t) + + ifdef(`mls_policy',`',` + fs_search_removable($1_mozilla_t) + fs_read_removable_files($1_mozilla_t) + fs_read_removable_symlinks($1_mozilla_t) + ') + ',` + files_dontaudit_list_tmp($1_mozilla_t) + files_dontaudit_list_home($1_mozilla_t) + fs_dontaudit_list_removable($1_mozilla_t) + fs_donaudit_read_removable_files($1_mozilla_t) + userdom_dontaudit_list_user_tmp($1,$1_mozilla_t) + userdom_dontaudit_read_user_tmp_files($1,$1_mozilla_t) + userdom_dontaudit_list_user_home_dirs($1,$1_mozilla_t) + userdom_dontaudit_read_user_home_content_files($1,$1_mozilla_t) + ') + + tunable_policy(`mozilla_read_content && read_default_t',` + files_list_default($1_mozilla_t) + files_read_default_files($1_mozilla_t) + files_read_default_symlinks($1_mozilla_t) + ',` + files_dontaudit_read_default_files($1_mozilla_t) + files_dontaudit_list_default($1_mozilla_t) + ') + + tunable_policy(`mozilla_read_content && read_untrusted_content',` + files_list_tmp($1_mozilla_t) + files_list_home($1_mozilla_t) + userdom_search_user_home_dirs($1,$1_mozilla_t) + + userdom_list_user_untrusted_content($1,$1_mozilla_t) + userdom_read_user_untrusted_content_files($1,$1_mozilla_t) + userdom_read_user_untrusted_content_symlinks($1,$1_mozilla_t) + userdom_list_user_tmp_untrusted_content($1,$1_mozilla_t) + userdom_read_user_tmp_untrusted_content_files($1,$1_mozilla_t) + userdom_read_user_tmp_untrusted_content_symlinks($1,$1_mozilla_t) + ',` + files_dontaudit_list_tmp($1_mozilla_t) + files_dontaudit_list_home($1_mozilla_t) + userdom_dontaudit_list_user_home_dirs($1,$1_mozilla_t) + userdom_dontaudit_list_user_untrusted_content($1,$1_mozilla_t) + userdom_dontaudit_read_user_untrusted_content_files($1,$1_mozilla_t) + userdom_dontaudit_list_user_tmp_untrusted_content($1,$1_mozilla_t) + userdom_dontaudit_read_user_tmp_untrusted_content_files($1,$1_mozilla_t) + ') + + # Save web pages + tunable_policy(`write_untrusted_content && use_nfs_home_dirs',` + files_search_home($1_mozilla_t) + + fs_search_auto_mountpoints($1_mozilla_t) + fs_manage_nfs_dirs($1_mozilla_t) + fs_manage_nfs_files($1_mozilla_t) + fs_manage_nfs_symlinks($1_mozilla_t) + ',` + fs_dontaudit_list_auto_mountpoints($1_mozilla_t) + fs_dontaudit_manage_nfs_dirs($1_mozilla_t) + fs_dontaudit_manage_nfs_files($1_mozilla_t) + ') + + tunable_policy(`write_untrusted_content && use_samba_home_dirs',` + files_search_home($1_mozilla_t) + + fs_search_auto_mountpoints($1_mozilla_t) + fs_manage_cifs_dirs($1_mozilla_t) + fs_manage_cifs_files($1_mozilla_t) + fs_manage_cifs_symlinks($1_mozilla_t) + ',` + fs_dontaudit_list_auto_mountpoints($1_mozilla_t) + fs_dontaudit_manage_cifs_dirs($1_mozilla_t) + fs_dontaudit_manage_cifs_files($1_mozilla_t) + ') + + tunable_policy(`write_untrusted_content',` + files_search_home($1_mozilla_t) + files_tmp_filetrans($1_mozilla_t,$1_untrusted_content_tmp_t,file) + files_tmp_filetrans($1_mozilla_t,$1_untrusted_content_tmp_t,dir) + + userdom_manage_user_untrusted_content_files($1,$1_mozilla_t,file) + userdom_manage_user_untrusted_content_files($1,$1_mozilla_t,dir) + ',` + files_dontaudit_list_home($1_mozilla_t) + files_dontaudit_list_tmp($1_mozilla_t) + + userdom_dontaudit_list_user_home_dirs($1,$1_mozilla_t) + userdom_dontaudit_manage_user_tmp_dirs($1,$1_mozilla_t) + userdom_dontaudit_manage_user_tmp_files($1,$1_mozilla_t) + userdom_dontaudit_manage_user_home_content_dirs($1,$1_mozilla_t) + + ') + + optional_policy(`apache',` + apache_read_user_scripts($1,$1_mozilla_t) + apache_read_user_content($1,$1_mozilla_t) + ') + + optional_policy(`cups',` + cups_read_rw_config($1_mozilla_t) + ') + + optional_policy(`dbus', ` + dbus_system_bus_client_template($1_mozilla,$1_mozilla_t) + dbus_send_system_bus($1_mozilla_t) + ifdef(`TODO',` + optional_policy(`cups', ` + allow cupsd_t $1_mozilla_t:dbus send_msg; + ') + ') + ') + + optional_policy(`nscd',` + nscd_socket_use($1_mozilla_t) + ') + + optional_policy(`squid',` + squid_use($1_mozilla_t) + ') + + optional_policy(`lpd',` + lpd_domtrans_user_lpr($1,$1_mozilla_t) + ') + + ifdef(`TODO',` + # Java plugin + optional_policy(`java',` + #reh, these are hacked in types due to the use of the java_per_userdomain_template + type $1_mozilla_tmp_t; + files_tmp_file($1_mozilla_tmp_t) + + #this looks even more ugly. + type $1_mozilla_tty_device_t; + term_tty($1_mozilla_t,$1_mozilla_tty_device_t) + type $1_mozilla_devpts_t; + term_pty($1_mozilla_devpts_t) + type $1_mozilla_home_dir_t; + userdom_user_home_content($1,$1_mozilla_home_dir_t) + + java_per_userdomain_template($1_mozilla,$2,$3) + ') + + ######### Launch mplayer + optional_policy(`mplayer',` + domain_auto_trans($1_mozilla_t, mplayer_exec_t, $1_mplayer_t) + dontaudit $1_mplayer_t $1_mozilla_home_t:file { read write }; + dontaudit $1_mplayer_t $1_mozilla_t:unix_stream_socket { read write }; + dontaudit $1_mplayer_t $1_mozilla_home_t:file { read write }; + ') + #NOTE commented out in strict. + ######### Launch email client, and make webcal links work + #ifdef(`evolution.te', ` + #domain_auto_trans($1_mozilla_t, evolution_exec_t, $1_evolution_t) + #domain_auto_trans($1_mozilla_t, evolution_webcal_exec_t, $1_evolution_webcal_t) + #') + #NOTE commented out in strict + #ifdef(`thunderbird.te', ` + #domain_auto_trans($1_mozilla_t, thunderbird_exec_t, $1_thunderbird_t) + #') + + # Macros for mozilla/mozilla (or other browser) domains. + # FIXME: Rules were removed to centralize policy in a gnome_app macro + # A similar thing might be necessary for mozilla compiled without GNOME + # support (is this possible?). + + # GNOME integration + optional_policy(`gnome',` + gnome_application($1_mozilla, $1) + gnome_file_dialog($1_mozilla, $1) + ') + ') +') diff --git a/refpolicy/policy/modules/apps/mozilla.te b/refpolicy/policy/modules/apps/mozilla.te new file mode 100644 index 00000000..3afc2c06 --- /dev/null +++ b/refpolicy/policy/modules/apps/mozilla.te @@ -0,0 +1,13 @@ + +policy_module(mozilla,1.0.0) + +######################################## +# +# Declarations +# + +type mozilla_conf_t; +files_config_file(mozilla_conf_t) + +type mozilla_exec_t; +files_type(mozilla_exec_t) diff --git a/refpolicy/policy/modules/kernel/corecommands.fc b/refpolicy/policy/modules/kernel/corecommands.fc index 9a7ffdfa..d0f26275 100644 --- a/refpolicy/policy/modules/kernel/corecommands.fc +++ b/refpolicy/policy/modules/kernel/corecommands.fc @@ -103,18 +103,19 @@ ifdef(`distro_gentoo',` /usr/lib/jvm/java.*/bin -d gen_context(system_u:object_r:bin_t,s0) /usr/lib/jvm/java.*/bin/.* gen_context(system_u:object_r:bin_t,s0) +/usr/lib(64)?/[^/]*firefox[^/]*/firefox -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/apt/methods.+ -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/cups/cgi-bin/.* -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/cups/filter/.* -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/cyrus-imapd/.* -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/dpkg/.+ -- gen_context(system_u:object_r:bin_t,s0) -/usr/lib(64)?/sftp-server -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/emacsen-common/.* gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/ipsec/.* -- gen_context(system_u:object_r:sbin_t,s0) /usr/lib(64)?/mailman/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/misc/sftp-server -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/news/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/portage/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) +/usr/lib(64)?/sftp-server -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/debug/bin(/.*)? -- gen_context(system_u:object_r:bin_t,s0) /usr/lib(64)?/debug/sbin(/.*)? -- gen_context(system_u:object_r:sbin_t,s0) diff --git a/refpolicy/policy/modules/kernel/corecommands.te b/refpolicy/policy/modules/kernel/corecommands.te index d7cce793..a0c40b58 100644 --- a/refpolicy/policy/modules/kernel/corecommands.te +++ b/refpolicy/policy/modules/kernel/corecommands.te @@ -1,5 +1,5 @@ -policy_module(corecommands,1.3.1) +policy_module(corecommands,1.3.2) ######################################## # diff --git a/refpolicy/policy/modules/kernel/corenetwork.if.in b/refpolicy/policy/modules/kernel/corenetwork.if.in index c02492c4..fc7ba979 100644 --- a/refpolicy/policy/modules/kernel/corenetwork.if.in +++ b/refpolicy/policy/modules/kernel/corenetwork.if.in @@ -600,6 +600,24 @@ interface(`corenet_tcp_sendrecv_generic_port',` allow $1 port_t:tcp_socket { send_msg recv_msg }; ') +######################################## +## +## Do not audit send and receive TCP network traffic on generic ports. +## +## +## +## The type of the process performing this action. +## +## +# +interface(`corenet_dontaudit_tcp_sendrecv_generic_port',` + gen_require(` + type port_t; + ') + + allow $1 port_t:tcp_socket { send_msg recv_msg }; +') + ######################################## ## ## Send UDP network traffic on generic ports. @@ -669,6 +687,24 @@ interface(`corenet_tcp_bind_generic_port',` allow $1 port_t:tcp_socket name_bind; ') +######################################## +## +## Do not audit bind TCP sockets to generic ports. +## +## +## +## Domain to not audit. +## +## +# +interface(`corenet_dontaudit_tcp_bind_generic_port',` + gen_require(` + type port_t; + ') + + dontaudit $1 port_t:tcp_socket name_bind; +') + ######################################## ## ## Bind UDP sockets to generic ports. diff --git a/refpolicy/policy/modules/kernel/corenetwork.te.in b/refpolicy/policy/modules/kernel/corenetwork.te.in index d9ff0ac7..b8523895 100644 --- a/refpolicy/policy/modules/kernel/corenetwork.te.in +++ b/refpolicy/policy/modules/kernel/corenetwork.te.in @@ -1,5 +1,5 @@ -policy_module(corenetwork,1.1.0) +policy_module(corenetwork,1.1.1) ######################################## # diff --git a/refpolicy/policy/modules/services/apache.if b/refpolicy/policy/modules/services/apache.if index 288b313f..6ba4d3e2 100644 --- a/refpolicy/policy/modules/services/apache.if +++ b/refpolicy/policy/modules/services/apache.if @@ -820,3 +820,55 @@ interface(`apache_search_sys_script_state',` allow $1 httpd_sys_script_t:dir search; ') + +######################################## +## +## Read httpd user scripts executables. +## +## +## +## Prefix of the domain. Example, user would be +## the prefix for the uder_t domain. +## +## +## +## +## Domain allowed access. +## +## +# +interface(`apache_read_user_scripts',` + gen_require(` + type httpd_$1_script_exec_t; + ') + + allow $2 httpd_$1_script_exec_t:dir r_dir_perms; + allow $2 httpd_$1_script_exec_t:file r_file_perms; + allow $2 httpd_$1_script_exec_t:lnk_file { getattr read }; +') + +######################################## +## +## Read user web content. +## +## +## +## Prefix of the domain. Example, user would be +## the prefix for the uder_t domain. +## +## +## +## +## Domain allowed access. +## +## +# +interface(`apache_read_user_content',` + gen_require(` + type httpd_$1_content_t; + ') + + allow $2 httpd_$1_content_t:dir r_dir_perms; + allow $2 httpd_$1_content_t:file r_file_perms; + allow $2 httpd_$1_content_t:lnk_file { getattr read }; +') diff --git a/refpolicy/policy/modules/services/apache.te b/refpolicy/policy/modules/services/apache.te index ba388b2c..63ebb521 100644 --- a/refpolicy/policy/modules/services/apache.te +++ b/refpolicy/policy/modules/services/apache.te @@ -1,5 +1,5 @@ -policy_module(apache,1.3.1) +policy_module(apache,1.3.2) # # NOTES: