Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser  
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#######################################
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# General file-related types
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# unlabeled_t is the type of unlabeled objects.
Chris PeBenito ab58ad
# Objects that have no known labeling information or that
Chris PeBenito ab58ad
# have labels that are no longer valid are treated as having this type.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type unlabeled_t, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# fs_t is the default type for conventional filesystems.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type fs_t, fs_type;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# needs more work
Chris PeBenito ab58ad
type eventpollfs_t, fs_type;
Chris PeBenito ab58ad
type futexfs_t, fs_type;
Chris PeBenito ab58ad
type bdev_t, fs_type;
Chris PeBenito ab58ad
type usbfs_t, mount_point, fs_type;
Chris PeBenito ab58ad
type nfsd_fs_t, fs_type;
Chris PeBenito ab58ad
type rpc_pipefs_t, fs_type;
Chris PeBenito ab58ad
type binfmt_misc_fs_t, mount_point, fs_type;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# file_t is the default type of a file that has not yet been
Chris PeBenito ab58ad
# assigned an extended attribute (EA) value (when using a filesystem
Chris PeBenito ab58ad
# that supports EAs).
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type file_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# default_t is the default type for files that do not
Chris PeBenito ab58ad
# match any specification in the file_contexts configuration
Chris PeBenito ab58ad
# other than the generic /.* specification.
Chris PeBenito ab58ad
type default_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# root_t is the type for the root directory.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type root_t, file_type, mount_point, polyparent, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# mnt_t is the type for mount points such as /mnt/cdrom
Chris PeBenito ab58ad
type mnt_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# home_root_t is the type for the directory where user home directories
Chris PeBenito ab58ad
# are created
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type home_root_t, file_type, mount_point, polyparent, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# lost_found_t is the type for the lost+found directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type lost_found_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# boot_t is the type for files in /boot,
Chris PeBenito ab58ad
# including the kernel.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type boot_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
# system_map_t is for the system.map files in /boot
Chris PeBenito ab58ad
type system_map_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# boot_runtime_t is the type for /boot/kernel.h,
Chris PeBenito ab58ad
# which is automatically generated at boot time.
Chris PeBenito ab58ad
# only for red hat
Chris PeBenito ab58ad
type boot_runtime_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# tmp_t is the type of /tmp and /var/tmp.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type tmp_t, file_type, mount_point, sysadmfile, polydir, tmpfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# etc_t is the type of the system etc directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type etc_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# etc_mail_t is the type of /etc/mail.
Chris PeBenito ab58ad
type etc_mail_t, file_type, sysadmfile, usercanread;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# shadow_t is the type of the /etc/shadow file
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type shadow_t, file_type, secure_file_type;
Chris PeBenito ab58ad
allow auth shadow_t:file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# ld_so_cache_t is the type of /etc/ld.so.cache.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type ld_so_cache_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# etc_runtime_t is the type of various
Chris PeBenito ab58ad
# files in /etc that are automatically
Chris PeBenito ab58ad
# generated during initialization.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type etc_runtime_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# fonts_runtime_t is the type of various
Chris PeBenito ab58ad
# fonts files in /usr that are automatically
Chris PeBenito ab58ad
# generated during initialization.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type fonts_t, file_type, sysadmfile, usercanread;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# etc_aliases_t is the type of the aliases database.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type etc_aliases_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# net_conf_t is the type of the /etc/resolv.conf file.
Chris PeBenito ab58ad
# all DHCP clients and PPP need write access to this file.
Chris PeBenito ab58ad
type net_conf_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# lib_t is the type of files in the system lib directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type lib_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# shlib_t is the type of shared objects in the system lib
Chris PeBenito ab58ad
# directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
ifdef(`targeted_policy', `
Chris PeBenito ab58ad
typealias lib_t alias shlib_t;
Chris PeBenito ab58ad
', `
Chris PeBenito ab58ad
type shlib_t, file_type, sysadmfile;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# texrel_shlib_t is the type of shared objects in the system lib
Chris PeBenito ab58ad
# directories, which require text relocation.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
ifdef(`targeted_policy', `
Chris PeBenito ab58ad
typealias lib_t alias texrel_shlib_t;
Chris PeBenito ab58ad
', `
Chris PeBenito ab58ad
type texrel_shlib_t, file_type, sysadmfile;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# ld_so_t is the type of the system dynamic loaders.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type ld_so_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# bin_t is the type of files in the system bin directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type bin_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# cert_t is the type of files in the system certs directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type cert_t, file_type, sysadmfile, secure_file_type;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# ls_exec_t is the type of the ls program.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type ls_exec_t, file_type, exec_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# shell_exec_t is the type of user shells such as /bin/bash.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type shell_exec_t, file_type, exec_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# sbin_t is the type of files in the system sbin directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type sbin_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# usr_t is the type for /usr.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type usr_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# src_t is the type of files in the system src directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type src_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# var_t is the type for /var.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type var_t, file_type, mount_point, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Types for subdirectories of /var.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type var_run_t, file_type, sysadmfile;
Chris PeBenito ab58ad
type var_log_t, file_type, sysadmfile, logfile;
Chris PeBenito ab58ad
typealias var_log_t alias crond_log_t;
Chris PeBenito ab58ad
type faillog_t, file_type, sysadmfile, logfile;
Chris PeBenito ab58ad
type var_lock_t, file_type, sysadmfile, lockfile;
Chris PeBenito ab58ad
type var_lib_t, mount_point, file_type, sysadmfile;
Chris PeBenito ab58ad
# for /var/{spool,lib}/texmf index files
Chris PeBenito ab58ad
type tetex_data_t, file_type, sysadmfile, tmpfile;
Chris PeBenito ab58ad
type var_spool_t, file_type, sysadmfile, tmpfile;
Chris PeBenito ab58ad
type var_yp_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type for /var/log/ksyms.
Chris PeBenito ab58ad
type var_log_ksyms_t, file_type, sysadmfile, logfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type for /var/log/lastlog.
Chris PeBenito ab58ad
type lastlog_t, file_type, sysadmfile, logfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type for /var/lib/nfs.
Chris PeBenito ab58ad
type var_lib_nfs_t, file_type, mount_point, sysadmfile, usercanread;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# wtmp_t is the type of /var/log/wtmp.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type wtmp_t, file_type, sysadmfile, logfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# cron_spool_t is the type for /var/spool/cron.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type cron_spool_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# print_spool_t is the type for /var/spool/lpd and /var/spool/cups.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type print_spool_t, file_type, sysadmfile, tmpfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# mail_spool_t is the type for /var/spool/mail.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type mail_spool_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# mqueue_spool_t is the type for /var/spool/mqueue.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type mqueue_spool_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# man_t is the type for the man directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type man_t, file_type, sysadmfile;
Chris PeBenito ab58ad
typealias man_t alias catman_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# readable_t is a general type for
Chris PeBenito ab58ad
# files that are readable by all domains.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type readable_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# 
Chris PeBenito ab58ad
# Base type for the tests directory.
Chris PeBenito ab58ad
# 
Chris PeBenito ab58ad
type test_file_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# poly_t is the type for the polyinstantiated directories.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type poly_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# swapfile_t is for swap files
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type swapfile_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# locale_t is the type for system localization
Chris PeBenito ab58ad
# 
Chris PeBenito ab58ad
type locale_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Allow each file type to be associated with 
Chris PeBenito ab58ad
# the default file system type.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
allow { file_type device_type ttyfile } fs_t:filesystem associate;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type tmpfs_t, file_type, mount_point, sysadmfile, fs_type;
Chris PeBenito ab58ad
allow { logfile tmpfs_t tmpfile home_type } tmpfs_t:filesystem associate;
Chris PeBenito ab58ad
allow { logfile tmpfile home_type } tmp_t:filesystem associate;
Chris PeBenito ab58ad
ifdef(`distro_redhat', `
Chris PeBenito ab58ad
allow { dev_fs ttyfile } { tmpfs_t tmp_t }:filesystem associate;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type autofs_t, fs_type, noexattrfile, sysadmfile;
Chris PeBenito ab58ad
type usbdevfs_t, fs_type, mount_point, noexattrfile, sysadmfile;
Chris PeBenito ab58ad
type sysfs_t, mount_point, fs_type,  sysadmfile;
Chris PeBenito ab58ad
type iso9660_t, fs_type, noexattrfile, sysadmfile;
Chris PeBenito ab58ad
type romfs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
type ramfs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
type dosfs_t, fs_type, noexattrfile, sysadmfile;
Chris PeBenito ab58ad
type hugetlbfs_t, mount_point, fs_type,  sysadmfile;
Chris PeBenito ab58ad
typealias file_t alias  mqueue_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# udev_runtime_t is the type of the udev table file
Chris PeBenito ab58ad
type udev_runtime_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# krb5_conf_t is the type of the /etc/krb5.conf file
Chris PeBenito ab58ad
type krb5_conf_t, file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type cifs_t, fs_type, noexattrfile, sysadmfile;
Chris PeBenito ab58ad
type debugfs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
type configfs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
type inotifyfs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
type capifs_t, fs_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# removable_t is the default type of all removable media
Chris PeBenito ab58ad
type removable_t, file_type, sysadmfile, usercanread;
Chris PeBenito ab58ad
allow file_type removable_t:filesystem associate;
Chris PeBenito ab58ad
allow file_type noexattrfile:filesystem associate;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type for anonymous FTP data, used by ftp and rsync
Chris PeBenito ab58ad
type public_content_t, file_type, sysadmfile, customizable;
Chris PeBenito ab58ad
type public_content_rw_t, file_type, sysadmfile, customizable;
Chris PeBenito ab58ad
typealias public_content_t alias ftpd_anon_t;
Chris PeBenito ab58ad
typealias public_content_rw_t alias ftpd_anon_rw_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# type for /tmp/.ICE-unix
Chris PeBenito ab58ad
type ice_tmp_t, file_type, sysadmfile, tmpfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# type for /usr/share/hwdata
Chris PeBenito ab58ad
type hwdata_t, file_type, sysadmfile;
Chris PeBenito ab58ad
allow { fs_type file_type } self:filesystem associate;
Chris PeBenito ab58ad