new policy
The archive newfiles.tar.gz of new policy files I've written which aren't yet in the CVS.
The patch can_net.diff which removes duplicate calls to can_network(). This makes the resulting policy.conf smaller and makes it easier to grep.
The patch mta.diff has some new changes related to mail servers. Of particular note, I finally got qmail fully working in enforcing mode - and the policy has changed a lot.
The netscape changes in netscape.diff rely on the new file x_client_macros.te, it is about splitting the X access part of it into a separate file so the same policy is also used by other programs that use X but which are not entirely trusted.
The file diff contains other small patches, including some that are required for the netscape patch, and for the new xauth policy that is needed for a separate type for the ~/.Xauthority file.
Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
domains/program/crond.te renamed from tmp/policy/domains/program/crond.te +1 -4
@@ -15,7 +15,7 @@ # The system_r role is authorized for this domain. role system_r types crond_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (including can_net) every_domain(crond_t) # Type for the crond executable.
@@ -65,9 +65,6 @@ # Inherit and use descriptors from init. allow crond_t init_t:fd use; -# Use the network. -can_network(crond_t) - # Read from /var/spool/cron. allow crond_t cron_spool_t:dir r_dir_perms; allow crond_t cron_spool_t:file r_file_perms;
domains/program/cups.te renamed from tmp/policy/domains/program/cups.te +0 -3
@@ -46,9 +46,6 @@ # Inherit and use descriptors from init. allow cupsd_t init_t:fd use; -# Use the network. -can_network(cupsd_t) - # Bind to the cups/ipp port (631). allow cupsd_t ipp_port_t:tcp_socket name_bind;
domains/program/dhcpc.te renamed from tmp/policy/domains/program/dhcpc.te +0 -3
@@ -35,9 +35,6 @@ # Inherit and use descriptors from init. allow dhcpc_t init_t:fd use; -# Use the network. -can_network(dhcpc_t) - # Use capabilities allow dhcpc_t self:capability { net_admin net_raw net_bind_service };
domains/program/ftpd.te renamed from tmp/policy/domains/program/ftpd.te +0 -3
@@ -38,9 +38,6 @@ # Use capabilities. allow ftpd_t ftpd_t:capability { net_bind_service setuid setgid fowner fsetid chown sys_resource sys_chroot }; -# Use the network. -can_network(ftpd_t) - # Connect to inetd. can_tcp_connect(ftpd_t,inetd_t)
domains/program/initrc.te renamed from tmp/policy/domains/program/initrc.te +0 -3
@@ -44,9 +44,6 @@ # Set values in /proc/sys. can_sysctl(initrc_t) -# Use the network. -can_network(initrc_t) - # Run helper programs in the initrc_t domain. can_exec_any(initrc_t)
domains/program/login.te renamed from tmp/policy/domains/program/login.te +0 -6
@@ -30,9 +30,6 @@ allow local_login_t shadow_t:file { read getattr }; -# Use the network. -can_network(local_login_t) - # Run shells in user_t by default. domain_auto_trans(local_login_t, shell_exec_t, user_t) # But also permit other user domains to be entered by login.
@@ -115,9 +112,6 @@ # Use capabilities. allow remote_login_t remote_login_t:capability { setuid setgid chown fowner fsetid net_bind_service sys_tty_config dac_override }; -# Use the network. -can_network(remote_login_t) - # Run shells in user_t by default. domain_auto_trans(remote_login_t, shell_exec_t, user_t) # Only permit unprivileged user domains to be entered via rlogin,
domains/program/newrole.te renamed from tmp/policy/domains/program/newrole.te +0 -3
@@ -25,9 +25,6 @@ # Execute /sbin/pwdb_chkpwd to check the password. can_exec(newrole_t, chkpwd_exec_t) -# Use the network. -can_network(newrole_t) - # Allow newrole_t to transition to user domains. domain_trans(newrole_t, shell_exec_t, userdomain)
domains/program/portmap.te renamed from tmp/policy/domains/program/portmap.te +0 -2
@@ -23,8 +23,6 @@ # Inherit and use descriptors from init. allow portmap_t init_t:fd use; -# Use the network. -can_network(portmap_t) allow portmap_t portmap_port_t:{ udp_socket tcp_socket } name_bind; # Send to ypbind, initrc, rpc.statd, xinetd.
domains/program/rlogind.te renamed from tmp/policy/domains/program/rlogind.te +0 -3
@@ -27,9 +27,6 @@ # Use capabilities. allow rlogind_t rlogind_t:capability { net_bind_service setuid setgid fowner fsetid chown dac_override }; -# Use the network. -can_network(rlogind_t) - # Run login in remote_login_t. domain_auto_trans(rlogind_t, login_exec_t, remote_login_t)
diff -ru /tmp/policy/domains/program/sendmail.te policy/domains/program/sendmail.te
domains/program/ssh.te renamed from tmp/policy/domains/program/ssh.te +0 -1
@@ -10,7 +10,6 @@ role system_r types $1; every_domain($1) allow $1 self:capability { chown dac_override fowner fsetid setgid setuid net_bind_service sys_tty_config }; -can_network($1) allow $1 shadow_t:file { read getattr }; allow $1 { home_root_t user_home_dir_type sysadm_home_dir_t }:dir { search getattr };
domains/program/tcpd.te renamed from tmp/policy/domains/program/tcpd.te +0 -3
@@ -18,9 +18,6 @@ # Use sockets inherited from inetd. allow tcpd_t inetd_t:tcp_socket rw_stream_socket_perms; -# Use the network -can_network(tcpd_t) - # Run each daemon with a defined domain in its own domain. # These rules have been moved to each target domain's .te file.
macros/program/chkpwd_macros.te renamed from tmp/policy/macros/program/chkpwd_macros.te +1 -4
@@ -23,7 +23,7 @@ # The user role is authorized for this domain. role $1_r types $1_chkpwd_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (includes can_net) every_domain($1_chkpwd_t) # Use capabilities.
@@ -35,9 +35,6 @@ # Inherit and use descriptors from newrole. ifdef(`newrole.te', `allow $1_chkpwd_t newrole_t:fd use;') -# Use the network. -can_network($1_chkpwd_t) - # Write to the user domain tty. allow $1_chkpwd_t $1_tty_device_t:chr_file rw_file_perms; allow $1_chkpwd_t $1_devpts_t:chr_file rw_file_perms;
macros/program/crontab_macros.te renamed from tmp/policy/macros/program/crontab_macros.te +1 -4
@@ -27,7 +27,7 @@ # The user role is authorized for this domain. role $1_r types $1_crontab_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (including can_net) every_domain($1_crontab_t) # Use capabilities
@@ -61,9 +61,6 @@ # Run helper programs. can_exec_any($1_crontab_t) -# Use the network for NIS. -can_network($1_crontab_t) - # Read user crontabs allow $1_crontab_t home_root_t:dir search; allow $1_crontab_t { $1_home_t $1_home_dir_t }:dir r_dir_perms;
macros/program/lpr_macros.te renamed from tmp/policy/macros/program/lpr_macros.te +1 -4
@@ -26,7 +26,7 @@ # The user role is authorized for this domain. role $1_r types $1_lpr_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (including can_net) every_domain($1_lpr_t) # Use capabilities.
@@ -45,9 +45,6 @@ # Use this type when creating files in /var/spool/lpd. file_type_auto_trans($1_lpr_t, lpd_spool_t, $1_lpd_spool_t) -# Use the network. -can_network($1_lpr_t) - # Access the terminal. allow $1_lpr_t $1_tty_device_t:chr_file rw_file_perms; allow $1_lpr_t $1_devpts_t:chr_file rw_file_perms;
macros/program/mta_macros.te renamed from tmp/policy/macros/program/mta_macros.te +1 -4
@@ -34,15 +34,12 @@ # The user role is authorized for this domain. role $1_r types $1_mail_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (including can_net) every_domain($1_mail_t) # Use capabilities allow $1_mail_t self:capability { setuid setgid chown }; -# Use the network. -can_network($1_mail_t) - # Execute procmail. can_exec($1_mail_t, bin_t) ifdef(`procmail.te',`
macros/program/ssh_macros.te renamed from tmp/policy/macros/program/ssh_macros.te +1 -4
@@ -28,7 +28,7 @@ # The user role is authorized for this domain. role $1_r types $1_ssh_t; -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (including can_net) every_domain($1_ssh_t) # Use capabilities.
@@ -57,9 +57,6 @@ # Inherit and use descriptors from gnome-pty-helper. ifdef(`gnome-pty-helper.te', `allow $1_ssh_t $1_gph_t:fd use;') -# Use the network -can_network($1_ssh_t) - # Connect to sshd. can_tcp_connect($1_ssh_t, sshd_t)
macros/program/xserver_macros.te renamed from tmp/policy/macros/program/xserver_macros.te +1 -4
@@ -37,7 +37,7 @@ role $1_r types $1_xserver_t; ')dnl -# This domain is granted permissions common to most domains. +# This domain is granted permissions common to most domains (includes can_net) every_domain($1_xserver_t) # Use capabilities. Access /dev/mem.
@@ -88,9 +88,6 @@ # Run helper programs in $1_xserver_t. can_exec_any($1_xserver_t) -# Use the network -can_network($1_xserver_t) - # Connect to xfs. ifdef(`xfs.te', `can_unix_connect($1_xserver_t, xfs_t)
domains/program/dpkg.te renamed from tmp/policy/domains/program/dpkg.te +3 -0
@@ -20,6 +20,9 @@ can_exec(dpkg_t, { dpkg_exec_t bin_t shell_exec_t tmp_dpkg_t ls_exec_t var_lib_dpkg_t etc_dpkg_t sbin_t }) can_exec(dpkg_t, init_exec_t) file_type_auto_trans(dpkg_t, tmp_t, tmp_dpkg_t) +ifdef(`mta.te', ` +allow system_mail_t tmp_dpkg_t:file read; +') allow dpkg_t random_device_t:chr_file read;
domains/program/mta.te renamed from tmp/policy/domains/program/mta.te +5 -1
@@ -34,7 +34,11 @@ allow mta_user_agent sysadm_t:fifo_file { read write }; allow { system_mail_t mta_user_agent } privmail:fd use; -allow { system_mail_t mta_user_agent } privmail:fifo_file rw_file_perms; +allow { system_mail_t mta_user_agent } privmail:process sigchld; +allow { system_mail_t mta_user_agent } privmail:fifo_file { read write }; +allow { system_mail_t mta_user_agent } admin_tty_type:chr_file { read write }; + +allow mta_delivery_agent home_root_t:dir search; # for piping mail to a command can_exec(mta_delivery_agent, shell_exec_t)
domains/program/qmail.te renamed from tmp/policy/domains/program/qmail.te +39 -42
179 lines not on this page · raw message
domains/program/sendmail.te renamed from tmp/policy/domains/program/sendmail.te +1 -1
@@ -12,7 +12,7 @@ # # depends on mta.te # -type sendmail_t, domain, privlog, mta_user_agent; +type sendmail_t, domain, privlog, mta_delivery_agent; role system_r types sendmail_t; every_domain(sendmail_t)
macros/program/mta_macros.te renamed from tmp/policy/macros/program/mta_macros.te +3 -2
@@ -56,9 +53,10 @@ ', ` # Read user temporary files. allow $1_mail_t $1_tmp_t:file { read getattr }; -ifdef(`postfix.te', ` -# postfix asks for append access but does not need it dontaudit $1_mail_t $1_tmp_t:file append; +ifdef(`postfix.te', ` +# postfix seems to need write access if the file handle is opened read/write +allow $1_mail_t $1_tmp_t:file write; ') allow mta_user_agent $1_tmp_t:file { read getattr };
file_contexts/program/netscape.fc renamed from tmp/policy/file_contexts/program/netscape.fc +1 -0
@@ -7,5 +7,6 @@ /usr/bin/mozilla system_u:object_r:netscape_exec_t /usr/bin/mozilla-[0-9].* system_u:object_r:netscape_exec_t /usr/bin/mozilla-bin-[0-9].* system_u:object_r:netscape_exec_t +/usr/lib/netscape/.*/communicator/communicator-smotif.real system_u:object_r:netscape_exec_t /usr/lib/netscape/base-4/wrapper system_u:object_r:netscape_exec_t /usr/lib/mozilla/reg.* system_u:object_r:netscape_exec_t
macros/program/netscape_macros.te renamed from tmp/policy/macros/program/netscape_macros.te +2 -104
122 lines not on this page · raw message
domains/program/kcheckpass.te renamed from tmp/policy/domains/program/kcheckpass.te +1 -1
@@ -32,7 +32,7 @@ allow kcheckpass_t fs_t:filesystem getattr; -dontaudit kcheckpass_t user_home_dir_type:dir search; +dontaudit kcheckpass_t { home_root_t user_home_dir_type }:dir search; dontaudit kcheckpass_t user_home_type:dir read; dontaudit kcheckpass_t xdm_t:fd use; dontaudit kcheckpass_t user_tmpfile:file read;
domains/program/mysqld.te renamed from tmp/policy/domains/program/mysqld.te +4 -1
@@ -37,13 +37,16 @@ allow mysqld_t var_lib_t:dir search; # read config files -allow mysqld_t { etc_t etc_mysqld_t resolv_conf_t etc_runtime_t }:{ file lnk_file } { read getattr }; +r_dir_file(mysqld_t, etc_mysqld_t) +allow mysqld_t { etc_t resolv_conf_t etc_runtime_t }:{ file lnk_file } { read getattr }; allow mysqld_t etc_t:dir search; allow mysqld_t sysctl_kernel_t:dir search; allow mysqld_t sysctl_kernel_t:file read; +can_unix_connect(sysadm_t, mysqld_t) + # for /root/.my.cnf - should not be needed allow mysqld_t sysadm_home_dir_t:dir search; allow mysqld_t sysadm_home_t:file { read getattr };
domains/program/named.te renamed from tmp/policy/domains/program/named.te +6 -1
@@ -104,6 +104,11 @@ # seems to need read as well for some reason allow ndc_t admin_tty_type:chr_file { getattr read write }; +# Read sysctl kernel variables. +allow ndc_t sysctl_t:dir r_dir_perms; +allow ndc_t sysctl_kernel_t:dir r_dir_perms; +allow ndc_t sysctl_kernel_t:file r_file_perms; + # for ndc_t to be used for restart shell scripts ifdef(`ndc_shell_script', ` allow ndc_t crond_t:fd use;
@@ -113,7 +118,7 @@ allow ndc_t etc_runtime_t:file { getattr read }; allow ndc_t proc_t:dir search; allow ndc_t proc_t:file { getattr read }; -allow ndc_t self:process { fork sigchld }; +allow ndc_t self:process { fork signal_perms }; can_exec(ndc_t, { bin_t sbin_t shell_exec_t }) allow ndc_t var_run_named_t:file getattr; allow ndc_t self:fifo_file { read write getattr ioctl };
domains/program/quota.te renamed from tmp/policy/domains/program/quota.te +5 -1
@@ -13,8 +13,12 @@ rw_dir_create_file(initrc_t, quota_flag_t) -allow quota_t fs_t:filesystem { getattr quotaget }; +allow quota_t fs_t:filesystem { getattr quotaget quotamod }; allow quota_t self:capability sys_admin; +allow quota_t file_t:file quotaon; + +# for /quota.* - should setup a new type for it +allow quota_t file_t:file { read write }; # Read /etc/mtab. allow quota_t etc_runtime_t:file { read getattr };
file_contexts/program/named.fc renamed from tmp/policy/file_contexts/program/named.fc +1 -1
@@ -5,7 +5,7 @@ /etc/bind/named.conf system_u:object_r:named_conf_t /etc/bind/rndc.key system_u:object_r:rndc_conf_t /usr/sbin/named.* system_u:object_r:named_exec_t -/usr/sbin/ndc system_u:object_r:ndc_exec_t +/usr/sbin/r?ndc system_u:object_r:ndc_exec_t /var/cache/bind(/.*)? system_u:object_r:named_cache_t /var/run/ndc system_u:object_r:var_run_named_t /usr/sbin/lwresd system_u:object_r:named_exec_t
macros/global_macros.te renamed from tmp/policy/macros/global_macros.te +1 -1
@@ -827,7 +827,7 @@ # Read and write /dev/tty and /dev/null. allow $1 devtty_t:chr_file rw_file_perms; -allow $1 null_device_t:chr_file rw_file_perms; +allow $1 { null_device_t zero_device_t }:chr_file rw_file_perms; # Do not audit write denials to /etc/ld.so.cache. dontaudit $1 ld_so_cache_t:file write;
macros/program/irc_macros.te renamed from tmp/policy/macros/program/irc_macros.te +3 -0
@@ -22,6 +22,8 @@ type $1_irc_t, domain; type $1_home_irc_t, file_type, sysadmfile; +allow $1_t $1_home_irc_t:file { relabelfrom relabelto create_file_perms }; + ifdef(`ircd.te', ` can_tcp_connect($1_irc_t, ircd_t) ')
@@ -72,6 +74,7 @@ dontaudit $1_irc_t initrc_var_run_t:file lock; # access config files +allow $1_irc_t home_root_t:dir search; file_type_auto_trans($1_irc_t, $1_home_dir_t, $1_home_irc_t) create_dir_file($1_t, $1_home_irc_t)
macros/program/xserver_macros.te renamed from tmp/policy/macros/program/xserver_macros.te +3 -4
@@ -130,13 +127,12 @@ ', ` # Access the home directory. allow $1_xserver_t $1_home_dir_t:dir { getattr read search }; -allow $1_xserver_t $1_home_t:dir r_dir_perms; -allow $1_xserver_t $1_home_t:file r_file_perms;') +file_type_auto_trans($1_xserver_t, $1_home_dir_t, $1_home_xauth_t, file) +')dnl end ifelse xdm allow $1_xserver_t var_lib_xkb_t:dir rw_dir_perms; allow $1_xserver_t var_lib_xkb_t:file create_file_perms; - -') +')dnl end macro definition ', `
macros/user_macros.te renamed from tmp/policy/macros/user_macros.te +2 -0
@@ -124,7 +124,9 @@ ifdef(`chkpwd.te', `chkpwd_domain($1)') ifdef(`screen.te', `screen_domain($1)') ifdef(`netscape.te', `netscape_domain($1)') +ifdef(`games.te', `x_client_domain($1, games)') ifdef(`gpg.te', `gpg_domain($1)') +ifdef(`xauth.te', `xauth_domain($1)') ifdef(`xserver.te', `xserver_domain($1)') ifdef(`lpr.te', `lpr_domain($1)') ifdef(`mta.te', `mail_domain($1)')
Quoted 4 lines · Russell Coker
The netscape changes in netscape.diff rely on the new file x_client_macros.te, it is about splitting the X access part of it into a separate file so the same policy is also used by other programs that use X but which are not entirely trusted.
would it make sense to create a macro here, along the lines of can_network ? can_x is most certainly something that'll appear often.
Signature · 8 lines
PGP/GPG key: http://web.lemuria.org/pubkey.html pub 1024D/2D7A04F5 2002-05-16 Tom Vogt <[email protected]> Key fingerprint = C731 64D1 4BCF 4C20 48A4 29B2 BF01 9FA1 2D7A 04F5 -- 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 10 lines · Russell Coker
The archive newfiles.tar.gz of new policy files I've written which aren't yet in the CVS.
The patch can_net.diff which removes duplicate calls to
can_network(). This makes the resulting policy.conf smaller and makes it easier to grep.The patch mta.diff has some new changes related to mail servers. Of particular note, I finally got qmail fully working in enforcing mode - and the policy has changed a lot.
Quoted 8 lines
The netscape changes in netscape.diff rely on the new file x_client_macros.te, it is about splitting the X access part of it into a separate file so the same policy is also used by other programs that use X but which are not entirely trusted.
The file diff contains other small patches, including some that are required for the netscape patch, and for the new xauth policy that is needed for a separate type for the ~/.Xauthority file.
Thanks, merged. There were some rejects, but I think that they were just duplicate diffs from earlier patches. I also dropped capabilities from netscape. Do we need an entry for the .Xauthority files in types.fc?
--
Stephen D. Smalley, NAI Labs
[email protected]
--
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 2 lines · Stephen Smalley
I also dropped capabilities from
netscape. Do we need an entry for the .Xauthority files in types.fc?
Yes we do. I think that we need to radically change the way setfiles works for home directories. But in the mean time just adding something like the following to xauth.fc should do:
/home/[^/]*/.Xauthority.* system_u:object_r:user_home_xauth_t
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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 4 lines · Russell Coker
Yes we do. I think that we need to radically change the way setfiles works for home directories. But in the mean time just adding something like the following to xauth.fc should do:
/home/[^/]*/.Xauthority.* system_u:object_r:user_home_xauth_t
Ok, and I also added an entry for /root/.Xauthority with the sysadm_home_xauth_t type.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
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 8 lines · Stephen Smalley
Quoted 4 lines · Russell Coker
Yes we do. I think that we need to radically change the way setfiles works for home directories. But in the mean time just adding something like the following to xauth.fc should do:
/home/[^/]*/.Xauthority.* system_u:object_r:user_home_xauth_tOk, and I also added an entry for
/root/.Xauthoritywith thesysadm_home_xauth_ttype.
I have attached a new patch that applies against the current CVS tree. It adds some important things to the xauth support, particularly denying xdm_t write access to user_home_t.
Also there's a bunch of other things in the patch, the meaning of the patch should be obvious.
Steve, you may disagree with the xdm.te part, I think we've kept the alias for too long already...
Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
domains/program/calamaris.te +1 -1
@@ -22,7 +22,7 @@ rw_dir_create_file(calamaris_t, calamaris_www_t) # for when squid has a different UID -allow calamaris_t self:capability dac_read_search; +allow calamaris_t self:capability dac_override; log_domain(calamaris)
domains/program/courier.te +3 -1
@@ -105,7 +105,9 @@ # imap needs to write files allow courier_pop_t home_root_t:dir { getattr search }; allow courier_pop_t user_home_dir_type:dir { getattr search }; -rw_dir_create_file(courier_pop_t, user_home_type) +# pop does not need to create subdirs, IMAP does +#rw_dir_create_file(courier_pop_t, user_home_type) +create_dir_file(courier_pop_t, user_home_type) # for calendaring courier_domain(pcp)
domains/program/dpkg.te +1 -1
@@ -157,7 +157,7 @@ allow dpkg_t file_type:{ file lnk_file fifo_file sock_file } create_file_perms; ifdef(`devfsd.te', `allow dpkg_t file_type:{ chr_file blk_file } getattr;', -`allow dpkg_t file_type:{ chr_file blk_file } { create getattr access setattr rename };') +`allow dpkg_t file_type:{ chr_file blk_file } { create getattr setattr rename };') dontaudit dpkg_t domain:{ socket unix_dgram_socket udp_socket unix_stream_socket tcp_socket fifo_file rawip_socket packet_socket } getattr; allow dpkg_t proc_kmsg_t:file getattr; allow dpkg_t root_dir_type:dir getattr;
domains/program/inetd.te +0 -5
@@ -32,8 +32,6 @@ # Use capabilities. allow inetd_t self:capability { setuid setgid net_bind_service }; -# Use the network. -can_network(inetd_t) # allow any domain to connect to inetd can_tcp_connect(domain, inetd_t)
@@ -78,8 +76,5 @@ # Use sockets inherited from inetd. allow inetd_child_t inetd_t:tcp_socket rw_stream_socket_perms; -# Use the network -can_network(inetd_child_t) - # for identd #allow inetd_child_t self:capability { setuid setgid };
domains/program/mrtg.te +4 -0
@@ -61,5 +61,9 @@ dontaudit mrtg_t initrc_var_run_t:file { write lock }; allow mrtg_t etc_runtime_t:file { getattr read }; +allow mrtg_t tmp_t:dir getattr; + # should not need this! allow mrtg_t sysadm_home_dir_t:dir { search read getattr }; +dontaudit mrtg_t { boot_t device_t file_labels_t file_t lost_found_t }:dir getattr; +dontaudit mrtg_t root_t:lnk_file getattr;
domains/program/named.te +1 -0
@@ -91,6 +91,7 @@ type ndc_exec_t, file_type,sysadmfile, exec_type; domain_auto_trans(sysadm_t, ndc_exec_t, ndc_t) uses_shlib(ndc_t) +can_network(ndc_t) can_tcp_connect(ndc_t, named_t) allow { named_t ndc_t initrc_t } rndc_conf_t:file { getattr read };
domains/program/qmail.te +1 -7
@@ -55,15 +55,11 @@ allow qmail_lspawn_t qmail_spool_t:dir search; allow qmail_lspawn_t qmail_spool_t:file { read getattr }; allow qmail_lspawn_t etc_t:file { getattr read }; -allow qmail_lspawn_t etc_qmail_t:dir { getattr search }; dontaudit qmail_lspawn_t user_home_dir_type:dir { getattr search }; qmail_daemon_domain(send) -allow qmail_send_t var_spool_t:dir search; rw_dir_create_file(qmail_send_t, qmail_spool_t) allow qmail_send_t qmail_spool_t:fifo_file read; -allow qmail_send_t etc_qmail_t:dir search; -allow qmail_send_t etc_qmail_t:{ lnk_file file } read; allow qmail_send_t self:process { fork signal_perms }; allow qmail_send_t self:fifo_file write; domain_auto_trans_read(qmail_send_t, qmail_queue_exec_t, qmail_queue_t)
@@ -101,9 +97,6 @@ domain_auto_trans(qmail_local_t, qmail_queue_exec_t, qmail_queue_t) allow qmail_local_t qmail_queue_exec_t:file read; allow qmail_local_t qmail_spool_t:file { ioctl read }; -allow qmail_local_t etc_qmail_t:dir { getattr read search }; -allow qmail_local_t etc_qmail_t:file { getattr read }; -allow qmail_local_t qmail_spool_t:file { ioctl read }; allow qmail_local_t self:fifo_file write; allow qmail_local_t sbin_t:dir search;
@@ -175,6 +168,7 @@ allow qmail_serialmail_t self:process { fork signal_perms }; allow qmail_serialmail_t proc_t:file { getattr read }; allow qmail_serialmail_t { resolv_conf_t etc_runtime_t }:file { getattr read }; +allow qmail_serialmail_t home_root_t:dir search; allow qmail_serialmail_t user_home_dir_type:dir { search read getattr }; rw_dir_create_file(qmail_serialmail_t, user_home_type) allow qmail_serialmail_t self:fifo_file { read write };
domains/program/radius.te +2 -1
@@ -49,7 +49,8 @@ allow radiusd_t devtty_t:chr_file { read write }; allow radiusd_t self:fifo_file rw_file_perms; # fsetid is for gzip which needs it when run from scripts -allow radiusd_t self:capability { fsetid kill setuid setgid dac_override }; +# gzip also needs chown access to preserve GID for radwtmp files +allow radiusd_t self:capability { chown fsetid kill setuid setgid dac_override }; can_network(radiusd_t) allow radiusd_t { radius_port_t radacct_port_t }:udp_socket name_bind;
domains/program/rlogind.te +3 -2
@@ -45,5 +45,6 @@ # Modify /var/log/wtmp. allow rlogind_t wtmp_t:file rw_file_perms; - - +ifdef(`devfsd.te', ` +allow rlogind_t device_t:filesystem getattr; +')
domains/program/rpcd.te +1 -3
@@ -16,6 +16,7 @@ domain_auto_trans(initrc_t, rpcd_exec_t, rpcd_t) can_udp_send({ init_t initrc_t }, rpcd_t) can_udp_send(rpcd_t, { init_t initrc_t }) +allow init_t rpcd_t:udp_socket write; can_udp_send(rpcd_t, rpcd_t) can_udp_send(mount_t, rpcd_t)
@@ -28,9 +29,6 @@ # Inherit and use descriptors from init allow rpcd_t init_t:fd use; -# Use the network. -can_network(rpcd_t) - # rpcd_t needs to talk to the portmap_t domain can_udp_send(rpcd_t, portmap_t)
domains/program/squid.te +5 -1
@@ -8,7 +8,11 @@ # Rules for the squid_t domain. # # squid_t is the domain the squid process runs in -ifdef(`apache.te',`', `type http_cache_port_t, port_type;') +ifdef(`apache.te',` +can_tcp_connect(squid_t, httpd_t) +', ` +type http_cache_port_t, port_type; +') daemon_domain(squid) type squid_conf_t, file_type, sysadmfile;
domains/program/useradd.te +0 -1
@@ -15,7 +15,6 @@ domain_auto_trans(sysadm_t, useradd_exec_t, useradd_t) # Add/remove user home directories -allow useradd_t home_root_t:dir rw_dir_perms; file_type_auto_trans(useradd_t, home_root_t, user_home_dir_t) file_type_auto_trans(useradd_t, user_home_dir_t, user_home_t)
domains/program/xdm.te +4 -4
@@ -13,12 +13,12 @@ # spawned by getty. # xdm_exec_t is the type of the [xgk]dm program # -type xdm_t alias { gdm_t }, domain, privuser, privrole, privlog, auth, privowner, privmem; +type xdm_t, domain, privuser, privrole, privlog, auth, privowner, privmem; role system_r types xdm_t; every_domain(xdm_t) -type xdm_exec_t alias gdm_exec_t, file_type, sysadmfile, exec_type; -type xdm_var_run_t alias gdm_var_run_t,file_type, sysadmfile, pidfile; -type xdm_tmp_t alias gdm_tmp_t, file_type, sysadmfile, tmpfile; +type xdm_exec_t, file_type, sysadmfile, exec_type; +type xdm_var_run_t, file_type, sysadmfile, pidfile; +type xdm_tmp_t, file_type, sysadmfile, tmpfile; type xsession_exec_t, file_type, sysadmfile, exec_type; # Run the X Display Manager in its own domain.
file_contexts/program/mailman.fc +1 -0
@@ -7,3 +7,4 @@ /usr/lib/mailman/mail/wrapper system_u:object_r:mailman_mail_exec_t /var/lib/mailman/archives(/.*)? system_u:object_r:mailman_archive_t /etc/cron.daily/mailman system_u:object_r:mailman_queue_exec_t +/etc/cron.monthly/mailman system_u:object_r:mailman_queue_exec_t
file_contexts/program/mysqld.fc +1 -1
@@ -1,7 +1,7 @@ # mysql database server /usr/sbin/mysqld system_u:object_r:mysqld_exec_t /var/run/mysqld(/.*)? system_u:object_r:var_run_mysqld_t -/var/log/mysql\.(err|log).* system_u:object_r:mysqld_log_t +/var/log/mysql.* system_u:object_r:mysqld_log_t /var/lib/mysql(/.*)? system_u:object_r:mysqld_db_t /etc/my.cnf system_u:object_r:etc_mysqld_t /etc/mysql(/.*)? system_u:object_r:etc_mysqld_t
macros/program/crontab_macros.te +1 -1
@@ -41,6 +41,7 @@ # Type of user crontabs once moved to cron spool. type $1_cron_spool_t, file_type, sysadmfile; # Use the type when creating files in /var/spool/cron. +allow sysadm_crontab_t $1_cron_spool_t:file { getattr read }; file_type_auto_trans($1_crontab_t, cron_spool_t, $1_cron_spool_t) ifdef(`fcron.te', ` file_type_auto_trans($1_crontab_t, fcron_spool_t, $1_cron_spool_t)
@@ -62,7 +63,6 @@ can_exec_any($1_crontab_t) # Read user crontabs -allow $1_crontab_t home_root_t:dir search; allow $1_crontab_t { $1_home_t $1_home_dir_t }:dir r_dir_perms; allow $1_crontab_t $1_home_t:file r_file_perms;
macros/program/lpr_macros.te +1 -1
@@ -53,7 +53,6 @@ ifdef(`gnome-pty-helper.te', `allow $1_lpr_t $1_gph_t:fd use;') # Read user files. -allow $1_lpr_t home_root_t:dir search; allow $1_lpr_t { $1_home_t $1_home_dir_t }:dir search; allow $1_lpr_t $1_home_t:{ file lnk_file } r_file_perms;
@@ -79,6 +78,7 @@ ifdef(`cups.te', ` allow { $1_lpr_t $1_t } etc_cupsd_t:dir search; can_tcp_connect({ $1_lpr_t $1_t }, cupsd_t) +file_type_auto_trans($1_lpr_t, cupsd_spool_t, $1_lpd_spool_t) ') ')
macros/program/mta_macros.te +1 -1
@@ -30,6 +30,7 @@ # Transition from the user domain to the derived domain. domain_auto_trans($1_t, sendmail_exec_t, $1_mail_t) ') +can_exec($1_mail_t, sendmail_exec_t) # The user role is authorized for this domain. role $1_r types $1_mail_t;
@@ -70,7 +71,6 @@ ifdef(`gnome-pty-helper.te', `allow $1_mail_t $1_gph_t:fd use;') # Create dead.letter in user home directories. -allow $1_mail_t home_root_t:dir search; file_type_auto_trans($1_mail_t, $1_home_dir_t, $1_home_t) # if you do not want to allow dead.letter then use the following instead
macros/program/su_macros.te +0 -2
@@ -39,8 +39,6 @@ # Write to utmp. allow $1_su_t initrc_var_run_t:file rw_file_perms; -# Use the network. -can_network($1_su_t) ')dnl end su_mini_domain define(`su_domain', `
macros/program/x_client_macros.te +0 -3
@@ -101,10 +101,7 @@ allow $1_$2_t $1_devpts_t:chr_file rw_file_perms; # Read the home directory, e.g. for .Xauthority and to get to config files -allow $1_$2_t home_root_t:dir search; file_type_auto_trans($1_$2_t, $1_home_dir_t, $1_$2_rw_t) -# for .Xauthority - need different perms for this -allow $1_$2_t $1_home_t:file { read getattr }; # Use a separate type for tmpfs/shm pseudo files. type $1_$2_tmpfs_t, file_type, sysadmfile;
macros/program/xserver_macros.te +0 -2
@@ -120,8 +120,6 @@ # Use the mouse. allow $1_xserver_t mouse_device_t:chr_file rw_file_perms; -allow $1_xserver_t home_root_t:dir search; - ifelse($1, xdm, ` dontaudit xdm_xserver_t sysadm_home_dir_t:dir { read search }; ', `
macros/user_macros.te +1 -2
@@ -213,8 +213,7 @@ allow $1_t xdm_xserver_tmp_t:dir search; ifelse(`$1', sysadm, `', ` -# gross hack - should not need this -file_type_auto_trans(xdm_t, $1_home_dir_t, $1_home_t, file) +file_type_auto_trans(xdm_t, $1_home_dir_t, $1_home_xauth_t, file) ')dnl end ifelse sysadm ')dnl end ifdef xdm.te
Quoted 3 lines · Russell Coker
I have attached a new patch that applies against the current CVS tree. It adds some important things to the xauth support, particularly denying
xdm_twrite access touser_home_t.
Ok, merged.
Quoted 2 lines
Steve, you may disagree with the xdm.te part, I think we've kept the alias for too long already...
Yes, that's fine.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
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.