some policy patches
Subsystems (2)
Nothing really exciting in this patch. Just some minor fixes and sorting out some of the distro-specific stuff.
Signature · 2 lines
US IT executives rate Red Hat #1 for value http://www.redhat.com/promo/vendor/index.html
domains/program/crond.te renamed from usr/src/se/policy/domains/program/crond.te +1 -1
@@ -26,6 +26,7 @@ crond_domain(system) +allow system_crond_t proc_mdstat_t:file { getattr read }; allow system_crond_t proc_t:lnk_file read; allow system_crond_t proc_t:filesystem getattr; allow system_crond_t usbdevfs_t:filesystem getattr;
@@ -160,7 +161,6 @@ # /sbin/runlevel needs lock access however dontaudit system_crond_t initrc_var_run_t:file write; allow system_crond_t initrc_var_run_t:file { getattr read lock }; -allow initrc_t system_cron_spool_t:file { getattr read }; # Access other spool directories like # /var/spool/anacron and /var/spool/slrnpull.
domains/program/getty.te renamed from usr/src/se/policy/domains/program/getty.te +0 -1
@@ -58,4 +58,3 @@ rw_dir_create_file(getty_t, var_lock_t) r_dir_file(getty_t, sysfs_t) -allow getty_t initrc_devpts_t:chr_file { read write };
domains/program/initrc.te renamed from usr/src/se/policy/domains/program/initrc.te +5 -3
@@ -49,7 +56,7 @@ allow initrc_t usbfs_t:file getattr; # allow initrc to fork and renice itself -allow initrc_t self:process { fork sigchld setsched setpgid setrlimit getsched }; +allow initrc_t self:process { fork sigchld getpgid setsched setpgid setrlimit getsched }; # Can create ptys for open_init_pty can_create_pty(initrc)
@@ -61,11 +68,13 @@ allow initrc_t var_run_t:dir { create rmdir }; ifdef(`distro_debian', ` -allow initrc_t etc_t:dir setattr; +allow initrc_t { etc_t device_t }:dir setattr; # for storing state under /dev/shm +allow initrc_t tmpfs_t:dir setattr; file_type_auto_trans(initrc_t, tmpfs_t, initrc_var_run_t, dir) -allow initrc_var_run_t tmpfs_t:filesystem associate; +file_type_auto_trans(initrc_t, tmpfs_t, fixed_disk_device_t, blk_file) +allow { initrc_var_run_t fixed_disk_device_t } tmpfs_t:filesystem associate; ') allow initrc_t framebuf_device_t:chr_file r_file_perms;
domains/program/ldconfig.te renamed from usr/src/se/policy/domains/program/ldconfig.te +7 -4
@@ -26,6 +26,7 @@ allow ldconfig_t lib_t:lnk_file create_lnk_perms; allow ldconfig_t userdomain:fd use; +# unlink for when /etc/ld.so.cache is mislabeled allow ldconfig_t etc_t:file { getattr read unlink }; allow ldconfig_t etc_t:lnk_file read;
@@ -37,12 +38,14 @@ dontaudit ldconfig_t httpd_modules_t:dir search; ') +ifdef(`distro_suse', ` +# because of libraries in /var/lib/samba/bin allow ldconfig_t { var_t var_lib_t }:dir search; +') + allow ldconfig_t proc_t:file read; +ifdef(`hide_broken_symptoms', ` ifdef(`unconfined.te',` dontaudit ldconfig_t unconfined_t:tcp_socket { read write }; -'); -ifdef(`targeted_policy', ` -allow ldconfig_t lib_t:file r_file_perms; -unconfined_domain(ldconfig_t) ') +')dnl end hide_broken_symptoms
domains/program/login.te renamed from usr/src/se/policy/domains/program/login.te +2 -4
@@ -73,7 +73,9 @@ # Set exec context. can_setexec($1_login_t) +ifdef(`automount.te', ` allow $1_login_t autofs_t:dir { search read getattr }; +') allow $1_login_t mnt_t:dir r_dir_perms; if (use_nfs_home_dirs) {
@@ -188,10 +185,6 @@ # Allow setting of attributes on power management devices. allow local_login_t power_device_t:chr_file { getattr setattr }; -ifdef(`hide_broken_symptoms', ` -dontaudit local_login_t init_t:fd use; -') - ################################# # # Rules for the remote_login_t domain.
domains/program/logrotate.te renamed from usr/src/se/policy/domains/program/logrotate.te +2 -1
@@ -21,12 +21,14 @@ type logrotate_exec_t, file_type, sysadmfile, exec_type; system_crond_entry(logrotate_exec_t, logrotate_t) +allow logrotate_t cron_spool_t:dir search; allow crond_t logrotate_var_lib_t:dir search; domain_auto_trans(sysadm_t, logrotate_exec_t, logrotate_t) allow logrotate_t self:unix_stream_socket create_socket_perms; allow logrotate_t devtty_t:chr_file rw_file_perms; ifdef(`distro_debian', ` +allow logrotate_t logrotate_tmp_t:file { relabelfrom relabelto }; # for savelog can_exec(logrotate_t, logrotate_exec_t) ')
@@ -49,7 +51,6 @@ # Create temporary files. tmp_domain(logrotate) can_exec(logrotate_t, logrotate_tmp_t) -allow logrotate_t logrotate_tmp_t:file { relabelfrom relabelto }; # Run helper programs. allow logrotate_t { bin_t sbin_t }:dir r_dir_perms;
domains/program/ssh.te renamed from usr/src/se/policy/domains/program/ssh.te +2 -1
@@ -73,7 +73,9 @@ allow $1_t self:capability { kill sys_chroot sys_resource chown dac_override fowner fsetid setgid setuid sys_tty_config }; allow $1_t { home_root_t home_dir_type }:dir { search getattr }; if (use_nfs_home_dirs) { +ifdef(`automount.te', ` allow $1_t autofs_t:dir { search getattr }; +') allow $1_t nfs_t:dir { search getattr }; allow $1_t nfs_t:file { getattr read }; }
@@ -226,4 +228,3 @@ allow ssh_keygen_t self:unix_stream_socket create_stream_socket_perms; allow ssh_keygen_t sysadm_tty_device_t:chr_file { read write }; allow ssh_keygen_t urandom_device_t:chr_file { getattr read }; -dontaudit sshd_t sysadm_tty_device_t:chr_file { read write };
domains/program/sulogin.te renamed from usr/src/se/policy/domains/program/sulogin.te +10 -1
@@ -16,9 +16,18 @@ general_domain_access(sulogin_t) domain_auto_trans({ initrc_t init_t }, sulogin_exec_t, sulogin_t) +allow sulogin_t initrc_t:process getpgid; uses_shlib(sulogin_t) + +# suse and debian do not use pam with sulogin... ifdef(`distro_suse', ` -# suse doesnt use pam with sulogin... +define(`sulogin_no_pam', `') +') +ifdef(`distro_debian', ` +define(`sulogin_no_pam', `') +') + +ifdef(`sulogin_no_pam', ` domain_auto_trans(sulogin_t, shell_exec_t, sysadm_t) allow sulogin_t init_t:process getpgid; allow sulogin_t self:capability sys_tty_config;
domains/program/tmpreaper.te renamed from usr/src/se/policy/domains/program/tmpreaper.te +1 -1
@@ -39,4 +37,4 @@ allow tmpreaper_t catman_t:dir setattr; ') read_locale(tmpreaper_t) -dontaudit tmpreaper_t init_t:fd use; +
domains/program/unused/amanda.te renamed from usr/src/se/policy/domains/program/unused/amanda.te +2 -0
@@ -241,6 +241,8 @@ allow amanda_recover_t self:process { fork sigkill sigstop sigchld signal }; allow amanda_recover_t self:capability { fowner fsetid setgid setuid chown dac_override net_bind_service }; allow amanda_recover_t shell_exec_t:file { execute execute_no_trans getattr read }; +allow amanda_recover_t privfd:fd use; + # amrecover network and process communication #############################################
domains/program/unused/asterisk.te renamed from usr/src/se/policy/domains/program/unused/asterisk.te +2 -2
@@ -48,8 +48,8 @@ allow asterisk_t self:sem create_sem_perms; allow asterisk_t self:shm create_shm_perms; -# for /var/run/asterisk -allow asterisk_t self:capability dac_override; +# dac_override for /var/run/asterisk +allow asterisk_t self:capability { dac_override setgid setuid sys_nice }; # for shutdown dontaudit asterisk_t self:capability sys_tty_config;
domains/program/unused/backup.te renamed from usr/src/se/policy/domains/program/unused/backup.te +1 -1
@@ -26,7 +26,7 @@ # for SSP allow backup_t urandom_device_t:chr_file read; -can_network_server(backup_t) +can_network_client(backup_t) can_ypbind(backup_t) uses_shlib(backup_t)
domains/program/unused/bootloader.te renamed from usr/src/se/policy/domains/program/unused/bootloader.te +24 -3
@@ -10,7 +10,7 @@ # # bootloader_exec_t is the type of the bootloader executable. # -type bootloader_t, domain, privlog, privmem, fs_domain, nscd_client_domain ifdef(`direct_sysadm_daemon', `, priv_system_role'); +type bootloader_t, domain, privlog, privmem, fs_domain, nscd_client_domain ifdef(`direct_sysadm_daemon', `, priv_system_role') ifdef(`distro_debian', `, privowner, admin'); type bootloader_exec_t, file_type, sysadmfile, exec_type; etc_domain(bootloader) typealias bootloader_etc_t alias etc_bootloader_t;
@@ -28,8 +28,7 @@ domain_auto_trans(sysadm_t, bootloader_exec_t, bootloader_t) allow bootloader_t { initrc_t privfd }:fd use; -tmp_domain(bootloader, `, device_type') -allow bootloader_t bootloader_tmp_t:{ devfile_class_set lnk_file } create_file_perms; +tmp_domain(bootloader, `, device_type', { dir file lnk_file chr_file blk_file }) read_locale(bootloader_t)
@@ -39,12 +38,33 @@ # for /vmlinuz sym link allow bootloader_t root_t:lnk_file read; +# lilo would need read access to get BIOS data +allow bootloader_t proc_kcore_t:file getattr; + allow bootloader_t { etc_t device_t }:dir r_dir_perms; allow bootloader_t etc_t:file r_file_perms; allow bootloader_t etc_t:lnk_file read; +allow bootloader_t initctl_t:fifo_file getattr; uses_shlib(bootloader_t) +ifdef(`distro_debian', ` +allow bootloader_t bootloader_tmp_t:{ dir file } { relabelfrom relabelto }; +allow bootloader_t modules_object_t:file { relabelfrom relabelto unlink }; +allow bootloader_t boot_t:file relabelfrom; +allow bootloader_t { usr_t lib_t fsadm_exec_t }:file relabelto; +allow bootloader_t { usr_t lib_t fsadm_exec_t }:file create_file_perms; +allow bootloader_t usr_t:lnk_file read; +allow bootloader_t tmpfs_t:dir r_dir_perms; +allow bootloader_t initrc_var_run_t:dir r_dir_perms; +allow bootloader_t var_lib_t:dir search; +allow bootloader_t dpkg_var_lib_t:dir r_dir_perms; +allow bootloader_t dpkg_var_lib_t:file { getattr read }; +# for /usr/share/initrd-tools/scripts +can_exec(bootloader_t, usr_t) +') + allow bootloader_t { fixed_disk_device_t removable_device_t }:blk_file rw_file_perms; +dontaudit bootloader_t device_t:{ chr_file blk_file } rw_file_perms; allow bootloader_t device_t:lnk_file { getattr read }; # LVM2 / Device Mapper's /dev/mapper/control
@@ -52,6 +72,7 @@ ifdef(`lvm.te', ` allow bootloader_t lvm_control_t:chr_file rw_file_perms; domain_auto_trans(bootloader_t, lvm_exec_t, lvm_t) +allow lvm_t bootloader_tmp_t:file rw_file_perms; r_dir_file(bootloader_t, lvm_etc_t) ')
domains/program/unused/ciped.te renamed from usr/src/se/policy/domains/program/unused/ciped.te +1 -1
@@ -7,7 +7,7 @@ type cipe_port_t, port_type; -can_network_server(ciped_t) +can_network_udp(ciped_t) can_ypbind(ciped_t) allow ciped_t cipe_port_t:udp_socket name_bind;
domains/program/unused/cups.te renamed from usr/src/se/policy/domains/program/unused/cups.te +2 -0
@@ -33,8 +33,10 @@ # temporary solution, we need something better allow cupsd_t serial_device:chr_file rw_file_perms; +ifdef(`usbmodules.te', ` r_dir_file(cupsd_t, usbdevfs_t) r_dir_file(cupsd_t, usbfs_t) +') ifdef(`logrotate.te', ` domain_auto_trans(logrotate_t, cupsd_exec_t, cupsd_t)
domains/program/unused/dpkg.te renamed from usr/src/se/policy/domains/program/unused/dpkg.te +1 -1
@@ -179,7 +179,7 @@ typealias apt_etc_t alias etc_apt_t; type apt_rw_etc_t, file_type, sysadmfile; typealias apt_rw_etc_t alias etc_apt_rw_t; -tmp_domain(apt) +tmp_domain(apt, `', `{ dir file lnk_file }') can_exec(apt_t, apt_tmp_t) rw_dir_create_file(apt_t, apt_rw_etc_t)
domains/program/unused/ftpd.te renamed from usr/src/se/policy/domains/program/unused/ftpd.te +6 -1
@@ -34,7 +34,10 @@ allow system_crond_t xferlog_t:file r_file_perms; can_exec(ftpd_t, { sbin_t shell_exec_t }) allow ftpd_t usr_t:file { getattr read }; -') +ifdef(`logrotate.te', ` +can_exec(ftpd_t, logrotate_exec_t) +')dnl end if logrotate.te +')dnl end if crond.te allow ftpd_t ftp_data_port_t:tcp_socket name_bind; allow ftpd_t port_t:tcp_socket name_bind;
@@ -87,7 +90,9 @@ dontaudit ftpd_t sysadm_home_dir_t:dir getattr; dontaudit ftpd_t selinux_config_t:dir search; +ifdef(`automount.te', ` allow ftpd_t autofs_t:dir search; +') allow ftpd_t self:file { getattr read }; tmp_domain(ftpd)
domains/program/unused/hotplug.te renamed from usr/src/se/policy/domains/program/unused/hotplug.te +1 -1
@@ -163,4 +163,4 @@ unconfined_domain(hotplug_t) ') - allow kernel_t hotplug_etc_t:dir search; +allow kernel_t hotplug_etc_t:dir search;
domains/program/unused/inetd.te renamed from usr/src/se/policy/domains/program/unused/inetd.te +2 -0
@@ -55,6 +58,8 @@ inetd_child_domain(inetd_child) +allow inetd_child_t proc_net_t:dir search; +allow inetd_child_t proc_net_t:file { getattr read }; ifdef(`unconfined.te', ` domain_auto_trans(inetd_t, unconfined_exec_t, unconfined_t)
domains/program/unused/iptables.te renamed from usr/src/se/policy/domains/program/unused/iptables.te +1 -1
@@ -36,7 +36,7 @@ # for iptables -L allow iptables_t self:unix_stream_socket create_socket_perms; -can_network_server(iptables_t) +can_resolve(iptables_t) can_ypbind(iptables_t) allow iptables_t iptables_exec_t:file execute_no_trans;
domains/program/unused/lpd.te renamed from usr/src/se/policy/domains/program/unused/lpd.te +1 -1
@@ -36,7 +36,7 @@ type checkpc_t, domain, privlog; role system_r types checkpc_t; uses_shlib(checkpc_t) -can_network_server(checkpc_t) +can_network_client(checkpc_t) can_ypbind(checkpc_t) log_domain(checkpc) type checkpc_exec_t, file_type, sysadmfile, exec_type;
domains/program/unused/mdadm.te renamed from usr/src/se/policy/domains/program/unused/mdadm.te +1 -0
@@ -27,6 +27,7 @@ # RAID block device access allow mdadm_t fixed_disk_device_t:blk_file create_file_perms; +allow mdadm_t device_t:lnk_file { getattr read }; # Ignore attempts to read every device file dontaudit mdadm_t device_type:{ chr_file blk_file } getattr;
domains/program/unused/mrtg.te renamed from usr/src/se/policy/domains/program/unused/mrtg.te +3 -2
@@ -31,7 +31,7 @@ r_dir_file(mrtg_t, lib_t) # Use the network. -can_network_server(mrtg_t) +can_network_client(mrtg_t) can_ypbind(mrtg_t) allow mrtg_t self:fifo_file { getattr read write ioctl };
@@ -53,7 +53,8 @@ r_dir_file(mrtg_t, snmpd_var_lib_t) ') -allow mrtg_t proc_t:file { read getattr }; +allow mrtg_t proc_net_t:dir search; +allow mrtg_t { proc_t proc_net_t }:file { read getattr }; dontaudit mrtg_t proc_t:file ioctl; allow mrtg_t { var_lock_t var_lib_t }:dir search;
domains/program/unused/named.te renamed from usr/src/se/policy/domains/program/unused/named.te +3 -3
@@ -84,7 +84,7 @@ allow named_t sysctl_kernel_t:dir r_dir_perms; allow named_t sysctl_kernel_t:file r_file_perms; -# Read /proc/cpuinfo. +# Read /proc/cpuinfo and /proc/net r_dir_file(named_t, proc_t) r_dir_file(named_t, proc_net_t)
@@ -109,6 +109,8 @@ # for /etc/rndc.key ifdef(`distro_redhat', ` allow { ndc_t initrc_t } named_conf_t:dir search; +# Allow init script to cp localtime to named_conf_t +allow initrc_t named_conf_t:file { setattr write }; ') allow { ndc_t initrc_t } named_conf_t:file { getattr read };
@@ -153,5 +155,3 @@ ') allow ndc_t self:netlink_route_socket r_netlink_socket_perms; dontaudit ndc_t sysadm_tty_device_t:chr_file { ioctl }; -# Allow init script to cp localtime to named_conf_t -allow initrc_t named_conf_t:file { write };
domains/program/unused/nessusd.te renamed from usr/src/se/policy/domains/program/unused/nessusd.te +1 -1
@@ -22,7 +22,7 @@ #tmp_domain(nessusd) # Use the network. -can_network_server(nessusd_t) +can_network(nessusd_t) can_ypbind(nessusd_t) allow nessusd_t self:unix_stream_socket create_socket_perms; #allow nessusd_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/nscd.te renamed from usr/src/se/policy/domains/program/unused/nscd.te +3 -1
@@ -56,6 +56,7 @@ dontaudit nscd_t sysadm_home_dir_t:dir search; +ifdef(`winbind.te', ` # # Handle winbind for samba, Might only be needed for targeted policy #
@@ -63,6 +64,7 @@ can_unix_connect(nscd_t, winbind_t) allow nscd_t samba_var_t:dir search; allow nscd_t winbind_var_run_t:dir { getattr search }; +') r_dir_file(nscd_t, selinux_config_t) can_getsecurity(nscd_t)
@@ -70,4 +72,4 @@ allow nscd_t self:netlink_route_socket r_netlink_socket_perms; allow nscd_t tmp_t:dir { search getattr }; allow nscd_t tmp_t:lnk_file read; -allow nscd_t { urandom_device_t random_device_t }:chr_file { getattr read }; +allow nscd_t urandom_device_t:chr_file { getattr read };
domains/program/unused/nsd.te renamed from usr/src/se/policy/domains/program/unused/nsd.te +1 -1
@@ -19,7 +19,7 @@ type nsd_crond_t, domain, privlog; role system_r types nsd_crond_t; uses_shlib(nsd_crond_t) -can_network_server(nsd_crond_t) +can_network_client(nsd_crond_t) can_ypbind(nsd_crond_t) allow nsd_crond_t self:unix_dgram_socket create_socket_perms; allow nsd_crond_t self:process { fork signal_perms };
Merged.
Except that a chunk in ssh.te and login.te reverted Dan's removal of ifdef(`automount.te' statements. Was there a reason for this?
Quoted 2 lines · Russell Coker
Nothing really exciting in this patch. Just some minor fixes and sorting out some of the distro-specific stuff.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- 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 · James Carter
Merged.
Except that a chunk in ssh.te and login.te reverted Dan's removal of ifdef(`automount.te' statements. Was there a reason for this?
Quoted 3 lines · Russell Coker
Nothing really exciting in this patch. Just some minor fixes and sorting out some of the distro-specific stuff.
automount.te statements break targeted policy and autofs is defined outside of automount.te so they should not be there.
Dan
--
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.
More patches
In reply to James CarterIvan has some more cleanup of x_client apps.
Also added execmod to httpd for php
Moved +r_dir_file(httpd_t, httpd_$1_content_t) outside boolean
so you should be able to serve pages with httpd with all booleans turned off.
You are missing NetworkManager from your latest pool, even though comment says it is there.
Dan
domains/program/unused/apache.te +6 -0
@@ -119,6 +119,12 @@ allow httpd_t port_type:tcp_socket name_connect; } +########################################## +# Legacy: remove when it's fixed # +# Allow libphp5.so with text relocations # +########################################## +allow httpd_t texrel_shlib_t:file execmod; + ######################################### # Allow httpd to search users directories #########################################
domains/program/unused/hald.te +0 -1
@@ -31,7 +31,6 @@ allow hald_t usr_t:file { getattr read }; allow hald_t bin_t:file getattr; -allow hald_t self:netlink_socket create_socket_perms; allow hald_t self:netlink_kobject_uevent_socket create_socket_perms; allow hald_t self:netlink_route_socket r_netlink_socket_perms; allow hald_t self:capability { net_admin sys_admin dac_override dac_read_search mknod };
domains/program/unused/NetworkManager.te +78 -0
78 lines not on this page · raw message
file_contexts/distros.fc +3 -1
@@ -69,7 +69,7 @@ # Some of them should be fixed and removed from this list # Fedora Core packages: gstreamer-plugins, compat-libstdc++, Glide3, libdv -# HelixPlayer, SDL, xorg-x11, xorg-x11-libs, Hermes, valgrind, openoffice.org-libs +# HelixPlayer, SDL, xorg-x11, xorg-x11-libs, Hermes, valgrind, openoffice.org-libs, httpd - php /usr/lib/gstreamer-.*/libgstffmpeg\.so.* -- system_u:object_r:texrel_shlib_t /usr/lib/gstreamer-.*/libgsthermescolorspace\.so -- system_u:object_r:texrel_shlib_t /usr/lib/gstreamer-.*/libgstmms\.so -- system_u:object_r:texrel_shlib_t
@@ -123,6 +123,8 @@ /usr/lib/ladspa/se4_1883\.so -- system_u:object_r:texrel_shlib_t /usr/lib/libImlib2\.so.* -- system_u:object_r:texrel_shlib_t /usr/lib/ocaml/stublibs/dllnums\.so -- system_u:object_r:texrel_shlib_t +/usr/lib/httpd/modules/libphp5\.so -- system_u:object_r:texrel_shlib_t +/usr/lib/php/modules/.*\.so -- system_u:object_r:texrel_shlib_t # Livna.org packages: xmms-mp3, ffmpeg, xvidcore, xine-lib, gsm, lame /usr/lib/xmms/Input/libmpg123\.so -- system_u:object_r:texrel_shlib_t
file_contexts/program/NetworkManager.fc +2 -0
@@ -0,0 +1,2 @@ +# NetworkManager +/usr/bin/NetworkManager -- system_u:object_r:NetworkManager_exec_t
macros/base_user_macros.te +4 -10
@@ -282,6 +280,9 @@ # dontaudit $1_t usr_t:file setattr; +# Use X +x_client_domain($1, $1) + ifdef(`xserver.te', ` # for /tmp/.ICE-unix file_type_auto_trans($1_t, xdm_xserver_tmp_t, $1_tmp_t, sock_file)
@@ -291,13 +292,7 @@ ifdef(`xdm.te', ` # Connect to the X server run by the X Display Manager. can_unix_connect($1_t, xdm_t) -allow $1_t xdm_tmp_t:sock_file rw_file_perms; -allow $1_t xdm_tmp_t:dir r_dir_perms; -allow $1_t xdm_tmp_t:file { getattr read }; -allow $1_t xdm_xserver_tmp_t:sock_file { read write }; -allow $1_t xdm_xserver_tmp_t:dir search; -allow $1_t xdm_xserver_t:unix_stream_socket connectto; -# certain apps want to read xdm.pid file +# certain apps want to read xdm.pid file r_dir_file($1_t, xdm_var_run_t) allow $1_t xdm_var_lib_t:file { getattr read }; allow xdm_t $1_home_dir_t:dir getattr;
@@ -305,9 +300,6 @@ file_type_auto_trans(xdm_t, $1_home_dir_t, $1_xauth_home_t, file) ') -# for shared memory -allow xdm_xserver_t $1_tmpfs_t:file { read write }; - ')dnl end ifdef xdm.te # Access the sound device.
macros/program/apache_macros.te +1 -1
@@ -136,8 +136,8 @@ r_dir_file(httpd_t, httpd_$1_script_ro_t) create_dir_file(httpd_t, httpd_$1_script_rw_t) ra_dir_file(httpd_t, httpd_$1_script_ra_t) -r_dir_file(httpd_t, httpd_$1_content_t) } +r_dir_file(httpd_t, httpd_$1_content_t) ') define(`apache_user_domain', `
macros/program/gift_macros.te +5 -2
@@ -18,7 +18,7 @@ role $1_r types $1_gift_t; # X access, Home files -x_client_domain($1, gift) +x_client_domain($1_gift, $1) home_domain($1, gift) uses_shlib($1_gift_t)
@@ -26,12 +26,15 @@ read_sysctl($1_gift_t) access_terminal($1_gift_t, $1) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_gift_t) +allow $1_t $1_gift_t:process signal_perms; + # Self permissions allow $1_gift_t self:process getsched; # Fonts, icons r_dir_file($1_gift_t, usr_t) -r_dir_file($1_gift_t, fonts_t) # Launch gift daemon allow $1_gift_t bin_t:dir search;
macros/program/java_macros.te +3 -30
@@ -32,7 +32,6 @@ allow $1_javaplugin_t port_type:tcp_socket name_connect; can_ypbind($1_javaplugin_t) allow $1_javaplugin_t self:process { fork signal_perms getsched setsched }; -allow $1_javaplugin_t self:unix_stream_socket { connectto create_stream_socket_perms }; allow $1_javaplugin_t self:fifo_file rw_file_perms; allow $1_javaplugin_t etc_runtime_t:file { getattr read }; allow $1_javaplugin_t fs_t:filesystem getattr;
@@ -58,36 +57,9 @@ if (allow_execmem) { allow $1_javaplugin_t self:process execmem; } -# Allow connections to X server. -ifdef(`xserver.te', ` -ifdef(`xdm.te', ` -# for when /tmp/.X11-unix is created by the system -allow $1_javaplugin_t xdm_xserver_tmp_t:dir search; -allow $1_javaplugin_t xdm_t:fifo_file rw_file_perms; -allow $1_javaplugin_t xdm_tmp_t:dir search; -allow $1_javaplugin_t xdm_tmp_t:sock_file write; -') - -ifdef(`startx.te', ` -# for when /tmp/.X11-unix is created by the X server -allow $1_javaplugin_t $2_xserver_tmp_t:dir search; - -# for /tmp/.X0-lock -allow $1_javaplugin_t $2_xserver_tmp_t:file getattr; - -allow $1_javaplugin_t $2_xserver_tmp_t:sock_file rw_file_perms; -can_unix_connect($1_javaplugin_t, $2_xserver_t) -')dnl end startx - -can_unix_connect($1_javaplugin_t, xdm_xserver_t) -allow xdm_xserver_t $1_javaplugin_t:fd use; -allow xdm_xserver_t $1_javaplugin_t:shm { associate getattr read unix_read }; -dontaudit xdm_xserver_t $1_javaplugin_t:shm { unix_write write }; - -')dnl end xserver - -allow $1_javaplugin_t self:shm create_shm_perms; +# Connect to X server +x_client_domain($1_javaplugin, $2) uses_shlib($1_javaplugin_t) read_locale($1_javaplugin_t)
@@ -121,4 +93,5 @@ # Do not audit read/getattr of .fonts-cache-1 dontaudit $1_javaplugin_t $1_home_t:file { read getattr }; + ')
macros/program/mozilla_macros.te +5 -1
@@ -26,7 +26,7 @@ # X access, Home files home_domain($1, mozilla) -x_client_domain($1, mozilla) +x_client_domain($1_mozilla, $1) # Browse files file_browse_domain($1_mozilla_t)
@@ -43,6 +43,10 @@ allow $1_t $1_mozilla_t:process { noatsecure siginh rlimitinh }; allow $1_mozilla_t $1_t:process signull; +# Allow the user domain to signal/ps. +can_ps($1_t, $1_mozilla_t) +allow $1_t $1_mozilla_t:process signal_perms; + # Fork, set resource limits and scheduling info. allow $1_mozilla_t self:process { fork signal_perms setrlimit setsched getsched };
macros/program/mplayer_macros.te +5 -1
@@ -15,6 +15,10 @@ # Read global config r_dir_file($1_$2_t, mplayer_etc_t) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_$2_t) +allow $1_t $1_$2_t:process signal_perms; + # Read data in /usr/share (fonts, icons..) r_dir_file($1_$2_t, usr_t)
@@ -72,7 +76,7 @@ # Home access, X access, Browse files home_domain($1, mplayer) -x_client_domain($1, mplayer) +x_client_domain($1_mplayer, $1) file_browse_domain($1_mplayer_t) # Mplayer common stuff
macros/program/ssh_agent_macros.te +1 -1
@@ -63,7 +63,7 @@ allow $1_ssh_agent_t self:capability setgid; # access the random devices -allow $1_ssh_agent_t { random_device_t urandom_device_t }:chr_file read; +allow $1_ssh_agent_t { random_device_t urandom_device_t }:chr_file { getattr read }; # for ssh-add can_unix_connect($1_t, $1_ssh_agent_t)
macros/program/ssh_macros.te +2 -22
@@ -129,18 +129,8 @@ # allow ps to show ssh can_ps($1_t, $1_ssh_t) -ifdef(`xserver.te', ` -# Communicate with the X server. -ifdef(`startx.te', ` -can_unix_connect($1_ssh_t, $1_xserver_t) -allow $1_ssh_t $1_xserver_tmp_t:sock_file rw_file_perms; -allow $1_ssh_t $1_xserver_tmp_t:dir search; -')dnl end if startx -ifdef(`xdm.te', ` -allow $1_ssh_t { xdm_xserver_tmp_t xdm_tmp_t }:dir search; -allow $1_ssh_t { xdm_tmp_t }:sock_file write; -') -')dnl end if xserver +# Connect to X server +x_client_domain($1_ssh, $1) ifdef(`ssh-agent.te', ` ssh_agent_domain($1)
@@ -167,16 +157,6 @@ allow $1_ssh_keysign_t self:file { getattr read }; allow $1_ssh_keysign_t self:unix_stream_socket create_socket_perms; -ifdef(`xdm.te', ` -# should be able to remove these two later -allow $1_ssh_t xdm_xserver_tmp_t:sock_file { read write }; -allow $1_ssh_t xdm_xserver_tmp_t:dir search; -allow $1_ssh_t xdm_xserver_t:unix_stream_socket connectto; -allow $1_ssh_t xdm_xserver_t:shm r_shm_perms; -allow $1_ssh_t xdm_xserver_t:fd use; -allow $1_ssh_t xdm_xserver_tmpfs_t:file read; -allow $1_ssh_t xdm_t:fd use; -')dnl end if xdm.te ')dnl end macro definition ', `
macros/program/tvtime_macros.te +5 -1
@@ -26,13 +26,17 @@ # X access, Home files home_domain($1, tvtime) -x_client_domain($1, tvtime) +x_client_domain($1_tvtime, $1) uses_shlib($1_tvtime_t) read_locale($1_tvtime_t) read_sysctl($1_tvtime_t) access_terminal($1_tvtime_t, $1) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_tvtime_t) +allow $1_t $1_tvtime_t:process signal_perms; + # Read /etc/tvtime allow $1_tvtime_t etc_t:file { getattr read };
macros/program/x_client_macros.te +35 -32
119 lines not on this page · raw message
man/man8/httpd_selinux.8 +15 -0
@@ -75,6 +75,21 @@ setsebool -P httpd_unified 0 .TP +httpd can be configured to turn off internal scripting (PHP). PHP and other +loadable modules run under the same context as httpd. Therefore several policy rules allow httpd greater access to the system then is needed if you only use external cgi scripts. +.br + +setsebool -P httpd_builtin_scripting 0 + +.TP +httpd scripts by default are not allowed to connect out to the network. +This would prevent a hacker from breaking into you httpd server and attacking +other machines. If you need scripts to be able to connect you can set the httpd_can_network_connect boolean on. +.br + +setsebool -P httpd_can_network_connect 1 + +.TP You can disable SELinux protection for the httpd daemon by executing: .br
targeted/domains/program/modutil.te +0 -17
@@ -1,17 +0,0 @@ -#DESC Modutil - Dynamic module utilities -# -# Authors: Stephen Smalley <[email protected]> and Timothy Fraser -# X-Debian-Packages: modutils -# - -################################# -# -# Rules for the module utility domains. -# -type modules_dep_t, file_type, sysadmfile; -type modules_conf_t, file_type, sysadmfile; -type modules_object_t, file_type, sysadmfile; -type depmod_exec_t, file_type, exec_type, sysadmfile; -type insmod_exec_t, file_type, exec_type, sysadmfile; -type update_modules_exec_t, file_type, exec_type, sysadmfile; -
tunables/distro.tun +1 -1
@@ -5,7 +5,7 @@ # appropriate ifdefs. -dnl define(`distro_redhat') +define(`distro_redhat') dnl define(`distro_suse')
tunables/tunable.tun +6 -6
@@ -1,27 +1,27 @@ # Allow users to execute the mount command -dnl define(`user_can_mount') +define(`user_can_mount') # Allow rpm to run unconfined. -dnl define(`unlimitedRPM') +define(`unlimitedRPM') # Allow privileged utilities like hotplug and insmod to run unconfined. -dnl define(`unlimitedUtils') +define(`unlimitedUtils') # Allow rc scripts to run unconfined, including any daemon # started by an rc script that does not have a domain transition # explicitly defined. -dnl define(`unlimitedRC') +define(`unlimitedRC') # Allow sysadm_t to directly start daemons define(`direct_sysadm_daemon') # Do not audit things that we know to be broken but which # are not security risks -dnl define(`hide_broken_symptoms') +define(`hide_broken_symptoms') # Allow user_r to reach sysadm_r via su, sudo, or userhelper. # Otherwise, only staff_r can do so. -dnl define(`user_canbe_sysadm') +define(`user_canbe_sysadm') # Allow xinetd to run unconfined, including any services it starts # that do not have a domain transition explicitly defined.
Re: More patches
Quoted 8 lines · Daniel J Walsh
Ivan has some more cleanup of
x_clientapps.
Also added execmod to httpd for php
Moved +r_dir_file(httpd_t, httpd_$1_content_t) outside boolean so you should be able to serve pages with httpd with all booleans turned off.You are missing NetworkManager from your latest pool, even though comment says it is there.
Forgot to cvs add it on sourceforge. It is committed now.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- 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.
Re: More patches
Quoted 8 lines · James Carter
Quoted 5 lines · Daniel J Walsh
Ivan has some more cleanup of
x_clientapps.
Also added execmod to httpd for php
Moved +r_dir_file(httpd_t, httpd_$1_content_t) outside boolean
so you should be able to serve pages with httpd with all booleans turned off.
Quoted 9 lines
Quoted 3 lines
You are missing NetworkManager from your latest pool, even though comment says it is there.
Forgot to cvs add it on sourceforge. It is committed now.
Hold off on that patch. Some of the x_client changes are not working correctly. I will submit a fixed patch soon.
Dan
Signature · 4 lines
-- 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.
Re: More patches
In reply to James CarterFixed the patches, so they will build.
domains/program/unused/apache.te +6 -0
@@ -119,6 +119,12 @@ allow httpd_t port_type:tcp_socket name_connect; } +########################################## +# Legacy: remove when it's fixed # +# Allow libphp5.so with text relocations # +########################################## +allow httpd_t texrel_shlib_t:file execmod; + ######################################### # Allow httpd to search users directories #########################################
domains/program/unused/hald.te +0 -1
@@ -31,7 +31,6 @@ allow hald_t usr_t:file { getattr read }; allow hald_t bin_t:file getattr; -allow hald_t self:netlink_socket create_socket_perms; allow hald_t self:netlink_kobject_uevent_socket create_socket_perms; allow hald_t self:netlink_route_socket r_netlink_socket_perms; allow hald_t self:capability { net_admin sys_admin dac_override dac_read_search mknod };
domains/program/unused/NetworkManager.te +78 -0
78 lines not on this page · raw message
file_contexts/distros.fc +3 -1
@@ -69,7 +69,7 @@ # Some of them should be fixed and removed from this list # Fedora Core packages: gstreamer-plugins, compat-libstdc++, Glide3, libdv -# HelixPlayer, SDL, xorg-x11, xorg-x11-libs, Hermes, valgrind, openoffice.org-libs +# HelixPlayer, SDL, xorg-x11, xorg-x11-libs, Hermes, valgrind, openoffice.org-libs, httpd - php /usr/lib/gstreamer-.*/libgstffmpeg\.so.* -- system_u:object_r:texrel_shlib_t /usr/lib/gstreamer-.*/libgsthermescolorspace\.so -- system_u:object_r:texrel_shlib_t /usr/lib/gstreamer-.*/libgstmms\.so -- system_u:object_r:texrel_shlib_t
@@ -123,6 +123,8 @@ /usr/lib/ladspa/se4_1883\.so -- system_u:object_r:texrel_shlib_t /usr/lib/libImlib2\.so.* -- system_u:object_r:texrel_shlib_t /usr/lib/ocaml/stublibs/dllnums\.so -- system_u:object_r:texrel_shlib_t +/usr/lib/httpd/modules/libphp5\.so -- system_u:object_r:texrel_shlib_t +/usr/lib/php/modules/.*\.so -- system_u:object_r:texrel_shlib_t # Livna.org packages: xmms-mp3, ffmpeg, xvidcore, xine-lib, gsm, lame /usr/lib/xmms/Input/libmpg123\.so -- system_u:object_r:texrel_shlib_t
file_contexts/program/NetworkManager.fc +2 -0
@@ -0,0 +1,2 @@ +# NetworkManager +/usr/bin/NetworkManager -- system_u:object_r:NetworkManager_exec_t
macros/base_user_macros.te +4 -12
@@ -124,8 +124,6 @@ # Use the type when relabeling pty devices. type_change $1_t server_pty:chr_file $1_devpts_t; -tmpfs_domain($1) - ifdef(`cardmgr.te', ` # to allow monitoring of pcmcia status allow $1_t cardmgr_var_run_t:file { getattr read };
@@ -282,6 +280,9 @@ # dontaudit $1_t usr_t:file setattr; +# Use X +x_client_domain($1, $1) + ifdef(`xserver.te', ` # for /tmp/.ICE-unix file_type_auto_trans($1_t, xdm_xserver_tmp_t, $1_tmp_t, sock_file)
@@ -291,13 +292,7 @@ ifdef(`xdm.te', ` # Connect to the X server run by the X Display Manager. can_unix_connect($1_t, xdm_t) -allow $1_t xdm_tmp_t:sock_file rw_file_perms; -allow $1_t xdm_tmp_t:dir r_dir_perms; -allow $1_t xdm_tmp_t:file { getattr read }; -allow $1_t xdm_xserver_tmp_t:sock_file { read write }; -allow $1_t xdm_xserver_tmp_t:dir search; -allow $1_t xdm_xserver_t:unix_stream_socket connectto; -# certain apps want to read xdm.pid file +# certain apps want to read xdm.pid file r_dir_file($1_t, xdm_var_run_t) allow $1_t xdm_var_lib_t:file { getattr read }; allow xdm_t $1_home_dir_t:dir getattr;
@@ -305,9 +300,6 @@ file_type_auto_trans(xdm_t, $1_home_dir_t, $1_xauth_home_t, file) ') -# for shared memory -allow xdm_xserver_t $1_tmpfs_t:file { read write }; - ')dnl end ifdef xdm.te # Access the sound device.
macros/global_macros.te +3 -0
@@ -433,11 +433,14 @@ ') define(`tmpfs_domain', ` +ifdef(`$1_tmpfs_t_defined',`', ` +define(`$1_tmpfs_t_defined') type $1_tmpfs_t, file_type, sysadmfile, tmpfsfile; # Use this type when creating tmpfs/shm objects. file_type_auto_trans($1_t, tmpfs_t, $1_tmpfs_t) allow $1_tmpfs_t tmpfs_t:filesystem associate; ') +') define(`var_lib_domain', ` type $1_var_lib_t, file_type, sysadmfile;
macros/program/apache_macros.te +1 -1
@@ -136,8 +136,8 @@ r_dir_file(httpd_t, httpd_$1_script_ro_t) create_dir_file(httpd_t, httpd_$1_script_rw_t) ra_dir_file(httpd_t, httpd_$1_script_ra_t) -r_dir_file(httpd_t, httpd_$1_content_t) } +r_dir_file(httpd_t, httpd_$1_content_t) ') define(`apache_user_domain', `
macros/program/games_domain.te +1 -1
@@ -20,7 +20,7 @@ role $1_r types $1_games_t; # X access, /tmp files -x_client_domain($1, games) +x_client_domain($1_games, $1) tmp_domain($1_games) uses_shlib($1_games_t)
macros/program/gift_macros.te +5 -2
@@ -18,7 +18,7 @@ role $1_r types $1_gift_t; # X access, Home files -x_client_domain($1, gift) +x_client_domain($1_gift, $1) home_domain($1, gift) uses_shlib($1_gift_t)
@@ -26,12 +26,15 @@ read_sysctl($1_gift_t) access_terminal($1_gift_t, $1) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_gift_t) +allow $1_t $1_gift_t:process signal_perms; + # Self permissions allow $1_gift_t self:process getsched; # Fonts, icons r_dir_file($1_gift_t, usr_t) -r_dir_file($1_gift_t, fonts_t) # Launch gift daemon allow $1_gift_t bin_t:dir search;
macros/program/java_macros.te +3 -30
@@ -32,7 +32,6 @@ allow $1_javaplugin_t port_type:tcp_socket name_connect; can_ypbind($1_javaplugin_t) allow $1_javaplugin_t self:process { fork signal_perms getsched setsched }; -allow $1_javaplugin_t self:unix_stream_socket { connectto create_stream_socket_perms }; allow $1_javaplugin_t self:fifo_file rw_file_perms; allow $1_javaplugin_t etc_runtime_t:file { getattr read }; allow $1_javaplugin_t fs_t:filesystem getattr;
@@ -58,36 +57,9 @@ if (allow_execmem) { allow $1_javaplugin_t self:process execmem; } -# Allow connections to X server. -ifdef(`xserver.te', ` -ifdef(`xdm.te', ` -# for when /tmp/.X11-unix is created by the system -allow $1_javaplugin_t xdm_xserver_tmp_t:dir search; -allow $1_javaplugin_t xdm_t:fifo_file rw_file_perms; -allow $1_javaplugin_t xdm_tmp_t:dir search; -allow $1_javaplugin_t xdm_tmp_t:sock_file write; -') - -ifdef(`startx.te', ` -# for when /tmp/.X11-unix is created by the X server -allow $1_javaplugin_t $2_xserver_tmp_t:dir search; - -# for /tmp/.X0-lock -allow $1_javaplugin_t $2_xserver_tmp_t:file getattr; - -allow $1_javaplugin_t $2_xserver_tmp_t:sock_file rw_file_perms; -can_unix_connect($1_javaplugin_t, $2_xserver_t) -')dnl end startx - -can_unix_connect($1_javaplugin_t, xdm_xserver_t) -allow xdm_xserver_t $1_javaplugin_t:fd use; -allow xdm_xserver_t $1_javaplugin_t:shm { associate getattr read unix_read }; -dontaudit xdm_xserver_t $1_javaplugin_t:shm { unix_write write }; - -')dnl end xserver - -allow $1_javaplugin_t self:shm create_shm_perms; +# Connect to X server +x_client_domain($1_javaplugin, $2) uses_shlib($1_javaplugin_t) read_locale($1_javaplugin_t)
@@ -121,4 +93,5 @@ # Do not audit read/getattr of .fonts-cache-1 dontaudit $1_javaplugin_t $1_home_t:file { read getattr }; + ')
macros/program/mozilla_macros.te +5 -1
@@ -26,7 +26,7 @@ # X access, Home files home_domain($1, mozilla) -x_client_domain($1, mozilla) +x_client_domain($1_mozilla, $1) # Browse files file_browse_domain($1_mozilla_t)
@@ -43,6 +43,10 @@ allow $1_t $1_mozilla_t:process { noatsecure siginh rlimitinh }; allow $1_mozilla_t $1_t:process signull; +# Allow the user domain to signal/ps. +can_ps($1_t, $1_mozilla_t) +allow $1_t $1_mozilla_t:process signal_perms; + # Fork, set resource limits and scheduling info. allow $1_mozilla_t self:process { fork signal_perms setrlimit setsched getsched };
macros/program/mplayer_macros.te +5 -1
@@ -15,6 +15,10 @@ # Read global config r_dir_file($1_$2_t, mplayer_etc_t) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_$2_t) +allow $1_t $1_$2_t:process signal_perms; + # Read data in /usr/share (fonts, icons..) r_dir_file($1_$2_t, usr_t)
@@ -72,7 +76,7 @@ # Home access, X access, Browse files home_domain($1, mplayer) -x_client_domain($1, mplayer) +x_client_domain($1_mplayer, $1) file_browse_domain($1_mplayer_t) # Mplayer common stuff
macros/program/ssh_agent_macros.te +1 -1
@@ -63,7 +63,7 @@ allow $1_ssh_agent_t self:capability setgid; # access the random devices -allow $1_ssh_agent_t { random_device_t urandom_device_t }:chr_file read; +allow $1_ssh_agent_t { random_device_t urandom_device_t }:chr_file { getattr read }; # for ssh-add can_unix_connect($1_t, $1_ssh_agent_t)
macros/program/ssh_macros.te +2 -22
@@ -129,18 +129,8 @@ # allow ps to show ssh can_ps($1_t, $1_ssh_t) -ifdef(`xserver.te', ` -# Communicate with the X server. -ifdef(`startx.te', ` -can_unix_connect($1_ssh_t, $1_xserver_t) -allow $1_ssh_t $1_xserver_tmp_t:sock_file rw_file_perms; -allow $1_ssh_t $1_xserver_tmp_t:dir search; -')dnl end if startx -ifdef(`xdm.te', ` -allow $1_ssh_t { xdm_xserver_tmp_t xdm_tmp_t }:dir search; -allow $1_ssh_t { xdm_tmp_t }:sock_file write; -') -')dnl end if xserver +# Connect to X server +x_client_domain($1_ssh, $1) ifdef(`ssh-agent.te', ` ssh_agent_domain($1)
@@ -167,16 +157,6 @@ allow $1_ssh_keysign_t self:file { getattr read }; allow $1_ssh_keysign_t self:unix_stream_socket create_socket_perms; -ifdef(`xdm.te', ` -# should be able to remove these two later -allow $1_ssh_t xdm_xserver_tmp_t:sock_file { read write }; -allow $1_ssh_t xdm_xserver_tmp_t:dir search; -allow $1_ssh_t xdm_xserver_t:unix_stream_socket connectto; -allow $1_ssh_t xdm_xserver_t:shm r_shm_perms; -allow $1_ssh_t xdm_xserver_t:fd use; -allow $1_ssh_t xdm_xserver_tmpfs_t:file read; -allow $1_ssh_t xdm_t:fd use; -')dnl end if xdm.te ')dnl end macro definition ', `
macros/program/tvtime_macros.te +5 -1
@@ -26,13 +26,17 @@ # X access, Home files home_domain($1, tvtime) -x_client_domain($1, tvtime) +x_client_domain($1_tvtime, $1) uses_shlib($1_tvtime_t) read_locale($1_tvtime_t) read_sysctl($1_tvtime_t) access_terminal($1_tvtime_t, $1) +# Allow the user domain to signal/ps. +can_ps($1_t, $1_tvtime_t) +allow $1_t $1_tvtime_t:process signal_perms; + # Read /etc/tvtime allow $1_tvtime_t etc_t:file { getattr read };
macros/program/x_client_macros.te +35 -32
119 lines not on this page · raw message
man/man8/httpd_selinux.8 +15 -0
@@ -75,6 +75,21 @@ setsebool -P httpd_unified 0 .TP +httpd can be configured to turn off internal scripting (PHP). PHP and other +loadable modules run under the same context as httpd. Therefore several policy rules allow httpd greater access to the system then is needed if you only use external cgi scripts. +.br + +setsebool -P httpd_builtin_scripting 0 + +.TP +httpd scripts by default are not allowed to connect out to the network. +This would prevent a hacker from breaking into you httpd server and attacking +other machines. If you need scripts to be able to connect you can set the httpd_can_network_connect boolean on. +.br + +setsebool -P httpd_can_network_connect 1 + +.TP You can disable SELinux protection for the httpd daemon by executing: .br
targeted/domains/program/modutil.te +0 -17
@@ -1,17 +0,0 @@ -#DESC Modutil - Dynamic module utilities -# -# Authors: Stephen Smalley <[email protected]> and Timothy Fraser -# X-Debian-Packages: modutils -# - -################################# -# -# Rules for the module utility domains. -# -type modules_dep_t, file_type, sysadmfile; -type modules_conf_t, file_type, sysadmfile; -type modules_object_t, file_type, sysadmfile; -type depmod_exec_t, file_type, exec_type, sysadmfile; -type insmod_exec_t, file_type, exec_type, sysadmfile; -type update_modules_exec_t, file_type, exec_type, sysadmfile; -
tunables/distro.tun +1 -1
@@ -5,7 +5,7 @@ # appropriate ifdefs. -dnl define(`distro_redhat') +define(`distro_redhat') dnl define(`distro_suse')
tunables/tunable.tun +6 -6
@@ -1,27 +1,27 @@ # Allow users to execute the mount command -dnl define(`user_can_mount') +define(`user_can_mount') # Allow rpm to run unconfined. -dnl define(`unlimitedRPM') +define(`unlimitedRPM') # Allow privileged utilities like hotplug and insmod to run unconfined. -dnl define(`unlimitedUtils') +define(`unlimitedUtils') # Allow rc scripts to run unconfined, including any daemon # started by an rc script that does not have a domain transition # explicitly defined. -dnl define(`unlimitedRC') +define(`unlimitedRC') # Allow sysadm_t to directly start daemons define(`direct_sysadm_daemon') # Do not audit things that we know to be broken but which # are not security risks -dnl define(`hide_broken_symptoms') +define(`hide_broken_symptoms') # Allow user_r to reach sysadm_r via su, sudo, or userhelper. # Otherwise, only staff_r can do so. -dnl define(`user_canbe_sysadm') +define(`user_canbe_sysadm') # Allow xinetd to run unconfined, including any services it starts # that do not have a domain transition explicitly defined.
Re: More patches
Quoted 6 lines
allow
hald_tbin_t:file getattr;
-allowhald_tself:netlink_socketcreate_socket_perms;
allowhald_tself:netlink_kobject_uevent_socketcreate_socket_perms;
allowhald_tself:netlink_route_socketr_netlink_socket_perms;
allowhald_tself:capability {net_adminsys_admindac_overridedac_read_searchmknod };
Now I get one of these...
audit(1112809767.410:0): avc: denied { create } for pid=7363 exe=/usr/sbin/hald scontext=root:system_r:hald_t tcontext=root:system_r:hald_t tclass=netlink_socket
...and the console is flooded with those:
audit(1112809741.307:0): avc: denied { read } for pid=2525 exe=/usr/sbin/hald scontext=system_u:system_r:hald_t tcontext=system_u:system_r:hald_t tclass=netlink_socket
Was this removed because of the kobject_uevent rule below it? I can't remember if that rule was there to begin with, or if it was put in to address what I was debugging w/ Protocol 15 (?) being denied.
Signature · 8 lines
Ivan Gyurdiev <[email protected]> Cornell University -- 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.
Re: More patches
Quoted 16 lines · Ivan Gyurdiev
Quoted 7 lines
allow
hald_tbin_t:file getattr;
-allowhald_tself:netlink_socketcreate_socket_perms;
allowhald_tself:netlink_kobject_uevent_socketcreate_socket_perms;
allowhald_tself:netlink_route_socketr_netlink_socket_perms;
allowhald_tself:capability {net_adminsys_admindac_overridedac_read_searchmknod };Now I get one of these...
audit(1112809767.410:0): avc: denied { create } for pid=7363 exe=/usr/sbin/hald scontext=root:system_r:hald_t tcontext=root:system_r:hald_t tclass=netlink_socket
...and the console is flooded with those:
Quoted 10 lines
audit(1112809741.307:0): avc: denied { read } for pid=2525 exe=/usr/sbin/hald scontext=system_u:system_r:hald_t tcontext=system_u:system_r:hald_t tclass=netlink_socket
Was this removed because of the
kobject_ueventrule below it?
I can't remember if that rule was there to begin with, or if it was put in to address what I was debugging w/ Protocol 15 (?) being denied.
My understanding was that
netlink_kobject_uevent_socket was added so that we would not need the netlink_socket rule.
Either I am wrong or you might need an updated kernel.
Dan
Signature · 4 lines
-- 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.
Re: More patches
Quoted 6 lines
My understanding was that
netlink_kobject_uevent_socketwas added so that we would not need thenetlink_socketrule.Either I am wrong or you might need an updated kernel.
Ok, I wasn't sure about that, since I didn't see when it was added. Which kernel do I need? I am running 2.6.11-1.1226_FC4.
Strace still shows protocol 15... same behavior as previously reported.
Signature · 8 lines
Ivan Gyurdiev <[email protected]> Cornell University -- 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.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: More patches
Quoted 2 lines
BTW have you done anything with dmidecode?
Now attached - small domain for dmidecode that allows it to read /dev/mem and gives it rawio privileges.
Patch for hal to transition to this domain,
as well as bringing back the netlink rule for backwards compatibility.
Signature · 2 lines
Ivan Gyurdiev <[email protected]> Cornell University
domains/program/hald.te +7 -7
@@ -29,8 +29,11 @@ allow hald_t { bin_t sbin_t }:dir search; allow hald_t self:fifo_file rw_file_perms; allow hald_t usr_t:file { getattr read }; - allow hald_t bin_t:file getattr; + +# For backwards compatibility with older kernels +allow hald_t self:netlink_socket create_socket_perms; + allow hald_t self:netlink_kobject_uevent_socket create_socket_perms; allow hald_t self:netlink_route_socket r_netlink_socket_perms; allow hald_t self:capability { net_admin sys_admin dac_override dac_read_search mknod };
@@ -77,17 +80,14 @@ allow hald_t mnt_t:dir search; r_dir_file(hald_t, proc_net_t) - -# For /usr/libxexc/hald-addon-acpi - writes to /var/run/acpid.socket +# For /usr/libexec/hald-addon-acpi - writes to /var/run/acpid.socket ifdef(`apmd.te', ` allow hald_t apmd_var_run_t:sock_file write; allow hald_t apmd_t:unix_stream_socket connectto; ') -# For /usr/sbin/dmidecode -# Violates assertion -#allow hald_t memory_device_t:chr_file read; -allow hald_t self:capability sys_rawio; +# For /usr/libexec/hald-probe-smbios +domain_auto_trans(hald_t, dmidecode_exec_t, dmidecode_t) # ?? ifdef(`lvm.te', `
# dmidecode /usr/sbin/dmidecode -- system_u:object_r:dmidecode_exec_t /usr/sbin/ownership -- system_u:object_r:dmidecode_exec_t /usr/sbin/vpddecode -- system_u:object_r:dmidecode_exec_t
#DESC dmidecode - decodes DMI data for x86/ia64 bioses #
# Author: Ivan Gyurdiev <[email protected]>
#
type dmidecode_t, domain, privmem;
type dmidecode_exec_t, file_type, exec_type, sysadmfile;
# Allow execution by the sysadm
role sysadm_r types dmidecode_t;
role system_r types dmidecode_t; domain_auto_trans(sysadm_t, dmidecode_exec_t, dmidecode_t)
uses_shlib(dmidecode_t)
# Allow terminal accessaccess_terminal(dmidecode_t, sysadm)
# Allow dmidecode to read /dev/mem
allow dmidecode_t memory_device_t:chr_file read;
allow dmidecode_t self:capability sys_rawio;
Re: More patches
Merged.
Quoted 8 lines · Ivan Gyurdiev
Quoted 1 line
BTW have you done anything with dmidecode?
Now attached - small domain for dmidecode that allows it to read
/dev/memand gives it rawio privileges.Patch for hal to transition to this domain,
as well as bringing back the netlink rule for backwards compatibility.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- 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.
Re: More patches
In reply to Daniel J WalshQuoted 10 lines · Daniel J Walsh
Quoted 8 lines · Ivan Gyurdiev
Quoted 7 lines
allow
hald_tbin_t:file getattr;
-allowhald_tself:netlink_socketcreate_socket_perms;
allowhald_tself:netlink_kobject_uevent_socketcreate_socket_perms;
allowhald_tself:netlink_route_socketr_netlink_socket_perms;
allowhald_tself:capability {net_adminsys_admindac_overridedac_read_searchmknod };
Steve had suggested to me to leave that line in for now for compatibility with older kernels.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- 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.
Re: More patches
In reply to Daniel J WalshQuoted 5 lines · Daniel J Walsh
My understanding was that
netlink_kobject_uevent_socketwas added so that we would not need thenetlink_socketrule.Either I am wrong or you might need an updated kernel.
Ultimately, we can phase out the old rule, but we need to wait until the kernel change makes its way into the Fedora kernels.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- 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.
Re: More patches
In reply to Daniel J WalshMerged.
Quoted 1 line · Daniel J Walsh
Fixed the patches, so they will build.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- 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.