Dominick Grift c9cafe1
## <summary>Restricted (scp/sftp) only shell.</summary>
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift c9cafe1
##	Role access for rssh.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="role">
Chris PeBenito 9401ae1
##	<summary>
Dominick Grift c9cafe1
##	Role allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Dominick Grift c9cafe1
##	User domain for the role.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`rssh_role',`
Chris PeBenito 9401ae1
	gen_require(`
Dominick Grift c9cafe1
		attribute_role rssh_roles;
Dominick Grift c9cafe1
		type rssh_t, rssh_exec_t, rssh_ro_t;
Dominick Grift c9cafe1
		type rssh_rw_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift c9cafe1
	roleattribute $1 rssh_roles;
Chris PeBenito 9401ae1
Dominick Grift c9cafe1
	domtrans_pattern($2, rssh_exec_t, rssh_t)
Dominick Grift c9cafe1
Dominick Grift c9cafe1
	allow $2 rssh_t:process { ptrace signal_perms };
Chris PeBenito 9401ae1
	ps_process_pattern($2, rssh_t)
Dominick Grift c9cafe1
Dominick Grift c9cafe1
	allow $2 { rssh_ro_t rssh_rw_t }:dir { manage_dir_perms relabel_dir_perms };
Dominick Grift c9cafe1
	allow $2 { rssh_ro_t rssh_rw_t }:file { manage_file_perms relabel_file_perms };
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift c9cafe1
##	Execute rssh in the rssh domain.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed to transition.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`rssh_spec_domtrans',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type rssh_t, rssh_exec_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift c9cafe1
	corecmd_search_bin($1)
Chris PeBenito 9401ae1
	spec_domtrans_pattern($1, rssh_exec_t, rssh_t)
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Execute the rssh program
Chris PeBenito 9401ae1
##	in the caller domain.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`rssh_exec',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type rssh_exec_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift c9cafe1
	corecmd_search_bin($1)
Chris PeBenito 9401ae1
	can_exec($1, rssh_exec_t)
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift c9cafe1
##	Execute a domain transition to
Dominick Grift c9cafe1
##	run rssh chroot helper.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Dominick Grift c9cafe1
##	Domain allowed to transition.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`rssh_domtrans_chroot_helper',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type rssh_chroot_helper_t, rssh_chroot_helper_exec_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift c9cafe1
	corecmd_search_bin($1)
Chris PeBenito 9401ae1
	domtrans_pattern($1, rssh_chroot_helper_exec_t, rssh_chroot_helper_t)
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift c9cafe1
##	Read users rssh read-only content.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`rssh_read_ro_content',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type rssh_ro_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	allow $1 rssh_ro_t:dir list_dir_perms;
Dominick Grift c9cafe1
	allow $1 rssh_ro_t:file read_file_perms;
Chris PeBenito 9401ae1
')