Chris PeBenito fc6524
## <summary>File transfer protocol service</summary>
Chris PeBenito fc6524
Chris PeBenito fc6524
########################################
Chris PeBenito fc6524
## <summary>
Chris PeBenito fc6524
##      Use ftp by connecting over TCP.
Chris PeBenito fc6524
## </summary>
Chris PeBenito fc6524
## <param name="domain">
Chris PeBenito fc6524
##      Domain allowed access.
Chris PeBenito fc6524
## </param>
Chris PeBenito fc6524
#
Chris PeBenito fc6524
interface(`ftp_tcp_connect',`
Chris PeBenito fc6524
	gen_require(`
Chris PeBenito fc6524
		type ftpd_t;
Chris PeBenito fc6524
	')
Chris PeBenito fc6524
Chris PeBenito fc6524
	allow $1 ftpd_t:tcp_socket { connectto recvfrom };
Chris PeBenito fc6524
	allow ftpd_t $1:tcp_socket { acceptfrom recvfrom };
Chris PeBenito fc6524
	kernel_tcp_recvfrom($1)
Chris PeBenito fc6524
')
Chris PeBenito fc6524
Chris PeBenito fc6524
########################################
Chris PeBenito fc6524
## <summary>
Chris PeBenito fc6524
##      Read ftpd etc files
Chris PeBenito fc6524
## </summary>
Chris PeBenito fc6524
## <param name="domain">
Chris PeBenito fc6524
##      Domain allowed access.
Chris PeBenito fc6524
## </param>
Chris PeBenito fc6524
#
Chris PeBenito fc6524
interface(`ftp_read_config',`
Chris PeBenito fc6524
	gen_require(`
Chris PeBenito fc6524
		type ftpd_etc_t;
Chris PeBenito fc6524
	')
Chris PeBenito fc6524
Chris PeBenito fc6524
	files_search_etc($1)
Chris PeBenito fc6524
	allow $1 ftpd_etc_t:file { getattr read };
Chris PeBenito fc6524
')
Chris PeBenito fc6524
Chris PeBenito fc6524
########################################
Chris PeBenito fc6524
## <summary>
Chris PeBenito fc6524
##      Execute FTP daemon entry point programs.
Chris PeBenito fc6524
## </summary>
Chris PeBenito fc6524
## <param name="domain">
Chris PeBenito fc6524
##      Domain allowed access.
Chris PeBenito fc6524
## </param>
Chris PeBenito fc6524
#
Chris PeBenito fc6524
interface(`ftp_check_exec',`
Chris PeBenito fc6524
	gen_require(`
Chris PeBenito fc6524
		type ftpd_exec_t;
Chris PeBenito fc6524
	')
Chris PeBenito fc6524
Chris PeBenito fc6524
	corecmd_search_sbin($1)
Chris PeBenito fc6524
	allow $1 ftpd_exec_t:file x_file_perms;
Chris PeBenito fc6524
')
Chris PeBenito fc6524
Chris PeBenito fc6524
########################################
Chris PeBenito fc6524
## <summary>
Chris PeBenito fc6524
##      Read FTP transfer logs
Chris PeBenito fc6524
## </summary>
Chris PeBenito fc6524
## <param name="domain">
Chris PeBenito fc6524
##      Domain allowed access.
Chris PeBenito fc6524
## </param>
Chris PeBenito fc6524
#
Chris PeBenito fc6524
interface(`ftp_read_log',`
Chris PeBenito fc6524
	gen_require(`
Chris PeBenito fc6524
		type xferlog_t;
Chris PeBenito fc6524
	')
Chris PeBenito fc6524
Chris PeBenito fc6524
	logging_search_logs($1)
Chris PeBenito fc6524
	allow $1 xferlog_t:file r_file_perms;
Chris PeBenito fc6524
')