2006-04-25 19:17:43 +00:00
|
|
|
## <summary>Restricted (scp/sftp) only shell</summary>
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
2006-09-06 22:07:25 +00:00
|
|
|
## The per role template for the rssh module.
|
2006-04-25 19:17:43 +00:00
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a derived domains which are used
|
|
|
|
## for rssh client sessions. Derived types are also created
|
|
|
|
## for read-only and read-write file access.
|
|
|
|
## </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>
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2006-09-06 22:07:25 +00:00
|
|
|
template(`rssh_per_role_template',`
|
2008-05-22 15:24:52 +00:00
|
|
|
gen_require(`
|
|
|
|
type rssh_exec_t;
|
|
|
|
attribute rssh_domain_type;
|
|
|
|
attribute rssh_ro_content_type;
|
|
|
|
')
|
2006-04-25 19:17:43 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type $1_rssh_t alias rssh_$1_t, rssh_domain_type;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain($1_rssh_t, rssh_exec_t)
|
2006-04-25 19:17:43 +00:00
|
|
|
domain_user_exemption_target($1_t)
|
|
|
|
domain_interactive_fd($1_rssh_t)
|
|
|
|
role system_r types $1_rssh_t;
|
|
|
|
|
|
|
|
type $1_rssh_devpts_t alias rssh_$1_devpts_t;
|
|
|
|
term_user_pty($1_rssh_t,$1_rssh_devpts_t)
|
|
|
|
|
|
|
|
type $1_rssh_ro_t alias rssh_$1_ro_t, rssh_ro_content_type;
|
|
|
|
userdom_user_home_content($1,$1_rssh_ro_t)
|
|
|
|
|
|
|
|
type $1_rssh_rw_t alias rssh_$1_rw_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
userdom_user_home_content($1, $1_rssh_rw_t)
|
2006-04-25 19:17:43 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow $1_rssh_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
|
|
|
allow $1_rssh_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1_rssh_t self:fifo_file rw_fifo_file_perms;
|
2006-04-25 19:17:43 +00:00
|
|
|
allow $1_rssh_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow $1_rssh_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow $1_rssh_t self:unix_dgram_socket sendto;
|
|
|
|
allow $1_rssh_t self:unix_stream_socket connectto;
|
|
|
|
allow $1_rssh_t self:shm create_shm_perms;
|
|
|
|
allow $1_rssh_t self:sem create_sem_perms;
|
|
|
|
allow $1_rssh_t self:msgq create_msgq_perms;
|
|
|
|
allow $1_rssh_t self:msg { send receive };
|
|
|
|
|
|
|
|
allow $1_rssh_t $1_rssh_devpts_t:chr_file { rw_file_perms setattr };
|
2008-07-23 21:38:39 +00:00
|
|
|
term_create_pty($1_rssh_t, $1_rssh_devpts_t)
|
2006-04-25 19:17:43 +00:00
|
|
|
|
|
|
|
allow $1_rssh_t $1_rssh_ro_t:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern($1_rssh_t, $1_rssh_ro_t, $1_rssh_ro_t)
|
2006-04-25 19:17:43 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern($1_rssh_t, $1_rssh_rw_t, $1_rssh_rw_t)
|
|
|
|
manage_files_pattern($1_rssh_t, $1_rssh_rw_t, $1_rssh_rw_t)
|
2006-04-25 19:17:43 +00:00
|
|
|
|
|
|
|
kernel_read_system_state($1_rssh_t)
|
|
|
|
kernel_read_kernel_sysctls($1_rssh_t)
|
|
|
|
|
|
|
|
files_read_etc_files($1_rssh_t)
|
|
|
|
files_read_etc_runtime_files($1_rssh_t)
|
|
|
|
files_list_home($1_rssh_t)
|
|
|
|
files_read_usr_files($1_rssh_t)
|
|
|
|
files_list_var($1_rssh_t)
|
|
|
|
|
|
|
|
fs_search_auto_mountpoints($1_rssh_t)
|
|
|
|
|
|
|
|
libs_use_ld_so($1_rssh_t)
|
|
|
|
libs_use_shared_libs($1_rssh_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg($1_rssh_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization($1_rssh_t)
|
|
|
|
|
|
|
|
userdom_use_unpriv_users_fds($1_rssh_t)
|
|
|
|
|
|
|
|
ssh_rw_tcp_sockets($1_rssh_t)
|
|
|
|
ssh_rw_stream_sockets($1_rssh_t)
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
nis_use_ypbind($1_rssh_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Transition to all user rssh domains.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rssh_spec_domtrans_all_users',`
|
|
|
|
gen_require(`
|
|
|
|
attribute rssh_domain_type;
|
|
|
|
type rssh_exec_t;
|
|
|
|
')
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
spec_domtrans_pattern($1, rssh_exec_t, rssh_domain_type)
|
2006-04-25 19:17:43 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all users rssh read-only content.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`rssh_read_all_users_ro_content',`
|
|
|
|
gen_require(`
|
|
|
|
attribute rssh_ro_content_type;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 rssh_ro_content_type:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern($1, rssh_ro_content_type, rssh_ro_content_type)
|
|
|
|
read_lnk_files_pattern($1, rssh_ro_content_type, rssh_ro_content_type)
|
2006-04-25 19:17:43 +00:00
|
|
|
')
|