cleanup: domain self references
I just did a global search and replace to clean up rules of the form
allow some_domain_t some_domain_t:capability setuid;
This makes the policy easier to read.
Please apply.
Thomas
Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA D09E C562 2BAE B2F4 ABE7
domains/program/getty.te +1 -1
@@ -34,7 +34,7 @@ allow getty_t self:capability { dac_override chown sys_resource sys_tty_config }; # fbgetty needs fsetid for some reason -#allow getty_t getty_t:capability fsetid; +#allow getty_t self:capability fsetid; read_locale(getty_t)
domains/program/initrc.te +1 -1
@@ -309,7 +309,7 @@ # allow initrc_t device_t:dir rw_dir_perms; allow initrc_t device_t:lnk_file { unlink }; -allow initrc_t initrc_t:process { getsched }; +allow initrc_t self:process { getsched }; r_dir_file(initrc_t,selinux_config_t)
domains/program/init.te +1 -1
@@ -29,7 +29,7 @@ allow init_t file_t:dir search; # Use capabilities. -allow init_t init_t:capability ~sys_module; +allow init_t self:capability ~sys_module; # Run /etc/rc.sysinit, /etc/rc, /etc/rc.local in the initrc_t domain. domain_auto_trans(init_t, initrc_exec_t, initrc_t)
domains/program/unused/dhcpd.te +1 -1
@@ -39,7 +39,7 @@ allow dhcpd_t devtty_t:chr_file { read write }; # Use capabilities -allow dhcpd_t dhcpd_t:capability { net_raw net_bind_service }; +allow dhcpd_t self:capability { net_raw net_bind_service }; # Allow access to the dhcpd file types type dhcp_state_t, file_type, sysadmfile;
domains/program/unused/firstboot.te +7 -7
@@ -36,9 +36,9 @@ allow firstboot_t firstboot_rw_t:dir create_dir_perms; allow firstboot_t firstboot_rw_t:file create_file_perms; -allow firstboot_t firstboot_t:fifo_file { getattr read write }; -allow firstboot_t firstboot_t:process { fork sigchld }; -allow firstboot_t firstboot_t:unix_stream_socket { connect create }; +allow firstboot_t self:fifo_file { getattr read write }; +allow firstboot_t self:process { fork sigchld }; +allow firstboot_t self:unix_stream_socket { connect create }; allow firstboot_t initrc_exec_t:file { getattr read }; allow firstboot_t initrc_var_run_t:file r_file_perms; allow firstboot_t lib_t:file { getattr read };
@@ -82,10 +82,10 @@ allow firstboot_t etc_t:{ file lnk_file } create_file_perms; -allow firstboot_t firstboot_t:capability { dac_override setgid }; -allow firstboot_t firstboot_t:dir { search }; -allow firstboot_t firstboot_t:file { read write }; -allow firstboot_t firstboot_t:lnk_file read; +allow firstboot_t self:capability { dac_override setgid }; +allow firstboot_t self:dir { search }; +allow firstboot_t self:file { read write }; +allow firstboot_t self:lnk_file read; can_setfscreate(firstboot_t) allow firstboot_t krb5_conf_t:file rw_file_perms;
domains/program/unused/hald.te +1 -1
@@ -26,7 +26,7 @@ allow hald_t { self proc_t }:file { getattr read }; allow hald_t { bin_t sbin_t }:dir search; -allow hald_t hald_t:fifo_file rw_file_perms; +allow hald_t self:fifo_file rw_file_perms; allow hald_t usr_t:file { getattr read }; allow hald_t bin_t:file { getattr };
domains/program/unused/inetd.te +1 -1
@@ -25,7 +25,7 @@ allow inetd_t self:unix_stream_socket create_socket_perms; allow inetd_t self:fifo_file rw_file_perms; allow inetd_t etc_t:file { getattr read ioctl }; -allow inetd_t inetd_t:process setsched; +allow inetd_t self:process setsched; log_domain(inetd) tmp_domain(inetd)
domains/program/unused/ipsec.te +4 -4
@@ -63,7 +63,7 @@ # it in its own domain?) can_exec(ipsec_mgmt_t, bin_t) # logger, running in ipsec_mgmt_t needs to use sockets -allow ipsec_mgmt_t ipsec_mgmt_t:unix_dgram_socket { create connect write }; +allow ipsec_mgmt_t self:unix_dgram_socket { create connect write }; allow ipsec_mgmt_t ipsec_t:unix_dgram_socket { create connect write }; # also need to run things like whack and shell scripts
@@ -168,12 +168,12 @@ allow ipsec_mgmt_t self:process { sigchld signal setrlimit }; # Allow read/write access to /var/run/pluto.ctl -allow ipsec_t ipsec_t:unix_stream_socket {create setopt bind listen accept read write }; +allow ipsec_t self:unix_stream_socket {create setopt bind listen accept read write }; # Pluto needs network access can_network(ipsec_t) can_ypbind(ipsec_t) -allow ipsec_t ipsec_t:unix_dgram_socket { create connect write }; +allow ipsec_t self:unix_dgram_socket { create connect write }; # for sleep allow ipsec_mgmt_t fs_t:filesystem getattr;
@@ -194,7 +194,7 @@ allow ipsec_mgmt_t var_lock_t:file create_file_perms; # allow tncfg to create sockets -allow ipsec_mgmt_t ipsec_mgmt_t:udp_socket { create ioctl }; +allow ipsec_mgmt_t self:udp_socket { create ioctl }; #When running ipsec auto --up <conname> allow ipsec_t self:process { fork sigchld };
domains/program/unused/iptables.te +2 -2
@@ -40,8 +40,8 @@ allow iptables_t bin_t:file { execute execute_no_trans }; allow iptables_t iptables_exec_t:file { execute_no_trans }; -allow iptables_t iptables_t:capability { net_admin net_raw }; -allow iptables_t iptables_t:rawip_socket create_socket_perms; +allow iptables_t self:capability { net_admin net_raw }; +allow iptables_t self:rawip_socket create_socket_perms; allow iptables_t etc_t:file { getattr read };
domains/program/unused/kerberos.te +1 -1
@@ -75,7 +75,7 @@ # # Rules for Kerberos5 Kadmin daemon -allow kadmind_t kadmind_t:unix_dgram_socket { connect create write }; +allow kadmind_t self:unix_dgram_socket { connect create write }; allow kadmind_t krb5kdc_conf_t:dir { search }; allow kadmind_t krb5kdc_conf_t:file r_file_perms; allow kadmind_t krb5kdc_principal_t:file { getattr lock read write setattr };
domains/program/unused/portslave.te +1 -1
@@ -53,7 +53,7 @@ ifdef(`sshd.te', `can_tcp_connect(portslave_t, sshd_t)') # for pppd -allow portslave_t portslave_t:capability { setuid setgid net_admin fsetid }; +allow portslave_t self:capability { setuid setgid net_admin fsetid }; allow portslave_t ppp_device_t:chr_file rw_file_perms; # for ~/.ppprc - if it actually exists then you need some policy to read it
domains/program/unused/postfix.te +1 -1
@@ -322,7 +322,7 @@ postfix_public_domain(pipe) allow postfix_pipe_t postfix_spool_t:dir search; allow postfix_pipe_t postfix_spool_t:file rw_file_perms; -allow postfix_pipe_t postfix_pipe_t:fifo_file { read write }; +allow postfix_pipe_t self:fifo_file { read write }; allow postfix_pipe_t postfix_private_t:dir search; allow postfix_pipe_t postfix_private_t:sock_file write; ifdef(`procmail.te', `
domains/program/unused/pppd.te +1 -1
@@ -92,7 +92,7 @@ can_create_pty(pppd) allow pppd_t self:file { read getattr }; allow pppd_t self:capability { fowner net_raw }; -allow pppd_t pppd_t:packet_socket create_socket_perms; +allow pppd_t self:packet_socket create_socket_perms; file_type_auto_trans(pppd_t, etc_t, net_conf_t, file) tmp_domain(pppd)
domains/program/unused/qmail.te +1 -1
@@ -46,7 +46,7 @@ allow qmail_start_t qmail_etc_t:dir search; allow qmail_start_t qmail_etc_t:file { getattr read }; can_exec(qmail_start_t, qmail_start_exec_t) -allow qmail_start_t qmail_start_t:fifo_file { getattr read write }; +allow qmail_start_t self:fifo_file { getattr read write }; qmail_daemon_domain(lspawn, `, mta_delivery_agent') allow qmail_lspawn_t self:fifo_file { read write };
domains/program/unused/rlogind.te +1 -1
@@ -32,7 +32,7 @@ allow rlogind_t inetd_t:tcp_socket rw_stream_socket_perms; # Use capabilities. -allow rlogind_t rlogind_t:capability { net_bind_service setuid setgid fowner fsetid chown dac_override }; +allow rlogind_t self:capability { net_bind_service setuid setgid fowner fsetid chown dac_override }; # so telnetd can start a child process for the login allow rlogind_t self:process { fork signal_perms };
domains/program/unused/slocate.te +1 -1
@@ -61,7 +61,7 @@ # Read nsswitch file # allow locate_t etc_t:file { getattr read }; -dontaudit locate_t locate_t:capability dac_override; +dontaudit locate_t self:capability dac_override; allow locate_t self:capability dac_read_search; # sysadm_t runs locate in his own domain.
domains/program/unused/squid.te +1 -1
@@ -27,7 +27,7 @@ # type for /var/cache/squid type squid_cache_t, file_type, sysadmfile; -allow squid_t squid_t:capability { setgid setuid }; +allow squid_t self:capability { setgid setuid }; allow squid_t { etc_t etc_runtime_t }:file r_file_perms; allow squid_t etc_t:lnk_file read; allow squid_t self:unix_stream_socket create_socket_perms;
domains/program/unused/udev.te +1 -1
@@ -108,5 +108,5 @@ allow udev_t sysctl_dev_t:dir { search }; allow udev_t sysctl_dev_t:file { getattr read }; allow udev_t sysctl_modprobe_t:file { getattr read }; -allow udev_t udev_t:rawip_socket create_socket_perms; +allow udev_t self:rawip_socket create_socket_perms; dontaudit udev_t domain:dir r_dir_perms;
domains/program/unused/utempter.te +1 -1
@@ -20,7 +20,7 @@ domain_auto_trans(userdomain, utempter_exec_t, utempter_t) # Use capabilities. -allow utempter_t utempter_t:capability { setgid }; +allow utempter_t self:capability { setgid }; allow utempter_t etc_t:file { getattr read };
domains/program/unused/vpnc.te +3 -3
@@ -24,7 +24,7 @@ allow vpnc_t devpts_t:dir search; allow vpnc_t etc_t:file { getattr read }; allow vpnc_t tun_tap_device_t:chr_file { ioctl read write }; -allow vpnc_t vpnc_t:rawip_socket create_socket_perms; -allow vpnc_t vpnc_t:unix_dgram_socket create_socket_perms; -allow vpnc_t vpnc_t:unix_stream_socket create_socket_perms; +allow vpnc_t self:rawip_socket create_socket_perms; +allow vpnc_t self:unix_dgram_socket create_socket_perms; +allow vpnc_t self:unix_stream_socket create_socket_perms; allow vpnc_t admin_tty_type:chr_file rw_file_perms;
domains/program/unused/watchdog.te +1 -1
@@ -36,7 +36,7 @@ # for orderly shutdown can_exec(watchdog_t, shell_exec_t) allow watchdog_t domain:process { signal_perms getsession }; -allow watchdog_t watchdog_t:capability { kill }; +allow watchdog_t self:capability { kill }; allow watchdog_t sbin_t:dir search; # for updating mtab on umount
domains/program/unused/xdm.te +2 -2
@@ -310,8 +310,8 @@ allow xdm_t var_log_t:file { read }; dontaudit xdm_t krb5_conf_t:file { write }; allow xdm_t krb5_conf_t:file { getattr read }; -allow xdm_t xdm_t:capability { sys_nice sys_rawio }; -allow xdm_t xdm_t:process { setrlimit }; +allow xdm_t self:capability { sys_nice sys_rawio }; +allow xdm_t self:process { setrlimit }; allow xdm_t wtmp_t:file { getattr read }; domain_auto_trans(initrc_t, xserver_exec_t, xdm_xserver_t)
domains/program/unused/xfs.te +3 -3
@@ -30,12 +30,12 @@ can_ypbind(xfs_t) # Use capabilities. -allow xfs_t xfs_t:capability { setgid setuid }; +allow xfs_t self:capability { setgid setuid }; # Bind to /tmp/.font-unix/fs-1. allow xfs_t xfs_tmp_t:unix_stream_socket name_bind; -allow xfs_t xfs_t:unix_stream_socket create_stream_socket_perms; -allow xfs_t xfs_t:unix_dgram_socket create_socket_perms; +allow xfs_t self:unix_stream_socket create_stream_socket_perms; +allow xfs_t self:unix_dgram_socket create_socket_perms; # Read /usr/X11R6/lib/X11/fonts/.* and /usr/share/fonts/.* allow xfs_t fonts_t:dir search;
domains/program/unused/ypbind.te +1 -1
@@ -21,7 +21,7 @@ can_network(ypbind_t) allow ypbind_t port_t:{ tcp_socket udp_socket } name_bind; -allow ypbind_t ypbind_t:fifo_file rw_file_perms; +allow ypbind_t self:fifo_file rw_file_perms; allow ypbind_t { sysctl_t sysctl_kernel_t }:dir search; allow ypbind_t sysctl_kernel_t:file { getattr read };
targeted/domains/unconfined.te +1 -1
@@ -37,4 +37,4 @@ user_typealias(user) allow unconfined_t unlabeled_t:filesystem *; -allow unlabeled_t unlabeled_t:filesystem { associate }; +allow unlabeled_t self:filesystem { associate };
types/file.te +9 -9
@@ -263,31 +263,31 @@ ') # Allow the pty to be associated with the file system. -allow devpts_t devpts_t:filesystem associate; +allow devpts_t self:filesystem associate; type tmpfs_t, file_type, sysadmfile, fs_type, root_dir_type; allow { tmpfs_t tmp_t } tmpfs_t:filesystem associate; type autofs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; -allow autofs_t autofs_t:filesystem associate; +allow autofs_t self:filesystem associate; type usbdevfs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; -allow usbdevfs_t usbdevfs_t:filesystem associate; +allow usbdevfs_t self:filesystem associate; type sysfs_t, fs_type, root_dir_type, sysadmfile; -allow sysfs_t sysfs_t:filesystem associate; +allow sysfs_t self:filesystem associate; type iso9660_t, fs_type, root_dir_type, noexattrfile, sysadmfile; -allow iso9660_t iso9660_t:filesystem associate; +allow iso9660_t self:filesystem associate; type romfs_t, fs_type, root_dir_type, sysadmfile; -allow romfs_t romfs_t:filesystem associate; +allow romfs_t self:filesystem associate; type ramfs_t, fs_type, root_dir_type, sysadmfile; -allow ramfs_t ramfs_t:filesystem associate; +allow ramfs_t self:filesystem associate; type dosfs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; -allow dosfs_t dosfs_t:filesystem associate; +allow dosfs_t self:filesystem associate; # udev_runtime_t is the type of the udev table file type udev_runtime_t, file_type, sysadmfile;
@@ -296,7 +296,7 @@ type krb5_conf_t, file_type, sysadmfile; type cifs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; -allow cifs_t cifs_t:filesystem associate; +allow cifs_t self:filesystem associate; typealias cifs_t alias sambafs_t; # removable_t is the default type of all removable media
Quoted 3 lines · Thomas Bleher
I just did a global search and replace to clean up rules of the form
allow some_domain_t some_domain_t:capability setuid;This makes the policy easier to read.
Attached is a small patch to audit2allow in order to make this ugliness less frequent in the future.
Please apply.
Thomas
Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA D09E C562 2BAE B2F4 ABE7
audit2allow 2004-10-11 16:37:20.472947328 +0200 renamed from audit2allow.old 2004-10-11 16:36:18.760329072 +0200 +3 -0
@@ -124,6 +124,9 @@ foreach $k (sort keys %rules) { my ($a,$scontext,$tcontext,$tclass) = split /\|/, $k; + if ($scontext eq $tcontext) { + $tcontext = 'self'; + } print OUT "allow $scontext $tcontext:$tclass {"; my $access_types = $rules{$k};
Merged.
Quoted 6 lines · Thomas Bleher
I just did a global search and replace to clean up rules of the form
allow some_domain_t some_domain_t:capability setuid;This makes the policy easier to read.
Please apply.
Thomas
Signature · 7 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.