2006-01-11 18:10:49 +00:00
|
|
|
## <summary>GNU terminal multiplexer</summary>
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## The role template for the screen module.
|
2006-01-11 18:10:49 +00:00
|
|
|
## </summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="role_prefix">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## The prefix of the user role (e.g., user
|
|
|
|
## is the prefix for user_r).
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-11 18:10:49 +00:00
|
|
|
## </param>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="user_role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## The role associated with the user domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-11 18:10:49 +00:00
|
|
|
## </param>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="user_domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## The type of the user domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-11 18:10:49 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
template(`screen_role_template',`
|
2006-01-11 18:10:49 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type screen_dir_t, screen_exec_t, screen_tmp_t;
|
|
|
|
type screen_home_t, screen_var_run_t;
|
2006-01-11 18:10:49 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type $1_screen_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain($1_screen_t, screen_exec_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd($1_screen_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
ubac_constrained($1_screen_t)
|
|
|
|
role $2 types $1_screen_t;
|
2008-10-17 15:52:39 +00:00
|
|
|
|
2006-01-11 18:10:49 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow $1_screen_t self:capability { setuid setgid fsetid };
|
|
|
|
allow $1_screen_t self:process signal_perms;
|
|
|
|
allow $1_screen_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow $1_screen_t self:udp_socket create_socket_perms;
|
|
|
|
# Internal screen networking
|
|
|
|
allow $1_screen_t self:fd use;
|
|
|
|
allow $1_screen_t self:unix_stream_socket create_socket_perms;
|
|
|
|
allow $1_screen_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_dirs_pattern($1_screen_t, screen_tmp_t, screen_tmp_t)
|
|
|
|
manage_files_pattern($1_screen_t, screen_tmp_t, screen_tmp_t)
|
|
|
|
manage_fifo_files_pattern($1_screen_t, screen_tmp_t, screen_tmp_t)
|
|
|
|
files_tmp_filetrans($1_screen_t, screen_tmp_t, { file dir })
|
2006-01-11 18:10:49 +00:00
|
|
|
|
|
|
|
# Create fifo
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_fifo_files_pattern($1_screen_t, screen_dir_t, screen_var_run_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern($1_screen_t, screen_dir_t, screen_dir_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
filetrans_pattern($1_screen_t, screen_dir_t, screen_var_run_t, fifo_file)
|
2008-07-23 21:38:39 +00:00
|
|
|
files_pid_filetrans($1_screen_t, screen_dir_t, dir)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
allow $1_screen_t screen_home_t:dir list_dir_perms;
|
|
|
|
read_files_pattern($1_screen_t, screen_home_t, screen_home_t)
|
|
|
|
read_lnk_files_pattern($1_screen_t, screen_home_t, screen_home_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
allow $1_screen_t $3:process signal;
|
2006-12-12 20:08:08 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($3, screen_exec_t, $1_screen_t)
|
|
|
|
allow $3 $1_screen_t:process signal;
|
|
|
|
allow $1_screen_t $3:process signal;
|
2006-12-12 20:08:08 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_dirs_pattern($3, screen_home_t, screen_home_t)
|
|
|
|
manage_files_pattern($3, screen_home_t, screen_home_t)
|
|
|
|
manage_lnk_files_pattern($3, screen_home_t, screen_home_t)
|
2008-12-03 18:33:19 +00:00
|
|
|
relabel_dirs_pattern($3, screen_home_t, screen_home_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
relabel_files_pattern($3, screen_home_t, screen_home_t)
|
|
|
|
relabel_lnk_files_pattern($3, screen_home_t, screen_home_t)
|
2008-10-17 15:52:39 +00:00
|
|
|
|
2006-01-11 18:10:49 +00:00
|
|
|
kernel_read_system_state($1_screen_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
|
|
|
corecmd_list_bin($1_screen_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
corecmd_read_bin_files($1_screen_t)
|
|
|
|
corecmd_read_bin_symlinks($1_screen_t)
|
|
|
|
corecmd_read_bin_pipes($1_screen_t)
|
|
|
|
corecmd_read_bin_sockets($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
# Revert to the user domain when a shell is executed.
|
2008-11-05 16:10:46 +00:00
|
|
|
corecmd_shell_domtrans($1_screen_t, $3)
|
|
|
|
corecmd_bin_domtrans($1_screen_t, $3)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled($1_screen_t)
|
|
|
|
corenet_all_recvfrom_netlabel($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if($1_screen_t)
|
|
|
|
corenet_udp_sendrecv_generic_if($1_screen_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1_screen_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes($1_screen_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports($1_screen_t)
|
|
|
|
corenet_udp_sendrecv_all_ports($1_screen_t)
|
|
|
|
corenet_tcp_connect_all_ports($1_screen_t)
|
|
|
|
|
|
|
|
dev_dontaudit_getattr_all_chr_files($1_screen_t)
|
|
|
|
dev_dontaudit_getattr_all_blk_files($1_screen_t)
|
|
|
|
# for SSP
|
|
|
|
dev_read_urand($1_screen_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
|
|
|
files_search_tmp($1_screen_t)
|
|
|
|
files_search_home($1_screen_t)
|
|
|
|
files_list_home($1_screen_t)
|
|
|
|
files_read_usr_files($1_screen_t)
|
|
|
|
files_read_etc_files($1_screen_t)
|
|
|
|
|
|
|
|
fs_search_auto_mountpoints($1_screen_t)
|
|
|
|
fs_getattr_xattr_fs($1_screen_t)
|
|
|
|
|
2006-01-11 19:29:54 +00:00
|
|
|
auth_dontaudit_read_shadow($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
auth_dontaudit_exec_utempter($1_screen_t)
|
|
|
|
|
|
|
|
# Write to utmp.
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
|
|
|
logging_send_syslog_msg($1_screen_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization($1_screen_t)
|
|
|
|
|
|
|
|
seutil_read_config($1_screen_t)
|
|
|
|
|
|
|
|
sysnet_read_config($1_screen_t)
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals($1_screen_t)
|
|
|
|
userdom_create_user_pty($1_screen_t)
|
|
|
|
userdom_user_home_domtrans($1_screen_t, $3)
|
|
|
|
userdom_setattr_user_ptys($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
|
|
|
|
tunable_policy(`read_default_t',`
|
|
|
|
files_list_default($1_screen_t)
|
|
|
|
files_read_default_files($1_screen_t)
|
|
|
|
files_read_default_symlinks($1_screen_t)
|
|
|
|
files_read_default_sockets($1_screen_t)
|
|
|
|
files_read_default_pipes($1_screen_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_samba_home_dirs',`
|
2008-11-05 16:10:46 +00:00
|
|
|
fs_cifs_domtrans($1_screen_t, $3)
|
2006-01-11 18:10:49 +00:00
|
|
|
fs_read_cifs_symlinks($1_screen_t)
|
|
|
|
fs_list_cifs($1_screen_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_nfs_home_dirs',`
|
2008-11-05 16:10:46 +00:00
|
|
|
fs_nfs_domtrans($1_screen_t, $3)
|
2006-01-11 18:10:49 +00:00
|
|
|
fs_list_nfs($1_screen_t)
|
|
|
|
fs_read_nfs_symlinks($1_screen_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-11 18:10:49 +00:00
|
|
|
nis_use_ypbind($1_screen_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use($1_screen_t)
|
2006-01-11 18:10:49 +00:00
|
|
|
')
|
|
|
|
')
|