selinux-policy/policy/modules/apps/tvtime.if

141 lines
4.0 KiB
Plaintext
Raw Normal View History

2006-02-01 15:11:43 +00:00
## <summary> tvtime - a high quality television application </summary>
#######################################
## <summary>
2006-09-06 22:07:25 +00:00
## The per role template for the tvtime module.
2006-02-01 15:11:43 +00:00
## </summary>
## <desc>
## <p>
## This template creates a derived domains which are used
## for tvtime.
## </p>
## <p>
## This template is invoked automatically for each user, and
## generally does not need to be invoked directly
## by policy writers.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
2006-02-01 15:11:43 +00:00
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
## <param name="user_domain">
## <summary>
2006-02-01 15:11:43 +00:00
## The type of the user domain.
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
## <param name="user_role">
## <summary>
2006-02-01 15:11:43 +00:00
## The role associated with the user domain.
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
#
2006-09-06 22:07:25 +00:00
template(`tvtime_per_role_template',`
gen_require(`
type tvtime_exec_t;
')
2006-02-01 15:11:43 +00:00
########################################
#
# Declarations
#
type $1_tvtime_t;
domain_type($1_tvtime_t)
domain_entry_file($1_tvtime_t,tvtime_exec_t)
role $3 types $1_tvtime_t;
type $1_tvtime_home_t alias $1_tvtime_rw_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_content($1,$1_tvtime_home_t)
2006-02-01 15:11:43 +00:00
files_poly_member($1_tvtime_home_t)
type $1_tvtime_tmp_t;
files_tmp_file($1_tvtime_tmp_t)
2006-02-15 16:42:51 +00:00
type $1_tvtime_tmpfs_t;
files_tmpfs_file($1_tvtime_tmpfs_t)
2006-02-01 15:11:43 +00:00
########################################
#
# Local policy
#
allow $1_tvtime_t self:capability { setuid sys_nice sys_resource };
allow $1_tvtime_t self:process setsched;
allow $1_tvtime_t self:unix_dgram_socket rw_socket_perms;
allow $1_tvtime_t self:unix_stream_socket rw_stream_socket_perms;
# X access, Home files
2006-12-12 20:08:08 +00:00
manage_dirs_pattern($1_tvtime_t,$1_tvtime_home_t,$1_tvtime_home_t)
manage_files_pattern($1_tvtime_t,$1_tvtime_home_t,$1_tvtime_home_t)
manage_lnk_files_pattern($1_tvtime_t,$1_tvtime_home_t,$1_tvtime_home_t)
2006-02-21 18:40:44 +00:00
userdom_user_home_dir_filetrans($1,$1_tvtime_t,$1_tvtime_home_t,dir)
2006-02-01 15:11:43 +00:00
2006-12-12 20:08:08 +00:00
manage_dirs_pattern($1_tvtime_t,$1_tvtime_tmp_t,$1_tvtime_tmp_t)
manage_files_pattern($1_tvtime_t,$1_tvtime_tmp_t,$1_tvtime_tmp_t)
files_tmp_filetrans($1_tvtime_t, $1_tvtime_tmp_t,{ file dir })
2006-02-15 16:42:51 +00:00
2006-12-12 20:08:08 +00:00
manage_files_pattern($1_tvtime_t,$1_tvtime_tmpfs_t,$1_tvtime_tmpfs_t)
manage_lnk_files_pattern($1_tvtime_t,$1_tvtime_tmpfs_t,$1_tvtime_tmpfs_t)
manage_fifo_files_pattern($1_tvtime_t,$1_tvtime_tmpfs_t,$1_tvtime_tmpfs_t)
manage_sock_files_pattern($1_tvtime_t,$1_tvtime_tmpfs_t,$1_tvtime_tmpfs_t)
fs_tmpfs_filetrans($1_tvtime_t,$1_tvtime_tmpfs_t,{ file lnk_file sock_file fifo_file })
2006-02-01 15:11:43 +00:00
# Type transition
2006-12-12 20:08:08 +00:00
domtrans_pattern($2, tvtime_exec_t, $1_tvtime_t)
2006-02-01 15:11:43 +00:00
# X access, Home files
2006-12-12 20:08:08 +00:00
manage_dirs_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
manage_files_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
manage_lnk_files_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
relabel_dirs_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
relabel_files_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
relabel_lnk_files_pattern($2,$1_tvtime_home_t,$1_tvtime_home_t)
2006-02-01 15:11:43 +00:00
# Allow the user domain to signal/ps.
2006-12-12 20:08:08 +00:00
ps_process_pattern($2,$1_tvtime_t)
2006-02-01 15:11:43 +00:00
allow $2 $1_tvtime_t:process signal_perms;
2006-02-02 15:36:00 +00:00
kernel_read_all_sysctls($1_tvtime_t)
2006-02-01 15:11:43 +00:00
kernel_get_sysvipc_info($1_tvtime_t)
dev_read_urand($1_tvtime_t)
dev_read_realtime_clock($1_tvtime_t)
2006-02-02 15:36:00 +00:00
dev_read_sound($1_tvtime_t)
2006-02-01 15:11:43 +00:00
files_read_usr_files($1_tvtime_t)
files_search_pids($1_tvtime_t)
# Read /etc/tvtime
files_read_etc_files($1_tvtime_t)
# X access, Home files
fs_search_auto_mountpoints($1_tvtime_t)
libs_use_ld_so($1_tvtime_t)
libs_use_shared_libs($1_tvtime_t)
miscfiles_read_localization($1_tvtime_t)
miscfiles_read_fonts($1_tvtime_t)
userdom_use_user_terminals($1,$1_tvtime_t)
2006-02-21 18:40:44 +00:00
userdom_read_user_home_content_files($1,$1_tvtime_t)
2006-02-01 15:11:43 +00:00
# X access, Home files
tunable_policy(`use_nfs_home_dirs',`
fs_manage_nfs_dirs($1_tvtime_t)
fs_manage_nfs_files($1_tvtime_t)
fs_manage_nfs_symlinks($1_tvtime_t)
')
tunable_policy(`use_samba_home_dirs',`
fs_manage_cifs_dirs($1_tvtime_t)
fs_manage_cifs_files($1_tvtime_t)
fs_manage_cifs_symlinks($1_tvtime_t)
')
optional_policy(`
2006-02-15 16:42:51 +00:00
xserver_user_client_template($1,$1_tvtime_t,$1_tvtime_tmpfs_t)
2006-02-01 15:11:43 +00:00
')
')