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