Chris PeBenito 17de1b
## <summary>File transfer protocol service</summary>
Chris PeBenito 17de1b
Chris PeBenito a53c6c
#######################################
Chris PeBenito a53c6c
## <summary>
Chris PeBenito a53c6c
##	Allow domain dyntransition to sftpd_anon domain.
Chris PeBenito a53c6c
## </summary>
Chris PeBenito a53c6c
## <param name="domain">
Chris PeBenito a53c6c
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito a53c6c
##	</summary>
Chris PeBenito a53c6c
## </param>
Chris PeBenito a53c6c
#
Chris PeBenito a53c6c
interface(`ftp_dyntrans_anon_sftpd',`
Chris PeBenito a53c6c
	gen_require(`
Chris PeBenito a53c6c
		type anon_sftpd_t;
Chris PeBenito a53c6c
	')
Chris PeBenito a53c6c
Chris PeBenito a53c6c
	dyntrans_pattern($1, anon_sftpd_t);
Chris PeBenito a53c6c
')
Chris PeBenito a53c6c
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Use ftp by connecting over TCP.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_tcp_connect',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Read ftpd etc files
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ftpd_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 82d277
	allow $1 ftpd_etc_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Read FTP transfer logs
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_read_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xferlog_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito c0868a
	allow $1 xferlog_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Execute the ftpdctl program in the ftpdctl domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito ff8f0a
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito ff8f0a
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_domtrans_ftpdctl',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ftpdctl_t, ftpdctl_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, ftpdctl_exec_t, ftpdctl_t)
Chris PeBenito 17de1b
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
########################################
Chris PeBenito 350b6a
## <summary>
Chris PeBenito 350b6a
##	Execute the ftpdctl program in the ftpdctl domain.
Chris PeBenito 350b6a
## </summary>
Chris PeBenito 350b6a
## <param name="domain">
Chris PeBenito 350b6a
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="role">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The role to allow the ftpdctl domain.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <rolecap/>
Chris PeBenito 350b6a
#
Chris PeBenito 350b6a
interface(`ftp_run_ftpdctl',`
Chris PeBenito 350b6a
	gen_require(`
Chris PeBenito 350b6a
		type ftpdctl_t;
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	ftp_domtrans_ftpdctl($1)
Chris PeBenito 350b6a
	role $2 types ftpdctl_t;
Chris PeBenito 350b6a
')
Chris PeBenito 967fd1
Chris PeBenito a53c6c
#######################################
Chris PeBenito a53c6c
## <summary>
Chris PeBenito a53c6c
##	Allow domain dyntransition to sftpd domain.
Chris PeBenito a53c6c
## </summary>
Chris PeBenito a53c6c
## <param name="domain">
Chris PeBenito a53c6c
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito a53c6c
##	</summary>
Chris PeBenito a53c6c
## </param>
Chris PeBenito a53c6c
#
Chris PeBenito a53c6c
interface(`ftp_dyntrans_sftpd',`
Chris PeBenito a53c6c
	gen_require(`
Chris PeBenito a53c6c
		type sftpd_t;
Chris PeBenito a53c6c
	')
Chris PeBenito a53c6c
Chris PeBenito a53c6c
	dyntrans_pattern($1, sftpd_t);
Chris PeBenito a53c6c
')
Chris PeBenito a53c6c
Chris PeBenito 967fd1
########################################
Chris PeBenito 967fd1
## <summary>
Chris PeBenito a53c6c
##	All of the rules required to administrate
Chris PeBenito 967fd1
##	an ftp environment
Chris PeBenito 967fd1
## </summary>
Chris PeBenito 967fd1
## <param name="domain">
Chris PeBenito 967fd1
##	<summary>
Chris PeBenito 967fd1
##	Domain allowed access.
Chris PeBenito 967fd1
##	</summary>
Chris PeBenito 967fd1
## </param>
Chris PeBenito 967fd1
## <param name="role">
Chris PeBenito 967fd1
##	<summary>
Chris PeBenito 967fd1
##	The role to be allowed to manage the ftp domain.
Chris PeBenito 967fd1
##	</summary>
Chris PeBenito 967fd1
## </param>
Chris PeBenito 967fd1
## <rolecap/>
Chris PeBenito 967fd1
#
Chris PeBenito 967fd1
interface(`ftp_admin',`
Chris PeBenito 967fd1
	gen_require(`
Chris PeBenito 967fd1
		type ftpd_t, ftpdctl_t, ftpd_tmp_t;
Dominick Grift 6bb4d4
		type ftpd_etc_t, ftpd_lock_t, ftpd_initrc_exec_t;
Chris PeBenito 967fd1
		type ftpd_var_run_t, xferlog_t;
Chris PeBenito 967fd1
	')
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	allow $1 ftpd_t:process { ptrace signal_perms };
Chris PeBenito 967fd1
	ps_process_pattern($1, ftpd_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	init_labeled_script_domtrans($1, ftpd_initrc_exec_t)
Chris PeBenito 967fd1
	domain_system_change_exemption($1)
Chris PeBenito 967fd1
	role_transition $2 ftpd_initrc_exec_t system_r;
Chris PeBenito 967fd1
	allow $2 system_r;
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	ps_process_pattern($1, ftpdctl_t)
Chris PeBenito 296273
	ftp_run_ftpdctl($1, $2)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	miscfiles_manage_public_files($1)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_tmp($1)
Chris PeBenito 967fd1
	admin_pattern($1, ftpd_tmp_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_etc($1)
Chris PeBenito 967fd1
	admin_pattern($1, ftpd_etc_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_var($1)
Chris PeBenito 967fd1
	admin_pattern($1, ftpd_lock_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	files_list_pids($1)
Chris PeBenito 967fd1
	admin_pattern($1, ftpd_var_run_t)
Chris PeBenito 967fd1
Chris PeBenito 967fd1
	logging_list_logs($1)
Chris PeBenito 967fd1
	admin_pattern($1, xferlog_t)
Chris PeBenito 967fd1
')