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