policy patch
Subsystems (3)
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
Only Red Hat needs initrc_t to be able to stat all files from an init script.
$1_login_t should not inherit a file handle from init (maybe a bug that has to be fixed - it certainly needs something other than a dontaudit).
Updated policy for the latest version of asterisk and postgrey.
No domain should have both auth and auth_chkpwd attributes. If the domain has auth then it will never have a need to run unix_chkpwd.
Removed some duplicate rules and needless {}.
Allow kudzu to do everything it wants.
Mailman should not have a dontaudit for access to src_t. Any access to src_t is a bug. The bug that caused this to be added is supposed to be fixed in Fedora now. If it turns out that /usr/src is accessed for other reasons then it's more bugs we need to fix and we don't want it hidden.
Don't use a dontaudit rule for rhgb_t access to /tmp, that will cause us pain later on if rhgb is changed to need such access.
Don't use the root_dir_type attribute for type tftpdir_t, it's usually not the root of a file system, and there's no good reason for using it. Maybe we can do as the comment suggests and remove that attribute entirely?
Put in a dontaudit rule to stop some annoying messages on sighup.
Removed the CVS comment line from amanda.fc. We don't seem to be using CVS in a way that makes sense of that line and it just makes for needless file changes on every update. Best to be consistent with the other files and remove that line.
/var/spool/mqueue is part of Sendmail. It should not be referenced apart from through the sendmail policy.
$1_tty_device_t is not a file, the attribute file_type does not belong. Also updated types/file.te to allow the terminal devices to be associated with the root fs without this attribute.
mozilla should not be permitted to write to random devices (this means append too). Now that we aren't labelling a /usr/tmp sym-link as tmp_t we can remove the access to tmp_t:lnk_file.
gam_server seems to run wild and want to explore every part of the file system. I put in a ifdef(`distro_redhat' as Fedora is the only distribution currently relying on gam. I think that some changes need to be made to gam.
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/initrc.te renamed from usr/src/se/policy/domains/program/initrc.te +12 -1
@@ -12,7 +12,7 @@ # initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, unrestricted, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') sysctl_kernel_writer; +type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, unrestricted, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer; ifdef(`sendmail.te', ` allow system_mail_t initrc_t:fd use; allow system_mail_t initrc_t:fifo_file write;
@@ -36,6 +36,7 @@ # Read system information files in /proc. allow initrc_t proc_t:dir r_dir_perms; allow initrc_t proc_t:{ file lnk_file } r_file_perms; +allow initrc_t proc_mdstat_t:file { getattr read }; # Allow IPC with self allow initrc_t self:unix_dgram_socket create_socket_perms;
@@ -63,6 +64,14 @@ allow initrc_t var_run_t:{ file sock_file lnk_file } unlink; allow initrc_t var_run_t:dir { create rmdir }; +ifdef(`distro_debian', ` +allow initrc_t etc_t:dir setattr; + +# for storing state under /dev/shm +file_type_auto_trans(initrc_t, tmpfs_t, initrc_var_run_t, dir) +allow initrc_var_run_t tmpfs_t:filesystem associate; +') + allow initrc_t framebuf_device_t:chr_file r_file_perms; # Use capabilities.
@@ -330,7 +338,9 @@ r_dir_file(initrc_t,selinux_config_t) +ifdef(`distro_redhat', ` allow initrc_t file_type:{ dir_file_class_set socket_class_set } getattr; +') ifdef(`unlimitedRC', ` unconfined_domain(initrc_t)
domains/program/login.te renamed from usr/src/se/policy/domains/program/login.te +1 -1
@@ -126,7 +126,7 @@ r_dir_file($1_login_t, selinux_config_t) allow $1_login_t mouse_device_t:chr_file { getattr setattr }; -dontaudit $1_login_t init_t:fd use; + ')dnl end login_domain macro ################################# #
domains/program/unused/asterisk.te renamed from usr/src/se/policy/domains/program/unused/asterisk.te +7 -0
@@ -15,6 +15,10 @@ allow asterisk_t proc_t:file { getattr read }; +allow asterisk_t { bin_t sbin_t }:dir search; +allow asterisk_t bin_t:lnk_file read; +can_exec(asterisk_t, bin_t) + etcdir_domain(asterisk) logdir_domain(asterisk) var_lib_domain(asterisk)
@@ -47,5 +51,8 @@ # for /var/run/asterisk allow asterisk_t self:capability dac_override; +# for shutdown +dontaudit asterisk_t self:capability sys_tty_config; + tmpfs_domain(asterisk) tmp_domain(asterisk)
domains/program/unused/consoletype.te renamed from usr/src/se/policy/domains/program/unused/consoletype.te +1 -1
@@ -52,7 +52,7 @@ allow consoletype_t pam_var_run_t:file { getattr read }; ') ifdef(`distro_redhat', ` -allow consoletype_t tmpfs_t:chr_file { getattr ioctl read write }; +allow consoletype_t tmpfs_t:chr_file rw_file_perms; ') ifdef(`firstboot.te', ` allow consoletype_t firstboot_t:fifo_file write;
domains/program/unused/cups.te renamed from usr/src/se/policy/domains/program/unused/cups.te +1 -1
@@ -184,7 +184,7 @@ allow cupsd_config_t cupsd_var_run_t:file { getattr read }; allow cupsd_config_t cupsd_t:process { signal }; allow cupsd_config_t cupsd_t:{ file lnk_file } { getattr read }; -r_dir_file(cupsd_config_t, cupsd_t) +can_ps(cupsd_config_t, cupsd_t) allow cupsd_config_t self:capability chown;
domains/program/unused/dovecot.te renamed from usr/src/se/policy/domains/program/unused/dovecot.te +1 -1
@@ -38,7 +38,7 @@ allow dovecot_t mail_spool_t:lnk_file read; allow dovecot_t var_spool_t:dir { search }; -daemon_sub_domain(dovecot_t, dovecot_auth, `, auth, auth_chkpwd') +daemon_sub_domain(dovecot_t, dovecot_auth, `, auth_chkpwd') allow dovecot_auth_t self:process { fork signal_perms }; allow dovecot_auth_t dovecot_t:unix_stream_socket { getattr accept read write ioctl }; allow dovecot_auth_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/gpm.te renamed from usr/src/se/policy/domains/program/unused/gpm.te +0 -2
@@ -32,8 +32,6 @@ allow gpm_t self:unix_dgram_socket create_socket_perms; allow gpm_t self:unix_stream_socket create_stream_socket_perms; -allow gpm_t mouse_device_t:chr_file rw_file_perms; - # Read and write ttys. allow gpm_t tty_device_t:chr_file rw_file_perms;
domains/program/unused/hald.te renamed from usr/src/se/policy/domains/program/unused/hald.te +1 -1
@@ -54,7 +54,7 @@ allow hald_t udev_tbl_t:file { getattr read }; ') -ifdef(`udev.te', ` +ifdef(`hotplug.te', ` r_dir_file(hald_t, hotplug_etc_t) ') allow hald_t usbdevfs_t:dir search;
domains/program/unused/iptables.te renamed from usr/src/se/policy/domains/program/unused/iptables.te +1 -1
@@ -54,7 +54,7 @@ ifdef(`gnome-pty-helper.te', `allow iptables_t sysadm_gph_t:fd use;') allow iptables_t proc_t:file { getattr read }; -allow iptables_t proc_net_t:dir { search }; +allow iptables_t proc_net_t:dir search; allow iptables_t proc_net_t:file { read getattr }; # system-config-network appends to /var/log
domains/program/unused/kudzu.te renamed from usr/src/se/policy/domains/program/unused/kudzu.te +5 -1
@@ -3,13 +3,17 @@ # Author: Russell Coker <[email protected]> # -daemon_base_domain(kudzu, `, etc_writer, privmodule, sysctl_kernel_writer, fs_domain') +daemon_base_domain(kudzu, `, etc_writer, privmodule, sysctl_kernel_writer, fs_domain, privmem') read_locale(kudzu_t) # for /etc/sysconfig/hwconf - probably need a new type allow kudzu_t etc_runtime_t:file rw_file_perms; +# for kmodule +allow kudzu_t zero_device_t:chr_file rx_file_perms; +allow kudzu_t memory_device_t:chr_file { read write execute }; + allow kudzu_t ramfs_t:dir search; allow kudzu_t ramfs_t:sock_file write; allow kudzu_t etc_t:file { getattr read };
domains/program/unused/mailman.te renamed from usr/src/se/policy/domains/program/unused/mailman.te +1 -3
@@ -71,8 +71,7 @@ domain_auto_trans({ httpd_t httpd_suexec_t }, mailman_cgi_exec_t, mailman_cgi_t) # should have separate types for public and private archives r_dir_file(httpd_t, mailman_archive_t) -rw_dir_file(mailman_cgi_t, mailman_archive_t) -allow mailman_cgi_t mailman_archive_t:lnk_file create_lnk_perms; +rw_dir_create_file(mailman_cgi_t, mailman_archive_t) allow httpd_t mailman_data_t:dir { getattr search }; dontaudit mailman_cgi_t httpd_log_t:file append;
@@ -84,7 +83,6 @@ allow mailman_cgi_t devtty_t:chr_file { read write }; allow mailman_cgi_t self:process { fork sigchld }; allow mailman_cgi_t var_spool_t:dir search; -dontaudit mailman_cgi_t src_t:dir search; ') allow mta_delivery_agent mailman_data_t:dir search;
domains/program/unused/ping.te renamed from usr/src/se/policy/domains/program/unused/ping.te +1 -1
@@ -55,5 +55,5 @@ # it tries to access /var/run dontaudit ping_t var_t:dir search; dontaudit ping_t devtty_t:chr_file { read write }; -dontaudit ping_t ping_t:capability sys_tty_config; +dontaudit ping_t self:capability sys_tty_config;
domains/program/unused/postgresql.te renamed from usr/src/se/policy/domains/program/unused/postgresql.te +1 -1
@@ -34,7 +34,7 @@ # capability kill is for shutdown script allow postgresql_t self:capability { kill dac_override dac_read_search chown fowner fsetid setuid setgid sys_nice sys_tty_config }; -dontaudit postgresql_t postgresql_t:capability { sys_admin }; +dontaudit postgresql_t self:capability sys_admin; etcdir_domain(postgresql) typealias postgresql_etc_t alias etc_postgresql_t;
domains/program/unused/postgrey.te renamed from usr/src/se/policy/domains/program/unused/postgrey.te +2 -1
@@ -20,10 +20,11 @@ can_network(postgrey_t) can_ypbind(postgrey_t) allow postgrey_t postgrey_port_t:tcp_socket name_bind; +allow postgrey_t self:unix_dgram_socket create_socket_perms; allow postgrey_t self:unix_stream_socket create_stream_socket_perms; allow postgrey_t proc_t:file { getattr read }; -allow postgrey_t self:capability { chown setuid }; +allow postgrey_t self:capability { chown setgid setuid }; dontaudit postgrey_t self:capability sys_tty_config; var_lib_domain(postgrey)
domains/program/unused/rhgb.te renamed from usr/src/se/policy/domains/program/unused/rhgb.te +2 -2
@@ -22,7 +22,7 @@ allow rhgb_t proc_t:file { getattr read }; allow rhgb_t devtty_t:chr_file { read write }; -allow rhgb_t tty_device_t:chr_file { ioctl read write }; +allow rhgb_t tty_device_t:chr_file rw_file_perms; read_locale(rhgb_t) allow rhgb_t { etc_t etc_runtime_t }:file { getattr read };
@@ -85,7 +85,7 @@ ifdef(`firstboot.te', ` allow rhgb_t firstboot_rw_t:file r_file_perms; ') -dontaudit rhgb_t tmp_t:dir search; +allow rhgb_t tmp_t:dir search; allow rhgb_t xdm_xserver_t:process sigkill; allow domain rhgb_devpts_t:chr_file { read write }; ifdef(`fsadm.te', `
domains/program/unused/sendmail.te renamed from usr/src/se/policy/domains/program/unused/sendmail.te +2 -0
@@ -99,5 +99,7 @@ allow system_mail_t sysctl_kernel_t:file read; dontaudit system_mail_t system_crond_tmp_t:file append; dontaudit sendmail_t admin_tty_type:chr_file { getattr ioctl }; + +# sendmail wants to read /var/run/utmp if the controlling tty is /dev/console allow sendmail_t initrc_var_run_t:file { getattr read }; dontaudit sendmail_t initrc_var_run_t:file { lock write };
domains/program/unused/sxid.te renamed from usr/src/se/policy/domains/program/unused/sxid.te +1 -0
@@ -29,6 +29,7 @@ allow sxid_t file_type:notdevfile_class_set getattr; allow sxid_t { device_t device_type }:{ chr_file blk_file } getattr; +allow sxid_t ttyfile:chr_file getattr; allow sxid_t file_type:dir { getattr read search }; allow sxid_t sysadmfile:file read; allow sxid_t root_dir_type:dir { getattr read search };
domains/program/unused/tftpd.te renamed from usr/src/se/policy/domains/program/unused/tftpd.te +1 -1
@@ -16,7 +16,7 @@ type tftp_port_t, port_type, reserved_port_type; # tftpdir_t is the type of files in the /tftpboot directories. -type tftpdir_t, file_type, root_dir_type, sysadmfile; +type tftpdir_t, file_type, sysadmfile; r_dir_file(tftpd_t, tftpdir_t) domain_auto_trans(inetd_t, tftpd_exec_t, tftpd_t)
domains/user.te renamed from usr/src/se/policy/domains/user.te +2 -0
@@ -48,6 +48,8 @@ allow $1_r $2_r; type_change $2_t $1_devpts_t:chr_file $2_devpts_t; type_change $2_t $1_tty_device_t:chr_file $2_tty_device_t; +# avoid annoying messages on terminal hangup +dontaudit $1_t { $2_devpts_t $2_tty_device_t }:chr_file ioctl; ') # Reach sysadm_t via programs like userhelper/sudo/su
file_contexts/program/amanda.fc renamed from usr/src/se/policy/file_contexts/program/amanda.fc +0 -2
@@ -1,8 +1,6 @@ # # Author: Carsten Grohmann <[email protected]> # -# $Id: amanda.fc,v 1.3 2004/03/03 20:55:53 sds Exp $ -# # amanda /etc/amanda(/.*)? system_u:object_r:amanda_config_t
file_contexts/program/sendmail.fc renamed from usr/src/se/policy/file_contexts/program/sendmail.fc +1 -0
@@ -1,5 +1,6 @@ # sendmail /etc/mail(/.*)? system_u:object_r:etc_mail_t +/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t /var/log/sendmail\.st -- system_u:object_r:sendmail_log_t /var/log/mail(/.*)? system_u:object_r:sendmail_log_t /var/run/sendmail\.pid -- system_u:object_r:sendmail_var_run_t
file_contexts/types.fc renamed from usr/src/se/policy/file_contexts/types.fc +0 -1
@@ -399,7 +396,6 @@ # /var/spool(/.*)? system_u:object_r:var_spool_t /var/spool/texmf(/.*)? system_u:object_r:tetex_data_t -/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t # # /var/log
macros/admin_macros.te renamed from usr/src/se/policy/macros/admin_macros.te +1 -1
@@ -25,7 +25,7 @@ tmp_domain($1) # Type for tty devices. -type $1_tty_device_t, file_type, sysadmfile, ttyfile, dev_fs; +type $1_tty_device_t, sysadmfile, ttyfile, dev_fs; # Inherit rules for ordinary users. base_user_domain($1)
macros/base_user_macros.te renamed from usr/src/se/policy/macros/base_user_macros.te +1 -1
@@ -349,7 +344,7 @@ # # Running ifconfig as a user generates the following # -dontaudit $1_t $1_t:socket create; +dontaudit $1_t self:socket create; dontaudit $1_t sysctl_net_t:dir search; dontaudit $1_t default_context_t:dir search;
macros/program/crontab_macros.te renamed from usr/src/se/policy/macros/program/crontab_macros.te +4 -0
@@ -55,6 +55,7 @@ allow $1_crontab_t self:process { fork signal_perms }; ifdef(`fcron.te', ` # fcron wants an instant update of a crontab change for the administrator +# also crontab does a security check for crontab -u ifelse(`$1', `sysadm', ` allow $1_crontab_t crond_t:process signal; can_setfscreate($1_crontab_t)
@@ -63,6 +64,9 @@ ')dnl end ifelse ')dnl end ifdef fcron +# for the checks used by crontab -u +dontaudit $1_crontab_t security_t:dir search; + # crontab signals crond by updating the mtime on the spooldir allow $1_crontab_t cron_spool_t:dir setattr; # Allow crond to read those crontabs in cron spool.
macros/program/mozilla_macros.te renamed from usr/src/se/policy/macros/program/mozilla_macros.te +1 -4
@@ -29,8 +30,7 @@ allow $1_mozilla_t usr_t:{ lnk_file file } { getattr read }; allow $1_mozilla_t var_lib_t:file { getattr read }; -allow $1_mozilla_t { random_device_t urandom_device_t }:chr_file { getattr ioctl read append }; - +allow $1_mozilla_t { random_device_t urandom_device_t }:chr_file { getattr ioctl read }; allow $1_mozilla_t self:socket create_socket_perms; allow $1_mozilla_t self:file { getattr read };
@@ -71,8 +71,6 @@ dontaudit $1_lpr_t $1_mozilla_t:unix_stream_socket { read write }; ') -dontaudit $1_mozilla_t tmp_t:lnk_file read; - # # This is another place where I sould like to allow system customization. # We need to allow the admin to select whether then want to allow mozilla
macros/program/screen_macros.te renamed from usr/src/se/policy/macros/program/screen_macros.te +0 -1
@@ -88,7 +88,6 @@ # get stats allow $1_screen_t proc_t:dir search; allow $1_screen_t proc_t:lnk_file read; -dontaudit $1_screen_t device_t:chr_file getattr; allow $1_screen_t etc_t:{ file lnk_file } { read getattr }; allow $1_screen_t self:dir { search read }; allow $1_screen_t self:lnk_file read;
macros/program/userhelper_macros.te renamed from usr/src/se/policy/macros/program/userhelper_macros.te +0 -3
@@ -38,9 +38,6 @@ # Inherit descriptors from the current session. allow $1_userhelper_t { init_t privfd }:fd use; -# Execute /sbin/unix_chkpwd to check the password. -allow $1_userhelper_t sbin_t:dir r_dir_perms; - can_exec($1_userhelper_t, { bin_t sbin_t userhelper_exec_t }) # Execute shells
macros/user_macros.te renamed from usr/src/se/policy/macros/user_macros.te +2 -0
@@ -197,8 +197,10 @@ dontaudit $1_t sysadm_home_t:dir { read search getattr }; dontaudit $1_t sysadm_home_t:file { read getattr append }; +ifdef(`distro_redhat', ` # gam_server fires off these when exploring with mozilla/nautilous dontaudit $1_t file_type:dir getattr; +') ifdef(`syslogd.te', ` # Some programs that are left in $1_t will try to connect
types/file.te renamed from usr/src/se/policy/types/file.te +1 -1
@@ -256,7 +256,7 @@ # Allow each file type to be associated with # the default file system type. # -allow { file_type device_type } fs_t:filesystem associate; +allow { file_type device_type ttyfile } fs_t:filesystem associate; ifdef(`distro_redhat', ` allow { dev_fs ttyfile } tmpfs_t:filesystem associate; ')
Quoted 3 lines · Russell Coker
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
i fixed the /etc/init.d script which does the /etc touching, sent a patch to the maintainer of initscripts.
lessavalook.... yes: mountvirtfs - it calls a bash function dir_writable on /etc/ in order to determine whether /etc/mtab is writeable, which is a bit of a daft way to do it.
the patch version, iirc, attempts to touch /etc/mtab instead (if it's not a symlink).
afaik, this is the only reason for allowing debian init scripts to write to /etc and it's not a very good one!
l.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Luke Kenneth Casson Leighton
Quoted 3 lines · Russell Coker
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
i fixed the
/etc/init.dscript which does the /etc touching, sent a patch to the maintainer of initscripts.
Great! Now when will that patch go into Debian/main?
Quoted 2 lines
afaik, this is the only reason for allowing debian init scripts to write to /etc and it's not a very good one!
I agree. But until the script gets fixed I think I have to do this to stop systems failing to correctly boot.
Signature · 9 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 11 lines · Russell Coker
Quoted 7 lines · Luke Kenneth Casson Leighton
Quoted 3 lines · Russell Coker
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
i fixed the
/etc/init.dscript which does the /etc touching, sent a patch to the maintainer of initscripts.Great! Now when will that patch go into Debian/main?
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270919
except duh it looks like i missed the attachment.
Quoted 5 lines
Quoted 2 lines
afaik, this is the only reason for allowing debian init scripts to write to /etc and it's not a very good one!
I agree. But until the script gets fixed I think I have to do this to stop systems failing to correctly boot.
well um i have been installing initscripts se2 version off of
http://selinux.lemuria.org/newselinux/ .debs and then updating that.
do i need to do that? [use the initscripts .deb off lemuria.org]
l.
#! /bin/sh
#
# mountvirtfs Mount all the virtual filesystems the kernel
# provides and that are required by default.
#
# This script can be called several times without
# damage; it tries to mount the virtual filesystems
# only if not mounted yet, and only updates /etc/mtab
# if it is writable and there is a need to.
#
# This functionality was previously provided by
# mountkernfs from the glibc package.
# lkcl: 2004sep09 -
#
# Version: @(#)mountvirtfs 2.85-21 18-Jun-2004 miquels
#
# Script needs to be robust and continue when parts fail,
# so we're not setting the "-e" flag. #set -e
PATH=/lib/init:/bin:/sbin
TTYGRP=5
TTYMODE=620
if [ -f /etc/default/devpts ]
then
. /etc/default/devpts
fi
TMPFS_SIZE=
if [ -f /etc/default/tmpfs ]
then
. /etc/default/tmpfs
fi
KERNEL=uname -s
umask 022
dir_writable () {
if [ -d "$1/" ] && [ -w "$1/" ] && touch -a "$1/" 2>/dev/null
then
return 0
fi
return 1
}domount () {
# Directory present ? if [ ! -d $3 ] then return fi # Do we support this filesystem type ? TYPE= if [ $1 = proc ] then case "$KERNEL" in Linux|GNU) TYPE=proc ;; *) TYPE=procfs ;; esac elif egrep -qs "$1\$" /proc/filesystems then TYPE=$1 elif egrep -qs "$2\$" /proc/filesystems then TYPE=$2 fi if [ "$TYPE" = "" ] then return fi # # Get the options from /etc/fstab. # OPTS= if [ -f /etc/fstab ] then exec 9<&0 0</etc/fstab while read FDEV FDIR FTYPE FOPTS REST do case "$FDEV" in ""|\#*) continue ;; esac if [ "$3" != "$FDIR" ] || [ "$TYPE" != "$FTYPE" ] then continue fi case "$FOPTS" in noauto|*,noauto|noauto,*|*,noauto,*) return ;; ?*) OPTS="-o$FOPTS" ;; esac break done exec 0<&9 9<&- fi # See if anything is mounted yet if ! mountpoint -q $3 then # No, do it now mount $MOUNT_N -t $TYPE $OPTS $4 $TYPE $3 else # Need to update mtab only ? if [ -n "$DO_MTAB" ] && ! egrep -sq "^([^ ]+) +$3 +" /etc/mtab then mount -f -t $TYPE $OPTS $4 $TYPE $3 fi fi }
#
# If /etc/mtab is a symlink into /proc/
# then we assume it is not writable.
#
DO_MTAB=
MOUNT_N=-n
MTAB_PATH="readlink -f /etc/mtab || :"
case "$MTAB_PATH" in
/proc/*) ;; /*) DO_MTAB=Yes MOUNT_N= ;;
esac
# really important on selinux to restore file context of /etc/mtab # otherwise mount and other programs will fail. if [ -n "$DO_MTAB" ] && [ ! -f /etc/mtab ] then :> /etc/mtab if [ -x /sbin/restorecon ]; then /sbin/restorecon /etc/mtab; fi fi
# Mount standard /proc and /sys.
domount proc "" /proc
domount sysfs "" /sys
# Mount /dev/pts. Create master ptmx node if needed.
#
# As of 2.5.68, devpts is not automounted when using devfs. So we
# mount devpts if it is compiled in (older devfs didn't require it # to be compiled in at all). # if [ "$KERNEL" = Linux ] then # # Since kernel 2.5.something, devfs doesn't include # a standard /dev/pts directory anymore. So if devfs # is mounted on /dev we need to create that directory # manually. # if grep -qs '/dev devfs' /proc/mounts then if [ ! -d /dev/pts ] then mkdir /dev/pts fi fi if [ -d /dev/pts ] then if dir_writable /dev && [ ! -c /dev/ptmx ] then mknod --mode=666 /dev/ptmx c 5 2 fi umount -l -f devpts domount devpts "" /dev/pts -ofscontext=system_u:object_r:devpts_t,gid=$TTYGRP,mode=$TTYMODE fi fi
# Mount tmpfs.
#
# Around kernel version 2.3.3x, a memory based filesystem was
# introduced to support POSIX shared memory, called shmfs.
# Later this filesystem was extended for general usage -
# provided you set the CONFIG_TMPFS compile option and mount
# it as type tmpfs.
#
# Early in the 2.4 kernel series, shmfs was renamed to tmpfs, but
# you could mount it using both type shmfs and tmpfs. Starting
# at kernel version 2.5.44, the shmfs alias was dropped.
#
# Confusingly, in kernels 2.3.x - 2.5.43 where both shmfs and
# tmpfs are present, disabling CONFIG_TMPFS actually removes
# support for shmfs, but tmpfs is still listed in /proc/filesystems
# to support SYSV and POSIX shared memory, and it should still be
# mounted under /dev/shm.
#
# Recommendation: always enable CONFIG_TMPFS and always mount
# using the tmpfs type. Forget about shmfs.
#
# Tmpfs can be used as memory filesystem, so you can limit tmpfs
# max size using /etc/default/tmpfs to prevent tmpfs from using
# up all system memory.
#
if [ -n "$TMPFS_SIZE" ]
then
tmpfs_opt="-osize=${TMPFS_SIZE}"
fi
domount tmpfs shmfs /dev/shm $tmpfs_opt# Mount usbfs/usbdevfs if /proc/bus/usb is present. #
# Usbfs/usbdevfs is used for USB related binaries/libraries. # "usbfs" and "usbdevfs" are the exact same filesystem. # "usbdevfs" was renamed to "usbfs" by linux usb developers,
# because people sometimes mistook it as a part of devfs. Usbfs # will be superseded by other filesystems (e.g. sysfs), and when # it becomes obsolete the mount action below should be removed. # if [ -d /proc/bus/usb ] then domount usbfs usbdevfs /proc/bus/usb fi
Merged.
Quoted 51 lines · Russell Coker
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
Only Red Hat needs
initrc_tto be able to stat all files from an init script.$1_login_t should not inherit a file handle from init (maybe a bug that has to be fixed - it certainly needs something other than a dontaudit).
Updated policy for the latest version of asterisk and postgrey.
No domain should have both auth and
auth_chkpwdattributes. If the domain has auth then it will never have a need to rununix_chkpwd.Removed some duplicate rules and needless {}.
Allow kudzu to do everything it wants.
Mailman should not have a dontaudit for access to
src_t. Any access tosrc_tis a bug. The bug that caused this to be added is supposed to be fixed in Fedora now. If it turns out that/usr/srcis accessed for other reasons then it's more bugs we need to fix and we don't want it hidden.Don't use a dontaudit rule for
rhgb_taccess to /tmp, that will cause us pain later on if rhgb is changed to need such access.Don't use the
root_dir_typeattribute for typetftpdir_t, it's usually not the root of a file system, and there's no good reason for using it. Maybe we can do as the comment suggests and remove that attribute entirely?Put in a dontaudit rule to stop some annoying messages on sighup.
Removed the CVS comment line from amanda.fc. We don't seem to be using CVS in a way that makes sense of that line and it just makes for needless file changes on every update. Best to be consistent with the other files and remove that line.
/var/spool/mqueueis part of Sendmail. It should not be referenced apart from through the sendmail policy.$1_tty_device_t is not a file, the attribute
file_typedoes not belong. Also updated types/file.te to allow the terminal devices to be associated with the root fs without this attribute.mozilla should not be permitted to write to random devices (this means append too). Now that we aren't labelling a
/usr/tmpsym-link astmp_twe can remove the access to tmp_t:lnk_file.
gam_serverseems to run wild and want to explore every part of the file system. I put in a ifdef(`distro_redhat' as Fedora is the only distribution currently relying on gam. I think that some changes need to be made to gam.
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.
Quoted 20 lines · Russell Coker
The attached patch makes some trivial policy changes.
Allows Debian systems to touch /etc from an init script.
Only Red Hat needs
initrc_tto be able to stat all files from an init script.$1_login_t should not inherit a file handle from init (maybe a bug that has to be fixed - it certainly needs something other than a dontaudit).
Updated policy for the latest version of asterisk and postgrey.
No domain should have both auth and
auth_chkpwdattributes. If the domain has auth then it will never have a need to rununix_chkpwd.Removed some duplicate rules and needless {}.
Allow kudzu to do everything it wants.
Mailman should not have a dontaudit for access to
src_t. Any access tosrc_tis a bug. The bug that caused this to be added is supposed to be fixed in Fedora now. If it turns out that/usr/srcis accessed for other reasons then it's more bugs we need to fix and we don't want it hidden.Don't use a dontaudit rule for
rhgb_taccess to /tmp, that will cause us pain later on if rhgb is changed to need such access.
Quoted 10 lines
Don't use the
root_dir_typeattribute for typetftpdir_t, it's usually not the root of a file system, and there's no good reason for using it. Maybe we can do as the comment suggests and remove that attribute entirely?Put in a dontaudit rule to stop some annoying messages on sighup.
Removed the CVS comment line from amanda.fc. We don't seem to be using CVS in a way that makes sense of that line and it just makes for needless file changes on every update. Best to be consistent with the other files and remove that line.
/var/spool/mqueueis part of Sendmail. It should not be referenced apart from through the sendmail policy.
/var/spool/mqueue is needed for targeted policy which does not include sendmail.te. Targeted policy uses mta.te and squirrelmail to access this directory.
Quoted 454 lines
$1_tty_device_t is not a file, the attribute
file_typedoes not belong. Also updated types/file.te to allow the terminal devices to be associated with the root fs without this attribute.mozilla should not be permitted to write to random devices (this means append too). Now that we aren't labelling a
/usr/tmpsym-link astmp_twe can remove the access to tmp_t:lnk_file.
gam_serverseems to run wild and want to explore every part of the file system. I put in a ifdef(`distro_redhat' as Fedora is the only distribution currently relying on gam. I think that some changes need to be made to gam.------------------------------------------------------------------------
diff -ru
/usr/src/se/policy/domains/program/initrc.te./domains/program/initrc.tedomains/program/initrc.te renamed from usr/src/se/policy/domains/program/initrc.te +1
-1@@ -12,7 +12,7 @@ # initrc_exec_t is the type of the init program. # # do not use privmail for sendmail as it creates a type transition conflict -type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, unrestricted, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') sysctl_kernel_writer; +type initrc_t, ifdef(`unlimitedRC', `admin, etc_writer, fs_domain, privmem, auth_write, unrestricted, ') domain, privlog, privowner, privmodule, ifdef(`sendmail.te', `', `privmail,') ifdef(`distro_debian', `etc_writer, ') sysctl_kernel_writer;ifdef(
sendmail.te',
allowsystem_mail_tinitrc_t:fd use;
allowsystem_mail_tinitrc_t:fifo_file write;domains/program/initrc.te renamed from usr/src/se/policy/domains/program/initrc.te +11
-0@@ -36,6 +36,7 @@ # Read system information files in /proc. allow initrc_t proc_t:dir r_dir_perms; allow initrc_t proc_t:{ file lnk_file } r_file_perms; +allow initrc_t proc_mdstat_t:file { getattr read }; # Allow IPC with self allow initrc_t self:unix_dgram_socket create_socket_perms;@@ -63,6 +64,14 @@ allow initrc_t var_run_t:{ file sock_file lnk_file } unlink; allow initrc_t var_run_t:dir { create rmdir }; +ifdef(`distro_debian', ` +allow initrc_t etc_t:dir setattr; + +# for storing state under /dev/shm +file_type_auto_trans(initrc_t, tmpfs_t, initrc_var_run_t, dir) +allow initrc_var_run_t tmpfs_t:filesystem associate; +') + allow initrc_t framebuf_device_t:chr_file r_file_perms; # Use capabilities.@@ -330,7 +338,9 @@ r_dir_file(initrc_t,selinux_config_t) +ifdef(`distro_redhat', ` allow initrc_t file_type:{ dir_file_class_set socket_class_set } getattr; +')ifdef(
unlimitedRC',unconfined_domain(initrc_t)diff -ru/usr/src/se/policy/domains/program/login.te./domains/program/login.tedomains/program/login.te renamed from usr/src/se/policy/domains/program/login.te +1
-1@@ -126,7 +126,7 @@ r_dir_file($1_login_t, selinux_config_t) allow $1_login_t mouse_device_t:chr_file { getattr setattr }; -dontaudit $1_login_t init_t:fd use; +')dnl end
login_domainmacro
#################################
#
diff -ru/usr/src/se/policy/domains/program/unused/asterisk.te./domains/program/unused/asterisk.tedomains/program/unused/asterisk.te renamed from usr/src/se/policy/domains/program/unused/asterisk.te +7
-0@@ -15,6 +15,10 @@ allow asterisk_t proc_t:file { getattr read }; +allow asterisk_t { bin_t sbin_t }:dir search; +allow asterisk_t bin_t:lnk_file read; +can_exec(asterisk_t, bin_t) + etcdir_domain(asterisk) logdir_domain(asterisk) var_lib_domain(asterisk)@@ -47,5 +51,8 @@ # for /var/run/asterisk allow asterisk_t self:capability dac_override; +# for shutdown +dontaudit asterisk_t self:capability sys_tty_config; + tmpfs_domain(asterisk) tmp_domain(asterisk)diff -ru
/usr/src/se/policy/domains/program/unused/consoletype.te./domains/program/unused/consoletype.tedomains/program/unused/consoletype.te renamed from usr/src/se/policy/domains/program/unused/consoletype.te +0
-0@@ -52,7 +52,7 @@ allow consoletype_t pam_var_run_t:file { getattr read }; ')ifdef(
distro_redhat',domains/program/unused/consoletype.te renamed from usr/src/se/policy/domains/program/unused/consoletype.te +1
-1-allow consoletype_t tmpfs_t:chr_file { getattr ioctl read write }; +allow consoletype_t tmpfs_t:chr_file rw_file_perms;')
ifdef(firstboot.te',
allowconsoletype_tfirstboot_t:fifo_file write;
diff -ru/usr/src/se/policy/domains/program/unused/cups.te./domains/program/unused/cups.tedomains/program/unused/cups.te renamed from usr/src/se/policy/domains/program/unused/cups.te +1
-1@@ -184,7 +184,7 @@ allow cupsd_config_t cupsd_var_run_t:file { getattr read }; allow cupsd_config_t cupsd_t:process { signal }; allow cupsd_config_t cupsd_t:{ file lnk_file } { getattr read }; -r_dir_file(cupsd_config_t, cupsd_t) +can_ps(cupsd_config_t, cupsd_t) allow cupsd_config_t self:capability chown;diff -ru
/usr/src/se/policy/domains/program/unused/dovecot.te./domains/program/unused/dovecot.tedomains/program/unused/dovecot.te renamed from usr/src/se/policy/domains/program/unused/dovecot.te +1
-1@@ -38,7 +38,7 @@ allow dovecot_t mail_spool_t:lnk_file read; allow dovecot_t var_spool_t:dir { search }; -daemon_sub_domain(dovecot_t, dovecot_auth, `, auth, auth_chkpwd') +daemon_sub_domain(dovecot_t, dovecot_auth, `, auth_chkpwd') allow dovecot_auth_t self:process { fork signal_perms }; allow dovecot_auth_t dovecot_t:unix_stream_socket { getattr accept read write ioctl }; allow dovecot_auth_t self:unix_dgram_socket create_socket_perms;diff -ru
/usr/src/se/policy/domains/program/unused/gpm.te./domains/program/unused/gpm.tedomains/program/unused/gpm.te renamed from usr/src/se/policy/domains/program/unused/gpm.te +0
-2@@ -32,8 +32,6 @@ allow gpm_t self:unix_dgram_socket create_socket_perms; allow gpm_t self:unix_stream_socket create_stream_socket_perms; -allow gpm_t mouse_device_t:chr_file rw_file_perms; - # Read and write ttys. allow gpm_t tty_device_t:chr_file rw_file_perms;diff -ru
/usr/src/se/policy/domains/program/unused/hald.te./domains/program/unused/hald.tedomains/program/unused/hald.te renamed from usr/src/se/policy/domains/program/unused/hald.te +1
-1@@ -54,7 +54,7 @@ allow hald_t udev_tbl_t:file { getattr read }; ') -ifdef(`udev.te', ` +ifdef(`hotplug.te', ` r_dir_file(hald_t, hotplug_etc_t) ') allow hald_t usbdevfs_t:dir search;diff -ru
/usr/src/se/policy/domains/program/unused/iptables.te./domains/program/unused/iptables.tedomains/program/unused/iptables.te renamed from usr/src/se/policy/domains/program/unused/iptables.te +1
-1@@ -54,7 +54,7 @@ ifdef(`gnome-pty-helper.te', `allow iptables_t sysadm_gph_t:fd use;') allow iptables_t proc_t:file { getattr read }; -allow iptables_t proc_net_t:dir { search }; +allow iptables_t proc_net_t:dir search; allow iptables_t proc_net_t:file { read getattr }; # system-config-network appends to /var/logdiff -ru
/usr/src/se/policy/domains/program/unused/kudzu.te./domains/program/unused/kudzu.tedomains/program/unused/kudzu.te renamed from usr/src/se/policy/domains/program/unused/kudzu.te +5
-1@@ -3,13 +3,17 @@ # Author: Russell Coker <[email protected]> # -daemon_base_domain(kudzu, `, etc_writer, privmodule, sysctl_kernel_writer, fs_domain') +daemon_base_domain(kudzu, `, etc_writer, privmodule, sysctl_kernel_writer, fs_domain, privmem') read_locale(kudzu_t) # for /etc/sysconfig/hwconf - probably need a new type allow kudzu_t etc_runtime_t:file rw_file_perms; +# for kmodule +allow kudzu_t zero_device_t:chr_file rx_file_perms; +allow kudzu_t memory_device_t:chr_file { read write execute }; + allow kudzu_t ramfs_t:dir search; allow kudzu_t ramfs_t:sock_file write; allow kudzu_t etc_t:file { getattr read };diff -ru
/usr/src/se/policy/domains/program/unused/mailman.te./domains/program/unused/mailman.tedomains/program/unused/mailman.te renamed from usr/src/se/policy/domains/program/unused/mailman.te +1
-3@@ -71,8 +71,7 @@ domain_auto_trans({ httpd_t httpd_suexec_t }, mailman_cgi_exec_t, mailman_cgi_t) # should have separate types for public and private archives r_dir_file(httpd_t, mailman_archive_t) -rw_dir_file(mailman_cgi_t, mailman_archive_t) -allow mailman_cgi_t mailman_archive_t:lnk_file create_lnk_perms; +rw_dir_create_file(mailman_cgi_t, mailman_archive_t) allow httpd_t mailman_data_t:dir { getattr search }; dontaudit mailman_cgi_t httpd_log_t:file append;@@ -84,7 +83,6 @@ allow mailman_cgi_t devtty_t:chr_file { read write }; allow mailman_cgi_t self:process { fork sigchld }; allow mailman_cgi_t var_spool_t:dir search; -dontaudit mailman_cgi_t src_t:dir search; ') allow mta_delivery_agent mailman_data_t:dir search;diff -ru
/usr/src/se/policy/domains/program/unused/ping.te./domains/program/unused/ping.tedomains/program/unused/ping.te renamed from usr/src/se/policy/domains/program/unused/ping.te +1
-1@@ -55,5 +55,5 @@ # it tries to access /var/run dontaudit ping_t var_t:dir search; dontaudit ping_t devtty_t:chr_file { read write }; -dontaudit ping_t ping_t:capability sys_tty_config; +dontaudit ping_t self:capability sys_tty_config;diff -ru
/usr/src/se/policy/domains/program/unused/postgresql.te./domains/program/unused/postgresql.tedomains/program/unused/postgresql.te renamed from usr/src/se/policy/domains/program/unused/postgresql.te +1
-1@@ -34,7 +34,7 @@ # capability kill is for shutdown script allow postgresql_t self:capability { kill dac_override dac_read_search chown fowner fsetid setuid setgid sys_nice sys_tty_config }; -dontaudit postgresql_t postgresql_t:capability { sys_admin }; +dontaudit postgresql_t self:capability sys_admin; etcdir_domain(postgresql) typealias postgresql_etc_t alias etc_postgresql_t;diff -ru
/usr/src/se/policy/domains/program/unused/postgrey.te./domains/program/unused/postgrey.tedomains/program/unused/postgrey.te renamed from usr/src/se/policy/domains/program/unused/postgrey.te +2
-1@@ -20,10 +20,11 @@ can_network(postgrey_t) can_ypbind(postgrey_t) allow postgrey_t postgrey_port_t:tcp_socket name_bind; +allow postgrey_t self:unix_dgram_socket create_socket_perms; allow postgrey_t self:unix_stream_socket create_stream_socket_perms; allow postgrey_t proc_t:file { getattr read }; -allow postgrey_t self:capability { chown setuid }; +allow postgrey_t self:capability { chown setgid setuid }; dontaudit postgrey_t self:capability sys_tty_config; var_lib_domain(postgrey)diff -ru
/usr/src/se/policy/domains/program/unused/rhgb.te./domains/program/unused/rhgb.tedomains/program/unused/rhgb.te renamed from usr/src/se/policy/domains/program/unused/rhgb.te +1
-1@@ -22,7 +22,7 @@ allow rhgb_t proc_t:file { getattr read }; allow rhgb_t devtty_t:chr_file { read write }; -allow rhgb_t tty_device_t:chr_file { ioctl read write }; +allow rhgb_t tty_device_t:chr_file rw_file_perms; read_locale(rhgb_t) allow rhgb_t { etc_t etc_runtime_t }:file { getattr read };@@ -85,7 +85,7 @@ifdef(
firstboot.te',
allowrhgb_tfirstboot_rw_t:filer_file_perms;
')domains/program/unused/rhgb.te renamed from usr/src/se/policy/domains/program/unused/rhgb.te +1
-1-dontaudit rhgb_t tmp_t:dir search; +allow rhgb_t tmp_t:dir search;allow
rhgb_txdm_xserver_t:process sigkill;
allow domain rhgb_devpts_t:chr_file { read write };
ifdef(fsadm.te',
diff -ru/usr/src/se/policy/domains/program/unused/sendmail.te./domains/program/unused/sendmail.tedomains/program/unused/sendmail.te renamed from usr/src/se/policy/domains/program/unused/sendmail.te +2
-0@@ -99,5 +99,7 @@ allow system_mail_t sysctl_kernel_t:file read; dontaudit system_mail_t system_crond_tmp_t:file append; dontaudit sendmail_t admin_tty_type:chr_file { getattr ioctl }; + +# sendmail wants to read /var/run/utmp if the controlling tty is /dev/console allow sendmail_t initrc_var_run_t:file { getattr read }; dontaudit sendmail_t initrc_var_run_t:file { lock write };diff -ru
/usr/src/se/policy/domains/program/unused/sxid.te./domains/program/unused/sxid.tedomains/program/unused/sxid.te renamed from usr/src/se/policy/domains/program/unused/sxid.te +1
-0@@ -29,6 +29,7 @@ allow sxid_t file_type:notdevfile_class_set getattr; allow sxid_t { device_t device_type }:{ chr_file blk_file } getattr; +allow sxid_t ttyfile:chr_file getattr; allow sxid_t file_type:dir { getattr read search }; allow sxid_t sysadmfile:file read; allow sxid_t root_dir_type:dir { getattr read search };diff -ru
/usr/src/se/policy/domains/program/unused/tftpd.te./domains/program/unused/tftpd.tedomains/program/unused/tftpd.te renamed from usr/src/se/policy/domains/program/unused/tftpd.te +1
-1@@ -16,7 +16,7 @@ type tftp_port_t, port_type, reserved_port_type; # tftpdir_t is the type of files in the /tftpboot directories. -type tftpdir_t, file_type, root_dir_type, sysadmfile; +type tftpdir_t, file_type, sysadmfile; r_dir_file(tftpd_t, tftpdir_t) domain_auto_trans(inetd_t, tftpd_exec_t, tftpd_t)diff -ru
/usr/src/se/policy/domains/user.te./domains/user.tedomains/user.te renamed from usr/src/se/policy/domains/user.te +2
-0@@ -48,6 +48,8 @@ allow $1_r $2_r; type_change $2_t $1_devpts_t:chr_file $2_devpts_t; type_change $2_t $1_tty_device_t:chr_file $2_tty_device_t; +# avoid annoying messages on terminal hangup +dontaudit $1_t { $2_devpts_t $2_tty_device_t }:chr_file ioctl; ') # Reach sysadm_t via programs like userhelper/sudo/sudiff -ru
/usr/src/se/policy/file_contexts/program/amanda.fc./file_contexts/program/amanda.fcfile_contexts/program/amanda.fc renamed from usr/src/se/policy/file_contexts/program/amanda.fc +0
-2@@ -1,8 +1,6 @@ # # Author: Carsten Grohmann <[email protected]> # -# $Id: amanda.fc,v 1.3 2004/03/03 20:55:53 sds Exp $ -# # amanda/etc/amanda(/.*)? system_u:object_r:amanda_config_t
diff -ru/usr/src/se/policy/file_contexts/program/sendmail.fc./file_contexts/program/sendmail.fcfile_contexts/program/sendmail.fc renamed from usr/src/se/policy/file_contexts/program/sendmail.fc +0
-0@@ -1,5 +1,6 @@ # sendmail/etc/mail(/.*)? system_u:object_r:etc_mail_t
+/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t
/var/log/sendmail\.st -- system_u:object_r:sendmail_log_t
/var/log/mail(/.*)? system_u:object_r:sendmail_log_t
/var/run/sendmail\.pid -- system_u:object_r:sendmail_var_run_t
diff -ru/usr/src/se/policy/file_contexts/types.fc./file_contexts/types.fcfile_contexts/types.fc renamed from usr/src/se/policy/file_contexts/types.fc +0
-0@@ -399,7 +396,6 @@ #/var/spool(/.*)? system_u:object_r:var_spool_t
/var/spool/texmf(/.*)? system_u:object_r:tetex_data_t
-/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t# #
/var/log
diff -ru/usr/src/se/policy/macros/admin_macros.te./macros/admin_macros.temacros/admin_macros.te renamed from usr/src/se/policy/macros/admin_macros.te +1
-1@@ -25,7 +25,7 @@ tmp_domain($1) # Type for tty devices. -type $1_tty_device_t, file_type, sysadmfile, ttyfile, dev_fs; +type $1_tty_device_t, sysadmfile, ttyfile, dev_fs; # Inherit rules for ordinary users. base_user_domain($1)diff -ru
/usr/src/se/policy/macros/base_user_macros.te./macros/base_user_macros.temacros/base_user_macros.te renamed from usr/src/se/policy/macros/base_user_macros.te +1
-1@@ -349,7 +344,7 @@ # # Running ifconfig as a user generates the following # -dontaudit $1_t $1_t:socket create; +dontaudit $1_t self:socket create; dontaudit $1_t sysctl_net_t:dir search; dontaudit $1_t default_context_t:dir search;diff -ru
/usr/src/se/policy/macros/program/crontab_macros.te./macros/program/crontab_macros.temacros/program/crontab_macros.te renamed from usr/src/se/policy/macros/program/crontab_macros.te +0
-0@@ -55,6 +55,7 @@ allow $1_crontab_t self:process { fork signal_perms };ifdef(
fcron.te',# fcron wants an instant update of a crontab change for the administrator +# also crontab does a security check for crontab -u ifelse(`$1', `sysadm', ` allow $1_crontab_t crond_t:process signal; can_setfscreate($1_crontab_t)macros/program/crontab_macros.te renamed from usr/src/se/policy/macros/program/crontab_macros.te +0
-0@@ -63,6 +64,9 @@')dnl end ifelse
')dnl end ifdef fcronmacros/program/crontab_macros.te renamed from usr/src/se/policy/macros/program/crontab_macros.te +3
-0+# for the checks used by crontab -u +dontaudit $1_crontab_t security_t:dir search; +# crontab signals crond by updating the mtime on the spooldir allow $1_crontab_t cron_spool_t:dir setattr; # Allow crond to read those crontabs in cron spool. diff -ru /usr/src/se/policy/macros/program/mozilla_macros.te ./macros/program/mozilla_macros.temacros/program/mozilla_macros.te renamed from usr/src/se/policy/macros/program/mozilla_macros.te +1
-4@@ -29,8 +30,7 @@ allow $1_mozilla_t usr_t:{ lnk_file file } { getattr read }; allow $1_mozilla_t var_lib_t:file { getattr read }; -allow $1_mozilla_t { random_device_t urandom_device_t }:chr_file { getattr ioctl read append }; - +allow $1_mozilla_t { random_device_t urandom_device_t }:chr_file { getattr ioctl read }; allow $1_mozilla_t self:socket create_socket_perms; allow $1_mozilla_t self:file { getattr read };@@ -71,8 +71,6 @@ dontaudit $1_lpr_t $1_mozilla_t:unix_stream_socket { read write }; ') -dontaudit $1_mozilla_t tmp_t:lnk_file read; - # # This is another place where I sould like to allow system customization. # We need to allow the admin to select whether then want to allow mozilladiff -ru
/usr/src/se/policy/macros/program/screen_macros.te./macros/program/screen_macros.temacros/program/screen_macros.te renamed from usr/src/se/policy/macros/program/screen_macros.te +0
-1@@ -88,7 +88,6 @@ # get stats allow $1_screen_t proc_t:dir search; allow $1_screen_t proc_t:lnk_file read; -dontaudit $1_screen_t device_t:chr_file getattr; allow $1_screen_t etc_t:{ file lnk_file } { read getattr }; allow $1_screen_t self:dir { search read }; allow $1_screen_t self:lnk_file read;diff -ru
/usr/src/se/policy/macros/program/userhelper_macros.te./macros/program/userhelper_macros.temacros/program/userhelper_macros.te renamed from usr/src/se/policy/macros/program/userhelper_macros.te +0
-3@@ -38,9 +38,6 @@ # Inherit descriptors from the current session. allow $1_userhelper_t { init_t privfd }:fd use; -# Execute /sbin/unix_chkpwd to check the password. -allow $1_userhelper_t sbin_t:dir r_dir_perms; - can_exec($1_userhelper_t, { bin_t sbin_t userhelper_exec_t }) # Execute shellsdiff -ru
/usr/src/se/policy/macros/user_macros.te./macros/user_macros.temacros/user_macros.te renamed from usr/src/se/policy/macros/user_macros.te +2
-0@@ -197,8 +197,10 @@ dontaudit $1_t sysadm_home_t:dir { read search getattr }; dontaudit $1_t sysadm_home_t:file { read getattr append }; +ifdef(`distro_redhat', ` # gam_server fires off these when exploring with mozilla/nautilous dontaudit $1_t file_type:dir getattr; +')ifdef(
syslogd.te',
# Some programs that are left in $1_t will try to connect diff -ru/usr/src/se/policy/types/file.te./types/file.tetypes/file.te renamed from usr/src/se/policy/types/file.te +1
-1@@ -256,7 +256,7 @@ # Allow each file type to be associated with # the default file system type. # -allow { file_type device_type } fs_t:filesystem associate; +allow { file_type device_type ttyfile } fs_t:filesystem associate;
Quoted 5 lines
ifdef(
distro_redhat',
allow {dev_fsttyfile } tmpfs_t:filesystem associate; ')
--
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.
Remove root_type_dir totally from package
Change many can_network calls to can_network_server, can_network_client or more specific.
Removing alot of code from anaconda.te (It just runs unconfined_t anyways, in permissive mode).
Added some proc_net_t fixes.
Cleanup and fixes for kudzu
Minor fixes for postgres
Other minor fixes and some changes to make Targeted policy work...
attrib.te +0 -8
@@ -225,14 +225,6 @@ # overall filesystem statistics. attribute fs_type; -# The root_dir_type attribute identifies all types assigned to -# root directories of filesystems (not limited to persistent -# filesystems). -# XXX This attribute was used to grant mountassociate permission, -# XXX but this permission is no longer defined. We can likely -# XXX remove this attribute. -attribute root_dir_type; - # The exec_type attribute identifies all types assigned # to entrypoint executables for domains. This attribute is # used in TE rules and assertions that should be applied to all
domains/program/crond.te +1 -1
@@ -147,7 +147,7 @@ ') # Stat any file and search any directory for find. -allow system_crond_t { root_dir_type file_type fs_type }:notdevfile_class_set getattr; +allow system_crond_t { file_type fs_type }:notdevfile_class_set getattr; allow system_crond_t device_type:{ chr_file blk_file } getattr; allow system_crond_t file_type:dir { read search getattr };
domains/program/ldconfig.te +1 -0
@@ -42,3 +42,4 @@ allow ldconfig_t { var_lib_t bin_t }:dir search; ') +allow ldconfig_t proc_t:file read;
domains/program/modutil.te +0 -1
@@ -77,7 +77,6 @@ ifdef(`unlimitedUtils', ` unconfined_domain(insmod_t) ') -can_network(insmod_t) can_ypbind(insmod_t) uses_shlib(insmod_t) read_locale(insmod_t)
domains/program/mount.te +1 -1
@@ -64,7 +64,7 @@ ifdef(`portmap.te', ` # for nfs -can_network(mount_t) +can_network_server(mount_t) can_ypbind(mount_t) allow mount_t port_t:{ tcp_socket udp_socket } name_bind; allow mount_t reserved_port_t:{ tcp_socket udp_socket } name_bind;
domains/program/ssh.te +1 -1
@@ -68,7 +68,7 @@ # Read /dev/urandom allow $1_t urandom_device_t:chr_file { getattr read }; -can_network($1_t) +can_network_client($1_t) 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 };
domains/program/syslogd.te +1 -1
@@ -20,7 +20,7 @@ ') # can_network is for the UDP socket -can_network(syslogd_t) +can_network_udp(syslogd_t) can_ypbind(syslogd_t) r_dir_file(syslogd_t, sysfs_t)
domains/program/unused/amanda.te +2 -2
@@ -170,7 +170,7 @@ # Network and process communication ################################### -can_network(amanda_t); +can_network_server(amanda_t); can_ypbind(amanda_t); allow amanda_t self:fifo_file { getattr read write ioctl lock };
@@ -247,7 +247,7 @@ # amrecover network and process communication ############################################# -can_network(amanda_recover_t); +can_network_server(amanda_recover_t); can_ypbind(amanda_recover_t); allow amanda_recover_t self:fifo_file { getattr ioctl read write };
domains/program/unused/anaconda.te +1 -206
242 lines not on this page · raw message
domains/program/unused/arpwatch.te +1 -1
@@ -18,7 +18,7 @@ allow arpwatch_t self:capability { net_admin net_raw setgid setuid }; -can_network(arpwatch_t) +can_network_server(arpwatch_t) allow arpwatch_t self:netlink_route_socket r_netlink_socket_perms; allow arpwatch_t self:udp_socket create_socket_perms; allow arpwatch_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/asterisk.te +1 -1
@@ -39,7 +39,7 @@ # are labeled usr_t allow asterisk_t usr_t:file r_file_perms; -can_network(asterisk_t) +can_network_server(asterisk_t) can_ypbind(asterisk_t) allow asterisk_t etc_t:file { getattr read };
domains/program/unused/automount.te +1 -1
@@ -33,7 +33,7 @@ # because config files can be shell scripts can_exec(automount_t, { etc_t automount_etc_t }) -can_network(automount_t) +can_network_server(automount_t) can_ypbind(automount_t) ifdef(`fsadm.te', `
domains/program/unused/backup.te +1 -1
@@ -26,7 +26,7 @@ # for SSP allow backup_t urandom_device_t:chr_file read; -can_network(backup_t) +can_network_server(backup_t) can_ypbind(backup_t) uses_shlib(backup_t)
domains/program/unused/bluetooth.te +1 -1
@@ -20,7 +20,7 @@ rw_dir_create_file(bluetooth_t, var_lock_t) # Use the network. -can_network(bluetooth_t) +can_network_server(bluetooth_t) can_ypbind(bluetooth_t) ifdef(`dbusd.te', ` dbusd_client(system, bluetooth)
domains/program/unused/calamaris.te +1 -1
@@ -59,7 +59,7 @@ allow calamaris_t etc_t:lnk_file read; dontaudit calamaris_t etc_t:file ioctl; dontaudit calamaris_t sysadm_home_dir_t:dir { getattr search }; -can_network(calamaris_t) +can_network_server(calamaris_t) can_ypbind(calamaris_t) ifdef(`named.te', ` can_udp_send(calamaris_t, named_t)
domains/program/unused/canna.te +1 -1
@@ -28,7 +28,7 @@ rw_dir_create_file(canna_t, canna_var_lib_t) -can_network(canna_t) +can_network_tcp(canna_t) can_ypbind(canna_t) allow userdomain canna_var_run_t:dir search;
domains/program/unused/ciped.te +1 -1
@@ -7,7 +7,7 @@ type cipe_port_t, port_type; -can_network(ciped_t) +can_network_server(ciped_t) can_ypbind(ciped_t) allow ciped_t cipe_port_t:udp_socket name_bind;
domains/program/unused/clamav.te +1 -1
@@ -22,7 +22,7 @@ allow freshclam_t sysctl_kernel_t:dir search; allow freshclam_t sysctl_kernel_t:file { getattr read }; -can_network(freshclam_t) +can_network_server(freshclam_t) can_ypbind(freshclam_t) # Access virus signatures
domains/program/unused/courier.te +1 -1
@@ -46,7 +46,7 @@ allow courier_$1_t self:capability dac_override; # Use the network. -can_network(courier_$1_t) +can_network_server(courier_$1_t) allow courier_$1_t self:fifo_file { read write getattr }; allow courier_$1_t self:unix_stream_socket create_stream_socket_perms; allow courier_$1_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/cups.te +1 -1
@@ -191,7 +191,7 @@ rw_dir_create_file(cupsd_config_t, cupsd_etc_t) rw_dir_create_file(cupsd_config_t, cupsd_rw_etc_t) -can_network(cupsd_config_t) +can_network_server_tcp(cupsd_config_t) can_tcp_connect(cupsd_config_t, cupsd_t) allow cupsd_config_t self:fifo_file rw_file_perms;
domains/program/unused/dante.te +1 -1
@@ -7,7 +7,7 @@ type socks_port_t, port_type; daemon_domain(dante) -can_network(dante_t) +can_network_server(dante_t) allow dante_t self:fifo_file { read write }; allow dante_t self:capability { setuid };
domains/program/unused/ddclient.te +1 -1
@@ -29,7 +29,7 @@ allow ddclient_t sysctl_net_t:dir { search }; # network-related goodies -can_network(ddclient_t) +can_network_server(ddclient_t) allow ddclient_t self:unix_dgram_socket create_socket_perms; # allow access to ddclient.conf and ddclient.cache
domains/program/unused/ddt-client.te +1 -1
@@ -23,7 +23,7 @@ file_type_trans(ddt_client_t, var_lib_t, var_lib_ddt_client_t) # Use the network. -can_network(ddt_client_t) +can_network_server(ddt_client_t) can_ypbind(ddt_client_t) allow ddt_client_t self:unix_stream_socket create_socket_perms; allow ddt_client_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/devfsd.te +1 -2
@@ -89,6 +89,5 @@ allow kernel_t device_t:filesystem mount; # for nss-ldap etc -can_network(devfsd_t) +can_network_client_tcp(devfsd_t) can_ypbind(devfsd_t) -allow devfsd_t self:tcp_socket create_socket_perms;
domains/program/unused/dhcpc.te +1 -1
@@ -22,7 +22,7 @@ # for SSP allow dhcpc_t urandom_device_t:chr_file read; -can_network(dhcpc_t) +can_network_client(dhcpc_t, `{ dhcpc_port_t dhcpd_port_t }') can_ypbind(dhcpc_t) allow dhcpc_t self:unix_dgram_socket create_socket_perms; allow dhcpc_t self:unix_stream_socket create_socket_perms;
domains/program/unused/dhcpd.te +1 -1
@@ -29,7 +29,7 @@ typealias dhcp_etc_t alias { etc_dhcp_t etc_dhcpc_t etc_dhcpd_t }; # Use the network. -can_network(dhcpd_t) +can_network_client(dhcpd_t) can_ypbind(dhcpd_t) allow dhcpd_t self:unix_dgram_socket create_socket_perms; allow dhcpd_t self:unix_stream_socket create_socket_perms;
domains/program/unused/dictd.te +1 -1
@@ -42,7 +42,7 @@ allow dictd_t self:unix_stream_socket create_stream_socket_perms; -can_network(dictd_t) +can_network_server(dictd_t) can_ypbind(dictd_t) can_tcp_connect(userdomain, dictd_t)
domains/program/unused/distcc.te +1 -1
@@ -4,7 +4,7 @@ # daemon_domain(distccd) -can_network(distccd_t) +can_network_server(distccd_t) can_ypbind(distccd_t) log_domain(distccd) tmp_domain(distccd)
domains/program/unused/dnsmasq.te +1 -1
@@ -16,7 +16,7 @@ allow dnsmasq_t urandom_device_t:chr_file read; # network-related goodies -can_network(dnsmasq_t) +can_network_server(dnsmasq_t) can_ypbind(dnsmasq_t) allow dnsmasq_t self:packet_socket create_socket_perms; allow dnsmasq_t self:rawip_socket create_socket_perms;
domains/program/unused/dovecot.te +1 -1
@@ -13,7 +13,7 @@ allow dovecot_t self:capability { dac_override dac_read_search chown net_bind_service setgid setuid sys_chroot }; allow dovecot_t self:process setrlimit; -can_network(dovecot_t) +can_network_client_tcp(dovecot_t) can_ypbind(dovecot_t) allow dovecot_t self:unix_dgram_socket create_socket_perms; allow dovecot_t self:unix_stream_socket create_stream_socket_perms;
domains/program/unused/dpkg.te +1 -1
@@ -297,7 +297,7 @@ allow dpkg_t device_type:{ chr_file blk_file } getattr; 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; +allow dpkg_t fs_type:dir getattr; # allow compiling and loading new policy create_dir_file(dpkg_t, { policy_src_t policy_config_t })
domains/program/unused/fingerd.te +1 -1
@@ -47,7 +47,7 @@ allow fingerd_t { ttyfile ptyfile }:chr_file getattr; # Use the network. -can_network(fingerd_t) +can_network_server(fingerd_t) can_ypbind(fingerd_t) allow fingerd_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/firstboot.te +1 -1
@@ -114,7 +114,7 @@ allow iptables_t firstboot_t:fd use; allow iptables_t firstboot_t:fifo_file write; ') -can_network(firstboot_t) +can_network_server(firstboot_t) can_ypbind(firstboot_t) ifdef(`printconf.te', ` can_exec(firstboot_t, printconf_t)
domains/program/unused/gatekeeper.te +1 -1
@@ -22,7 +22,7 @@ logdir_domain(gatekeeper) # Use the network. -can_network(gatekeeper_t) +can_network_server(gatekeeper_t) can_ypbind(gatekeeper_t) allow gatekeeper_t gatekeeper_port_t:{ udp_socket tcp_socket } name_bind; allow gatekeeper_t self:unix_stream_socket create_socket_perms;
domains/program/unused/hald.te +1 -1
@@ -33,7 +33,7 @@ allow hald_t bin_t:file getattr; 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 }; -can_network(hald_t) +can_network_server(hald_t) can_ypbind(hald_t) allow hald_t device_t:lnk_file read;
domains/program/unused/hotplug.te +2 -1
@@ -149,7 +149,7 @@ file_type_auto_trans(hotplug_t, etc_t, etc_runtime_t, file) -can_network(hotplug_t) +can_network_server(hotplug_t) can_ypbind(hotplug_t) dbusd_client(system, hotplug)
@@ -165,3 +165,4 @@ unconfined_domain(hotplug_t) ') + allow kernel_t hotplug_etc_t:dir search;
domains/program/unused/howl.te +1 -1
@@ -5,7 +5,7 @@ daemon_domain(howl) allow howl_t proc_t:file { getattr read }; -can_network(howl_t) +can_network_server(howl_t) can_ypbind(howl_t) allow howl_t self:capability { kill net_admin };
domains/program/unused/i18n_input.te +1 -1
@@ -9,7 +9,7 @@ daemon_domain(i18n_input) can_exec(i18n_input_t, i18n_input_exec_t) -can_network(i18n_input_t) +can_network_client(i18n_input_t) can_ypbind(i18n_input_t) can_tcp_connect(userdomain, i18n_input_t)
domains/program/unused/imazesrv.te +1 -1
@@ -21,7 +21,7 @@ create_append_log_file(imazesrv_t,imazesrv_log_t) -can_network(imazesrv_t) +can_network_server(imazesrv_t) allow imazesrv_t self:capability net_bind_service;
domains/program/unused/inetd.te +2 -1
@@ -20,7 +20,8 @@ daemon_domain(inetd, `ifdef(`unlimitedInetd', `,admin, etc_writer, fs_domain, auth_write, privmem')' ) -can_network(inetd_t) +can_network_client(inetd_t) + allow inetd_t self:unix_dgram_socket create_socket_perms; allow inetd_t self:unix_stream_socket create_socket_perms; allow inetd_t self:fifo_file rw_file_perms;
domains/program/unused/ipsec.te +1 -1
@@ -167,7 +167,7 @@ allow ipsec_t self:unix_stream_socket {create setopt bind listen accept read write }; # Pluto needs network access -can_network(ipsec_t) +can_network_server(ipsec_t) can_ypbind(ipsec_t) allow ipsec_t self:unix_dgram_socket { create connect write };
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(iptables_t) +can_network_server(iptables_t) can_ypbind(iptables_t) allow iptables_t bin_t:file { execute execute_no_trans };
domains/program/unused/ircd.te +1 -1
@@ -23,7 +23,7 @@ var_lib_domain(ircd) # Use the network. -can_network(ircd_t) +can_network_server(ircd_t) can_ypbind(ircd_t) #allow ircd_t self:fifo_file { read write }; allow ircd_t self:unix_stream_socket create_socket_perms;
domains/program/unused/jabberd.te +1 -1
@@ -19,7 +19,7 @@ # For SSL allow jabberd_t random_device_t:file r_file_perms; -can_network(jabberd_t) +can_network_server(jabberd_t) can_ypbind(jabberd_t) allow jabberd_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/kerberos.te +1 -5
@@ -16,10 +16,6 @@ # # Rules for the krb5kdc_t,kadmind_t domains. # -type kerberos_port_t, port_type, reserved_port_type; -type kerberos_admin_port_t, port_type, reserved_port_type; -type kerberos_master_port_t, port_type; - daemon_domain(krb5kdc) daemon_domain(kadmind)
@@ -38,7 +34,7 @@ allow kadmind_t self:capability { setuid setgid net_bind_service chown fowner dac_override sys_nice }; # krb5kdc and kadmind can use network -can_network( { krb5kdc_t kadmind_t } ) +can_network_server( { krb5kdc_t kadmind_t } ) can_ypbind( { krb5kdc_t kadmind_t } ) # allow UDP transfer to/from any program
domains/program/unused/kudzu.te +4 -2
@@ -22,7 +22,8 @@ allow kudzu_t modules_object_t:dir r_dir_perms; allow kudzu_t { modules_object_t modules_dep_t }:file { getattr read }; allow kudzu_t mouse_device_t:chr_file { read write }; -allow kudzu_t proc_t:file { getattr read }; +allow kudzu_t proc_net_t:dir r_dir_perms; +allow kudzu_t { proc_net_t proc_t }:file { getattr read }; allow kudzu_t { fixed_disk_device_t removable_device_t }:blk_file rw_file_perms; allow kudzu_t scsi_generic_device_t:chr_file r_file_perms; allow kudzu_t { bin_t sbin_t }:dir { getattr search };
@@ -92,4 +93,5 @@ ifdef(`lpd.te', ` allow kudzu_t printconf_t:file { getattr read }; ') -allow kudzu_t zero_device_t:chr_file r_file_perms; +allow kudzu_t cupsd_rw_etc_t:dir r_dir_perms; +dontaudit kudzu_t src_t:dir search;
domains/program/unused/lpd.te +2 -2
@@ -36,7 +36,7 @@ type checkpc_t, domain, privlog; role system_r types checkpc_t; uses_shlib(checkpc_t) -can_network(checkpc_t) +can_network_server(checkpc_t) can_ypbind(checkpc_t) log_domain(checkpc) type checkpc_exec_t, file_type, sysadmfile, exec_type;
@@ -103,7 +103,7 @@ allow lpd_t self:capability { setgid setuid net_bind_service dac_read_search dac_override chown fowner }; # Use the network. -can_network(lpd_t) +can_network_server(lpd_t) can_ypbind(lpd_t) allow lpd_t self:fifo_file rw_file_perms; allow lpd_t self:unix_stream_socket create_stream_socket_perms;
domains/program/unused/lrrd.te +1 -1
@@ -58,7 +58,7 @@ can_unix_connect(sysadm_t, lrrd_t) can_unix_connect(lrrd_t, lrrd_t) can_unix_send(lrrd_t, lrrd_t) -can_network(lrrd_t) +can_network_server(lrrd_t) can_ypbind(lrrd_t) ifdef(`logrotate.te', `
domains/program/unused/monopd.te +1 -1
@@ -15,7 +15,7 @@ type share_monopd_t, file_type, sysadmfile; # Use the network. -can_network(monopd_t) +can_network_server(monopd_t) can_ypbind(monopd_t) type monopd_port_t, port_type;
domains/program/unused/mrtg.te +1 -1
@@ -31,7 +31,7 @@ r_dir_file(mrtg_t, lib_t) # Use the network. -can_network(mrtg_t) +can_network_server(mrtg_t) can_ypbind(mrtg_t) allow mrtg_t self:fifo_file { getattr read write ioctl };
domains/program/unused/mysqld.te +1 -1
@@ -44,7 +44,7 @@ create_dir_file(mysqld_t, mysqld_db_t) allow mysqld_t var_lib_t:dir { getattr search }; -can_network(mysqld_t) +can_network_server(mysqld_t) can_ypbind(mysqld_t) # read config files
domains/program/unused/nagios.te +1 -1
@@ -41,7 +41,7 @@ allow nagios_t proc_t:file { getattr read }; -can_network(nagios_t) +can_network_server(nagios_t) can_ypbind(nagios_t) # read config files
domains/program/unused/named.te +4 -2
@@ -49,8 +49,9 @@ allow named_t etc_runtime_t:{ file lnk_file } { getattr read }; #Named can use network -can_network(named_t) +can_network_client(named_t) can_ypbind(named_t) + # allow UDP transfer to/from any program can_udp_send(domain, named_t) can_udp_send(named_t, domain)
@@ -100,8 +101,9 @@ type ndc_exec_t, file_type,sysadmfile, exec_type; domain_auto_trans({ sysadm_t initrc_t }, ndc_exec_t, ndc_t) uses_shlib(ndc_t) -can_network(ndc_t) +can_network_client_tcp(ndc_t) can_ypbind(ndc_t) +can_resolve(ndc_t) read_locale(ndc_t) can_tcp_connect(ndc_t, named_t)
domains/program/unused/nessusd.te +1 -1
@@ -22,7 +22,7 @@ #tmp_domain(nessusd) # Use the network. -can_network(nessusd_t) +can_network_server(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 +1 -1
@@ -22,7 +22,7 @@ allow nscd_t etc_t:file r_file_perms; allow nscd_t etc_t:lnk_file read; -can_network(nscd_t) +can_network_client(nscd_t) can_ypbind(nscd_t) file_type_auto_trans(nscd_t, var_run_t, nscd_var_run_t, sock_file)
domains/program/unused/nsd.te +2 -2
@@ -19,7 +19,7 @@ type nsd_crond_t, domain, privlog; role system_r types nsd_crond_t; uses_shlib(nsd_crond_t) -can_network(nsd_crond_t) +can_network_server(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 };
@@ -78,7 +78,7 @@ allow nsd_t etc_t:{ file lnk_file } { getattr read }; # nsd can use network -can_network(nsd_t) +can_network_server(nsd_t) can_ypbind(nsd_t) # allow client access from caching BIND ifdef(`named.te', `
domains/program/unused/ntpd.te +1 -1
@@ -37,7 +37,7 @@ allow ntpd_t etc_t:file { read getattr }; # Use the network. -can_network(ntpd_t) +can_network_client(ntpd_t) can_ypbind(ntpd_t) allow ntpd_t ntp_port_t:udp_socket name_bind; allow ntpd_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/oav-update.te +1 -1
@@ -35,4 +35,4 @@ allow oav_update_t oav_update_var_lib_t:lnk_file r_file_perms; # Can download via network -can_network(oav_update_t) +can_network_server(oav_update_t)
domains/program/unused/openvpn.te +1 -1
@@ -24,7 +24,7 @@ allow openvpn_t self:capability net_admin; r_dir_file(openvpn_t, sysctl_net_t) -can_network(openvpn_t) +can_network_server(openvpn_t) allow openvpn_t openvpn_port_t:udp_socket name_bind; # OpenVPN executes a lot of helper programs and scripts
domains/program/unused/perdition.te +1 -1
@@ -16,7 +16,7 @@ typealias perdition_etc_t alias etc_perdition_t; # Use the network. -can_network(perdition_t) +can_network_server(perdition_t) allow perdition_t self:unix_stream_socket create_socket_perms; allow perdition_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/ping.te +1 -1
@@ -31,7 +31,7 @@ domain_auto_trans(initrc_t, ping_exec_t, ping_t) uses_shlib(ping_t) -can_network(ping_t) +can_network_client(ping_t) can_ypbind(ping_t) allow ping_t etc_t:file { getattr read }; allow ping_t self:unix_stream_socket create_socket_perms;
domains/program/unused/portmap.te +1 -1
@@ -13,7 +13,7 @@ # daemon_domain(portmap, `, nscd_client_domain') -can_network(portmap_t) +can_network_server(portmap_t) can_ypbind(portmap_t) allow portmap_t self:unix_dgram_socket create_socket_perms; allow portmap_t self:unix_stream_socket create_stream_socket_perms;
domains/program/unused/portslave.te +1 -1
@@ -38,7 +38,7 @@ allow portslave_t pppd_secret_t:file r_file_perms; -can_network(portslave_t) +can_network_server(portslave_t) allow portslave_t fs_t:filesystem getattr; ifdef(`radius.te', ` can_udp_send(portslave_t, radiusd_t)
domains/program/unused/postfix.te +4 -3
@@ -117,8 +117,9 @@ allow postfix_master_t postfix_private_t:dir rw_dir_perms; allow postfix_master_t postfix_private_t:sock_file create_file_perms; allow postfix_master_t postfix_private_t:fifo_file create_file_perms; -can_network(postfix_master_t) +can_network_client(postfix_master_t) can_ypbind(postfix_master_t) + allow postfix_master_t smtp_port_t:tcp_socket name_bind; allow postfix_master_t postfix_spool_maildrop_t:dir rw_dir_perms; allow postfix_master_t postfix_spool_maildrop_t:file { unlink rename getattr };
@@ -156,7 +157,7 @@ domain_auto_trans(postfix_master_t, postfix_$1_exec_t, postfix_$1_t) allow postfix_$1_t postfix_master_t:unix_stream_socket { connectto rw_stream_socket_perms }; allow postfix_$1_t self:capability { setuid setgid dac_override }; -can_network(postfix_$1_t) +can_network_client(postfix_$1_t) can_ypbind(postfix_$1_t) ')
@@ -349,6 +350,6 @@ allow postfix_map_t self:capability setgid; allow postfix_map_t self:unix_dgram_socket create_socket_perms; dontaudit postfix_map_t var_t:dir search; -can_network(postfix_map_t) +can_network_server(postfix_map_t) allow postfix_local_t mail_spool_t:dir { remove_name }; allow postfix_local_t mail_spool_t:file { unlink };
domains/program/unused/postgresql.te +4 -1
@@ -52,7 +52,7 @@ file_type_auto_trans(postgresql_t, tmpfs_t, postgresql_tmp_t) # Use the network. -can_network(postgresql_t) +can_network_server(postgresql_t) allow postgresql_t self:fifo_file { getattr read write ioctl }; allow postgresql_t self:unix_stream_socket create_stream_socket_perms; can_unix_connect(postgresql_t, self)
@@ -126,3 +126,6 @@ dontaudit initrc_su_t sysadm_devpts_t:chr_file rw_file_perms; ') +dontaudit postgresql_t home_root_t:dir search; +can_kerberos(postgresql_t) +allow postgresql_t urandom_device_t:chr_file { getattr read };
domains/program/unused/postgrey.te +1 -1
@@ -17,7 +17,7 @@ allow postgrey_t { etc_t etc_runtime_t }:file { getattr read }; etcdir_domain(postgrey) -can_network(postgrey_t) +can_network_server_tcp(postgrey_t) can_ypbind(postgrey_t) allow postgrey_t postgrey_port_t:tcp_socket name_bind; allow postgrey_t self:unix_dgram_socket create_socket_perms;
domains/program/unused/pppd.te +1 -1
@@ -30,7 +30,7 @@ log_domain(pppd) # Use the network. -can_network(pppd_t) +can_network_server(pppd_t) can_ypbind(pppd_t) # Use capabilities.
domains/program/unused/privoxy.te +1 -1
@@ -16,7 +16,7 @@ allow privoxy_t self:capability net_bind_service; # Use the network. -can_network(privoxy_t) +can_network_server(privoxy_t) allow privoxy_t port_t:{ tcp_socket udp_socket } name_bind; allow privoxy_t etc_t:file { getattr read }; allow privoxy_t self:capability { setgid setuid };
domains/program/unused/procmail.te +1 -1
@@ -18,7 +18,7 @@ uses_shlib(procmail_t) allow procmail_t device_t:dir search; -can_network(procmail_t) +can_network_server(procmail_t) can_ypbind(procmail_t) allow procmail_t self:capability { sys_nice chown setuid setgid dac_override };
domains/program/unused/qmail.te +4 -4
@@ -84,7 +84,7 @@ qmaild_sub_domain(qmail_rspawn_t, qmail_remote) allow qmail_rspawn_t qmail_remote_exec_t:file read; -can_network(qmail_remote_t) +can_network_server(qmail_remote_t) can_ypbind(qmail_remote_t) allow qmail_remote_t qmail_spool_t:dir search; allow qmail_remote_t qmail_spool_t:file rw_file_perms;
@@ -125,12 +125,12 @@ allow qmail_tcp_env_t inetd_t:tcp_socket { read write getattr }; allow qmail_tcp_env_t inetd_t:process sigchld; allow qmail_tcp_env_t sbin_t:dir search; -can_network(qmail_tcp_env_t) +can_network_server(qmail_tcp_env_t) can_ypbind(qmail_tcp_env_t) qmaild_sub_domain(qmail_tcp_env_t, qmail_smtpd) allow qmail_tcp_env_t qmail_smtpd_exec_t:file read; -can_network(qmail_smtpd_t) +can_network_server(qmail_smtpd_t) can_ypbind(qmail_smtpd_t) allow qmail_smtpd_t inetd_t:fd use; allow qmail_smtpd_t inetd_t:tcp_socket { read write };
@@ -181,7 +181,7 @@ qmaild_sub_domain(user_crond_t, qmail_serialmail) in_user_role(qmail_serialmail_t) -can_network(qmail_serialmail_t) +can_network_server(qmail_serialmail_t) can_ypbind(qmail_serialmail_t) can_exec(qmail_serialmail_t, qmail_serialmail_exec_t) allow qmail_serialmail_t self:process { fork signal_perms };
domains/program/unused/radius.te +1 -1
@@ -50,7 +50,7 @@ # gzip also needs chown access to preserve GID for radwtmp files allow radiusd_t self:capability { chown dac_override fsetid kill setgid setuid sys_resource sys_tty_config }; -can_network(radiusd_t) +can_network_server(radiusd_t) can_ypbind(radiusd_t) allow radiusd_t { radius_port_t radacct_port_t }:udp_socket name_bind;
domains/program/unused/radvd.te +1 -1
@@ -19,7 +19,7 @@ allow radvd_t self:{ unix_dgram_socket rawip_socket } create; allow radvd_t self:unix_stream_socket create_socket_perms; -can_network(radvd_t) +can_network_server(radvd_t) allow radvd_t proc_t:dir r_dir_perms; allow radvd_t proc_t:file { getattr read };
domains/program/unused/rhgb.te +1 -1
@@ -39,7 +39,7 @@ allow rhgb_t self:capability { sys_admin sys_tty_config }; dontaudit rhgb_t var_run_t:dir search; -can_network(rhgb_t) +can_network_server(rhgb_t) can_ypbind(rhgb_t) # for fonts
domains/program/unused/rlogind.te +1 -1
@@ -13,7 +13,7 @@ type rlogind_t, domain, privlog, auth_chkpwd, privfd; role system_r types rlogind_t; uses_shlib(rlogind_t) -can_network(rlogind_t) +can_network_server(rlogind_t) type rlogind_exec_t, file_type, sysadmfile, exec_type; domain_auto_trans(inetd_t, rlogind_exec_t, rlogind_t) ifdef(`tcpd.te', `
domains/program/unused/rpcd.te +3 -2
@@ -12,7 +12,7 @@ # define(`rpc_domain', ` daemon_base_domain($1) -can_network($1_t) +can_network_client($1_t) can_ypbind($1_t) allow $1_t etc_t:file { getattr read }; read_locale($1_t)
@@ -62,7 +62,7 @@ # nfs kernel server needs kernel UDP access. It is less risky and painful # to just give it everything. -can_network(kernel_t) +can_network_server(kernel_t) #can_udp_send(kernel_t, rpcd_t) #can_udp_send(rpcd_t, kernel_t)
@@ -125,3 +125,4 @@ r_dir_file(rpcd_t, rpc_pipefs_t) allow rpcd_t rpc_pipefs_t:sock_file { read write }; dontaudit rpcd_t selinux_config_t:dir { search }; +allow rpcd_t proc_net_t:dir search;
domains/program/unused/rshd.te +1 -1
@@ -23,7 +23,7 @@ allow rshd_t self:capability { net_bind_service setuid setgid fowner fsetid chown dac_override}; # Use the network. -can_network(rshd_t) +can_network_server(rshd_t) can_ypbind(rshd_t) allow rshd_t etc_t:file { getattr read };
domains/program/unused/samba.te +2 -2
@@ -48,7 +48,7 @@ allow smbd_t self:capability { setgid setuid sys_resource net_bind_service lease }; # Use the network. -can_network(smbd_t) +can_network_server(smbd_t) allow smbd_t urandom_device_t:chr_file { getattr read };
@@ -96,7 +96,7 @@ allow nmbd_t self:capability net_bind_service; # Use the network. -can_network(nmbd_t) +can_network_server(nmbd_t) # Permissions for Samba files in /etc/samba allow nmbd_t samba_etc_t:file { getattr read };
domains/program/unused/scannerdaemon.te +1 -1
@@ -12,7 +12,7 @@ #networking daemon_domain(scannerdaemon) -can_network(scannerdaemon_t) +can_network_server(scannerdaemon_t) ifdef(`postfix.te', `can_tcp_connect(postfix_bounce_t,scannerdaemon_t);')
domains/program/unused/sendmail.te +1 -1
@@ -25,7 +25,7 @@ allow sendmail_t self:capability { setuid setgid net_bind_service sys_nice chown sys_tty_config }; # Use the network. -can_network(sendmail_t) +can_network_client(sendmail_t) can_ypbind(sendmail_t) allow sendmail_t self:unix_stream_socket create_stream_socket_perms;
domains/program/unused/slapd.te +1 -1
@@ -23,7 +23,7 @@ tmp_domain(slapd) # Use the network. -can_network(slapd_t) +can_network_client(slapd_t) can_ypbind(slapd_t) allow slapd_t self:fifo_file { read write }; allow slapd_t self:unix_stream_socket create_socket_perms;
domains/program/unused/slocate.te +2 -2
@@ -23,9 +23,9 @@ allow locate_t { userpty_type admin_tty_type }:chr_file rw_file_perms; -allow locate_t { root_dir_type file_type }:dir r_dir_perms; +allow locate_t { fs_type file_type }:dir r_dir_perms; allow locate_t file_type:lnk_file r_file_perms; -allow locate_t { root_dir_type file_type -shadow_t }:{ lnk_file sock_file fifo_file file } getattr; +allow locate_t { file_type -shadow_t }:{ lnk_file sock_file fifo_file file } getattr; dontaudit locate_t { file_type -shadow_t }:{ lnk_file sock_file fifo_file file } read; dontaudit locate_t security_t:dir getattr; dontaudit locate_t shadow_t:file getattr;
domains/program/unused/snmpd.te +1 -1
@@ -13,7 +13,7 @@ #temp allow snmpd_t var_t:dir getattr; -can_network(snmpd_t) +can_network_client(snmpd_t) can_ypbind(snmpd_t) type snmp_port_t, port_type, reserved_port_type;
domains/program/unused/snort.te +1 -1
@@ -9,7 +9,7 @@ logdir_domain(snort) allow snort_t snort_log_t:dir create; -can_network(snort_t) +can_network_server(snort_t) type snort_etc_t, file_type, sysadmfile; # Create temporary files.
domains/program/unused/sound-server.te +1 -1
@@ -24,7 +24,7 @@ allow soundd_t device_t:lnk_file read; # Use the network. -can_network(soundd_t) +can_network_server(soundd_t) allow soundd_t self:unix_stream_socket create_stream_socket_perms; allow soundd_t self:unix_dgram_socket create_socket_perms; # allow any domain to connect to the sound server
domains/program/unused/spamd.te +1 -1
@@ -23,7 +23,7 @@ dontaudit spamd_t initrc_var_run_t:file { read write lock }; dontaudit spamd_t sysadm_home_dir_t:dir getattr; -can_network(spamd_t) +can_network_server(spamd_t) allow spamd_t self:capability net_bind_service; allow spamd_t proc_t:file { getattr read };
domains/program/unused/squid.te +1 -1
@@ -62,7 +62,7 @@ # to allow running programs from /usr/lib/squid (IE unlinkd) # also allow exec()ing itself -can_exec(squid_t, { lib_t squid_exec_t bin_t sbin_t } ) +can_exec(squid_t, { lib_t squid_exec_t bin_t sbin_t shell_exec_t } ) allow squid_t { bin_t sbin_t }:dir search; allow squid_t { bin_t sbin_t }:lnk_file read;
domains/program/unused/sxid.te +2 -2
@@ -32,10 +32,10 @@ allow sxid_t ttyfile:chr_file getattr; allow sxid_t file_type:dir { getattr read search }; allow sxid_t sysadmfile:file read; -allow sxid_t root_dir_type:dir { getattr read search }; +allow sxid_t fs_type:dir { getattr read search }; # Use the network. -can_network(sxid_t) +can_network_server(sxid_t) allow sxid_t self:fifo_file rw_file_perms; allow sxid_t self:unix_stream_socket create_socket_perms;
domains/program/unused/sysstat.te +2 -2
@@ -51,8 +51,8 @@ allow sysstat_t fs_t:filesystem getattr; # get info from /proc -allow sysstat_t { proc_t sysctl_kernel_t sysctl_t sysctl_fs_t sysctl_rpc_t }:dir r_dir_perms; -allow sysstat_t { proc_t sysctl_kernel_t sysctl_t sysctl_fs_t sysctl_rpc_t }:file { read getattr }; +allow sysstat_t { proc_t proc_net_t sysctl_kernel_t sysctl_t sysctl_fs_t sysctl_rpc_t }:dir r_dir_perms; +allow sysstat_t { proc_t proc_net_t sysctl_kernel_t sysctl_t sysctl_fs_t sysctl_rpc_t }:file { read getattr }; domain_auto_trans(initrc_t, sysstat_exec_t, sysstat_t) allow sysstat_t init_t:fd use;
domains/program/unused/tcpd.te +1 -1
@@ -21,7 +21,7 @@ # no good reason for this, probably nscd dontaudit tcpd_t var_t:dir search; -can_network(tcpd_t) +can_network_server(tcpd_t) can_ypbind(tcpd_t) allow tcpd_t self:unix_dgram_socket create_socket_perms; allow tcpd_t self:unix_stream_socket create_socket_perms;
domains/program/unused/tftpd.te +1 -1
@@ -22,7 +22,7 @@ domain_auto_trans(inetd_t, tftpd_exec_t, tftpd_t) # Use the network. -can_network(tftpd_t) +can_network_udp(tftpd_t) allow tftpd_t tftp_port_t:udp_socket name_bind; ifdef(`inetd.te', ` allow inetd_t tftp_port_t:udp_socket name_bind;
domains/program/unused/timidity.te +1 -1
@@ -5,7 +5,7 @@ # Note: You only need this policy if you want to run timidity as a server daemon_base_domain(timidity) -can_network(timidity_t) +can_network_server(timidity_t) allow timidity_t device_t:lnk_file read;
domains/program/unused/tinydns.te +1 -1
@@ -30,7 +30,7 @@ allow tinydns_t etc_runtime_t:{ file lnk_file } { getattr read }; #tinydns can use network -can_network(tinydns_t) +can_network_server(tinydns_t) allow tinydns_t dns_port_t:{ udp_socket tcp_socket } name_bind; # allow UDP transfer to/from any program can_udp_send(domain, tinydns_t)
domains/program/unused/traceroute.te +1 -1
@@ -18,7 +18,7 @@ # for user_ping: in_user_role(traceroute_t) uses_shlib(traceroute_t) -can_network(traceroute_t) +can_network_client(traceroute_t) can_ypbind(traceroute_t) allow traceroute_t node_t:rawip_socket node_bind; type traceroute_exec_t, file_type, sysadmfile, exec_type;
domains/program/unused/transproxy.te +1 -1
@@ -15,7 +15,7 @@ type transproxy_port_t, port_type; # Use the network. -can_network(transproxy_t) +can_network_server_tcp(transproxy_t) allow transproxy_t transproxy_port_t:tcp_socket name_bind; #allow transproxy_t self:fifo_file { read write };
domains/program/unused/uwimapd.te +1 -1
@@ -8,7 +8,7 @@ daemon_domain(imapd, `, auth_chkpwd, privhome') tmp_domain(imapd) -can_network(imapd_t) +can_network_server_tcp(imapd_t) #declare our own services allow imapd_t self:capability { dac_override net_bind_service setgid setuid sys_resource };
domains/program/unused/vpnc.te +1 -1
@@ -15,7 +15,7 @@ allow vpnc_t { random_device_t urandom_device_t }:chr_file read; # Use the network. -can_network(vpnc_t) +can_network_client(vpnc_t) can_ypbind(vpnc_t) allow vpnc_t self:socket create_socket_perms;
domains/program/unused/webalizer.te +1 -1
@@ -40,7 +40,7 @@ allow webalizer_t proc_t:file r_file_perms; # network -can_network(webalizer_t) +can_network_server(webalizer_t) #process communication inside webalizer itself general_domain_access(webalizer_t)
domains/program/unused/xprint.te +1 -1
@@ -30,7 +30,7 @@ ') # Use the network. -can_network(xprint_t) +can_network_server(xprint_t) can_ypbind(xprint_t) allow xprint_t self:fifo_file rw_file_perms; allow xprint_t self:unix_stream_socket create_stream_socket_perms;
domains/program/unused/ypserv.te +2 -3
@@ -16,8 +16,7 @@ allow ypserv_t self:capability { net_admin net_bind_service }; # Use the network. -can_network(ypserv_t) -allow ypserv_t port_t:{ tcp_socket udp_socket } name_bind; +can_network_server(ypserv_t) allow ypserv_t self:fifo_file rw_file_perms;
@@ -39,5 +38,5 @@ ifdef(`rpcd.te', ` allow rpcd_t ypserv_conf_t:file { getattr read }; ') -allow ypserv_t reserved_port_t:{ udp_socket tcp_socket } { name_bind }; +allow ypserv_t reserved_port_t:{ udp_socket tcp_socket } name_bind; dontaudit ypserv_t reserved_port_type:{ tcp_socket udp_socket } name_bind;
domains/program/unused/zebra.te +1 -1
@@ -9,7 +9,7 @@ type zebra_conf_t, file_type, sysadmfile; r_dir_file({ initrc_t zebra_t }, zebra_conf_t) -can_network(zebra_t) +can_network_server(zebra_t) can_ypbind(zebra_t) allow zebra_t { etc_t etc_runtime_t }:file { getattr read };
domains/user.te +1 -0
@@ -55,6 +55,7 @@ # Reach sysadm_t via programs like userhelper/sudo/su undefine(`reach_sysadm') define(`reach_sysadm', ` +ifdef(`userhelper.te', `userhelper_domain($1)') ifdef(`sudo.te', `sudo_domain($1)') ifdef(`su.te', ` su_domain($1)
file_contexts/program/hotplug.fc +1 -0
@@ -10,3 +10,4 @@ /etc/hotplug/hotplug\.functions -- system_u:object_r:sbin_t /var/run/usb(/.*)? system_u:object_r:hotplug_var_run_t /var/run/hotplug(/.*)? system_u:object_r:hotplug_var_run_t +/etc/hotplug/firmware.agent -- system_u:object_r:hotplug_exec_t
file_contexts/program/sendmail.fc +0 -1
@@ -1,6 +1,5 @@ # sendmail /etc/mail(/.*)? system_u:object_r:etc_mail_t -/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t /var/log/sendmail\.st -- system_u:object_r:sendmail_log_t /var/log/mail(/.*)? system_u:object_r:sendmail_log_t /var/run/sendmail\.pid -- system_u:object_r:sendmail_var_run_t
file_contexts/types.fc +1 -3
@@ -334,9 +334,6 @@ /usr(/.*)? system_u:object_r:usr_t /usr(/.*)?/lib(64)?(/.*)? system_u:object_r:lib_t /usr(/.*)?/lib(64)?/.*\.so(\.[^/]*)* -- system_u:object_r:shlib_t -/usr(/.*)?/java/.*\.so(\.[^/]*)* -- system_u:object_r:shlib_t -/usr(/.*)?/java/.*\.jar -- system_u:object_r:shlib_t -/usr(/.*)?/java/.*\.jsa -- system_u:object_r:shlib_t /usr(/.*)?/lib(64)?(/.*)?/ld-[^/]*\.so(\.[^/]*)* system_u:object_r:ld_so_t /usr(/.*)?/bin(/.*)? system_u:object_r:bin_t /usr(/.*)?/Bin(/.*)? system_u:object_r:bin_t
@@ -399,6 +396,7 @@ # /var/spool(/.*)? system_u:object_r:var_spool_t /var/spool/texmf(/.*)? system_u:object_r:tetex_data_t +/var/spool/(client)?mqueue(/.*)? system_u:object_r:mqueue_spool_t # # /var/log
macros/admin_macros.te +1 -0
@@ -33,6 +33,7 @@ allow $1_t self:capability setuid; ifdef(`su.te', `su_domain($1)') +ifdef(`userhelper.te', `userhelper_domain($1)') ifdef(`sudo.te', `sudo_domain($1)') # Violates the goal of limiting write access to checkpolicy.
macros/base_user_macros.te +2 -3
@@ -43,7 +43,7 @@ # for eject allow $1_t fixed_disk_device_t:blk_file getattr; -allow $1_t root_dir_type:dir { getattr }; +allow $1_t fs_type:dir { getattr }; # open office is looking for the following allow $1_t dri_device_t:chr_file getattr;
@@ -160,7 +160,6 @@ ifdef(`screen.te', `screen_domain($1)') ifdef(`tvtime.te', `tvtime_domain($1)') -ifdef(`userhelper.te', `userhelper_domain($1)') ifdef(`mozilla.te', `mozilla_domain($1)') ifdef(`games.te', `games_domain($1)') ifdef(`gpg.te', `gpg_domain($1)')
@@ -207,7 +206,7 @@ # Grant permissions to access the system DBus ifdef(`dbusd.te', ` dbusd_client(system, $1) -can_network($1_dbusd_t) +can_network_server_tcp($1_dbusd_t) allow $1_dbusd_t reserved_port_t:tcp_socket name_bind; allow $1_t system_dbusd_t:dbus { send_msg acquire_svc };
macros/program/games_domain.te +8 -0
@@ -46,5 +46,13 @@ allow $1_games_t event_device_t:chr_file getattr; allow $1_games_t mouse_device_t:chr_file getattr; allow $1_games_t self:file { getattr read }; + +# kpat spews errors +dontaudit $1_games_t bin_t:dir getattr; +dontaudit $1_games_t var_run_t:dir search; +ifdef(`xdm.te', ` +dontaudit $1_games_t xdm_xserver_tmp_t:dir getattr; +') + ')dnl end macro definition
macros/program/gph_macros.te +1 -1
@@ -55,7 +55,7 @@ allow $1_t $1_gph_t:fd use; # Use the network, e.g. for NIS lookups. -can_network($1_gph_t) +can_resolve($1_gph_t) can_ypbind($1_gph_t) allow $1_gph_t etc_t:file { getattr read };
macros/program/inetd_macros.te +1 -1
@@ -14,7 +14,7 @@ domain_auto_trans(inetd_t, $1_exec_t, $1_t) allow inetd_t $1_t:process sigkill; -can_network($1_t) +can_network_server($1_t) can_ypbind($1_t) uses_shlib($1_t) allow $1_t self:unix_dgram_socket create_socket_perms;
macros/program/irc_macros.te +1 -1
@@ -47,7 +47,7 @@ allow $1_t $1_irc_t:process signal; # Use the network. -can_network($1_irc_t) +can_network_client($1_irc_t) can_ypbind($1_irc_t) allow $1_irc_t usr_t:file { getattr read };
macros/program/kerberos_macros.te +2 -2
@@ -3,8 +3,8 @@ if (allow_kerberos) { can_network_client($1, `kerberos_port_t') can_resolve($1) -dontaudit $1 krb5_conf_t:file write; -allow $1 krb5_conf_t:file { getattr read }; } ') dnl kerberos.te +dontaudit $1 krb5_conf_t:file write; +allow $1 krb5_conf_t:file { getattr read }; ')
macros/program/lpr_macros.te +1 -1
@@ -34,7 +34,7 @@ role $1_r types $1_lpr_t; # This domain is granted permissions common to most domains (including can_net) -can_network($1_lpr_t) +can_network_client($1_lpr_t) can_ypbind($1_lpr_t) # Use capabilities.
macros/program/mozilla_macros.te +15 -0
@@ -48,6 +48,7 @@ allow $1_mozilla_t device_t:dir r_dir_perms; allow $1_mozilla_t devpts_t:dir r_dir_perms; allow $1_mozilla_t proc_t:file { getattr read }; +r_dir_file($1_mozilla_t, proc_net_t) dontaudit $1_mozilla_t tty_device_t:chr_file getattr; dontaudit $1_mozilla_t proc_t:dir read;
@@ -115,6 +116,20 @@ dontaudit $1_mozilla_t file_type:dir getattr; allow $1_mozilla_t self:sem create_sem_perms; +ifdef(`userhelper.te', ` +domain_auto_trans($1_mozilla_t, userhelper_exec_t, $1_userhelper_t) +') +dontaudit $1_mozilla_t selinux_config_t:dir search; + +# +# Rules needed to run java apps +# +allow $1_mozilla_t ld_so_cache_t:file execute; +allow $1_mozilla_t locale_t:file execute; +dontaudit $1_mozilla_t *:{ chr_file file } execute; +dontaudit $1_t ld_so_cache_t:file execute; +dontaudit $1_t locale_t:file execute; + dontaudit $1_mozilla_t selinux_config_t:dir search; ifdef(`xdm.te', `
macros/program/mta_macros.te +1 -1
@@ -33,7 +33,7 @@ role $1_r types $1_mail_t; uses_shlib($1_mail_t) -can_network($1_mail_t) +can_network_client_tcp($1_mail_t) can_ypbind($1_mail_t) allow $1_mail_t self:unix_dgram_socket create_socket_perms; allow $1_mail_t self:unix_stream_socket create_socket_perms;
macros/program/slocate_macros.te +2 -2
@@ -57,8 +57,8 @@ base_file_read_access($1_locate_t) r_dir_file($1_locate_t, { etc_t lib_t var_t }) -dontaudit $1_locate_t { root_dir_type file_type }:dir r_dir_perms; -dontaudit $1_locate_t { root_dir_type file_type -shadow_t}:file { getattr read }; +dontaudit $1_locate_t { fs_type file_type }:dir r_dir_perms; +dontaudit $1_locate_t { fs_type file_type -shadow_t}:file { getattr read }; ') ', `
macros/program/ssh_macros.te +1 -1
@@ -82,7 +82,7 @@ # Grant permissions needed to create TCP and UDP sockets and # to access the network. -can_network($1_ssh_t) +can_network_client_tcp($1_ssh_t) can_ypbind($1_ssh_t) # Use capabilities.
macros/program/userhelper_macros.te +4 -0
@@ -140,4 +140,8 @@ allow $1_userhelper_t pam_var_console_t:dir { search }; ') +ifdef(`mozilla.te', ` +domain_auto_trans($1_mozilla_t, userhelper_exec_t, $1_userhelper_t) +') + ')dnl end userhelper macro
macros/program/xauth_macros.te +1 -1
@@ -54,7 +54,7 @@ uses_shlib($1_xauth_t) # allow DNS lookups... -can_network($1_xauth_t) +can_resolve($1_xauth_t) can_ypbind($1_xauth_t) ifdef(`named.te', ` can_udp_send($1_xauth_t, named_t)
net_contexts +0 -2
@@ -113,7 +113,6 @@ portcon tcp 631 system_u:object_r:ipp_port_t portcon udp 631 system_u:object_r:ipp_port_t ') -ifdef(`kerberos.te', ` portcon tcp 88 system_u:object_r:kerberos_port_t portcon udp 88 system_u:object_r:kerberos_port_t portcon tcp 749 system_u:object_r:kerberos_admin_port_t
@@ -121,7 +120,6 @@ portcon udp 750 system_u:object_r:kerberos_port_t portcon tcp 4444 system_u:object_r:kerberos_master_port_t portcon udp 4444 system_u:object_r:kerberos_master_port_t -') ifdef(`spamd.te', `portcon tcp 783 system_u:object_r:spamd_port_t') ifdef(`rsync.te', ` portcon tcp 873 system_u:object_r:rsync_port_t
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 +4 -4
@@ -2,10 +2,10 @@ dnl 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
@@ -17,11 +17,11 @@ # 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.
types/devpts.te +1 -1
@@ -16,6 +16,6 @@ # devpts_t is the type of the devpts file system and # the type of the root directory of the file system. # -type devpts_t, fs_type, root_dir_type; +type devpts_t, fs_type;
types/file.te +14 -14
@@ -33,12 +33,12 @@ # assigned an extended attribute (EA) value (when using a filesystem # that supports EAs). # -type file_t, file_type, root_dir_type, sysadmfile; +type file_t, file_type, sysadmfile; # default_t is the default type for files that do not # match any specification in the file_contexts configuration # other than the generic /.* specification. -type default_t, file_type, root_dir_type, sysadmfile; +type default_t, file_type, sysadmfile; # # root_t is the type for the root directory.
@@ -64,7 +64,7 @@ # boot_t is the type for files in /boot, # including the kernel. # -type boot_t, file_type, root_dir_type, sysadmfile; +type boot_t, file_type, sysadmfile; # system_map_t is for the system.map files in /boot type system_map_t, file_type, sysadmfile;
@@ -157,7 +157,7 @@ # # usr_t is the type for /usr. # -type usr_t, file_type, root_dir_type, sysadmfile; +type usr_t, file_type, sysadmfile; # # src_t is the type of files in the system src directories.
@@ -167,7 +167,7 @@ # # var_t is the type for /var. # -type var_t, file_type, root_dir_type, sysadmfile; +type var_t, file_type, sysadmfile; # # Types for subdirectories of /var.
@@ -264,28 +264,28 @@ # Allow the pty to be associated with the file system. allow devpts_t self:filesystem associate; -type tmpfs_t, file_type, sysadmfile, fs_type, root_dir_type; +type tmpfs_t, file_type, sysadmfile, fs_type; allow { tmpfs_t tmp_t } tmpfs_t:filesystem associate; -type autofs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; +type autofs_t, fs_type, noexattrfile, sysadmfile; allow autofs_t self:filesystem associate; -type usbdevfs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; +type usbdevfs_t, fs_type, noexattrfile, sysadmfile; allow usbdevfs_t self:filesystem associate; -type sysfs_t, fs_type, root_dir_type, sysadmfile; +type sysfs_t, fs_type, sysadmfile; allow sysfs_t self:filesystem associate; -type iso9660_t, fs_type, root_dir_type, noexattrfile, sysadmfile; +type iso9660_t, fs_type, noexattrfile, sysadmfile; allow iso9660_t self:filesystem associate; -type romfs_t, fs_type, root_dir_type, sysadmfile; +type romfs_t, fs_type, sysadmfile; allow romfs_t self:filesystem associate; -type ramfs_t, fs_type, root_dir_type, sysadmfile; +type ramfs_t, fs_type, sysadmfile; allow ramfs_t self:filesystem associate; -type dosfs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; +type dosfs_t, fs_type, noexattrfile, sysadmfile; allow dosfs_t self:filesystem associate; # udev_runtime_t is the type of the udev table file
@@ -294,7 +294,7 @@ # krb5_conf_t is the type of the /etc/krb5.conf file type krb5_conf_t, file_type, sysadmfile; -type cifs_t, fs_type, root_dir_type, noexattrfile, sysadmfile; +type cifs_t, fs_type, noexattrfile, sysadmfile; allow cifs_t self:filesystem associate; typealias cifs_t alias sambafs_t;
types/network.te +7 -0
@@ -64,6 +64,13 @@ type mail_port_t, port_type; # +# Ports used to communicate with kerberos server +# +type kerberos_port_t, port_type, reserved_port_type; +type kerberos_admin_port_t, port_type, reserved_port_type; +type kerberos_master_port_t, port_type; + +# # port_t is the default type of INET port numbers. # The *_port_t types are used for specific port # numbers in net_contexts or net_contexts.mls.
types/nfs.te +1 -1
@@ -13,7 +13,7 @@ # The nfs_*_t types are used for specific NFS # servers in net_contexts or net_contexts.mls. # -type nfs_t, fs_type, root_dir_type; +type nfs_t, fs_type; # # Allow NFS files to be associated with an NFS file system.
types/procfs.te +1 -1
@@ -14,7 +14,7 @@ # proc_mdstat_t is the type of /proc/mdstat. # proc_net_t is the type of /proc/net. # -type proc_t, fs_type, proc_fs, root_dir_type; +type proc_t, fs_type, proc_fs; type proc_kmsg_t, proc_fs; type proc_kcore_t, proc_fs; type proc_mdstat_t, proc_fs;