Chris PeBenito 40adb5
Chris PeBenito 40adb5
policy_module(tftp,1.0)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
########################################
Chris PeBenito 40adb5
#
Chris PeBenito 40adb5
# Declarations
Chris PeBenito 40adb5
#
Chris PeBenito 40adb5
Chris PeBenito 40adb5
type tftpd_t;
Chris PeBenito 40adb5
type tftpd_exec_t;
Chris PeBenito 69dcd6
init_system_domain(tftpd_t,tftpd_exec_t)
Chris PeBenito 40adb5
inetd_udp_service_domain(tftpd_t,tftpd_exec_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
type tftpd_var_run_t;
Chris PeBenito 40adb5
files_pid_file(tftpd_var_run_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
type tftpdir_t;
Chris PeBenito 40adb5
files_type(tftpdir_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
########################################
Chris PeBenito 40adb5
#
Chris PeBenito 40adb5
# Local policy
Chris PeBenito 40adb5
#
Chris PeBenito 40adb5
Chris PeBenito 40adb5
allow tftpd_t self:capability { setgid setuid sys_chroot };
Chris PeBenito 40adb5
allow tftpd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 40adb5
allow tftpd_t self:udp_socket create_socket_perms;
Chris PeBenito 40adb5
allow tftpd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 40adb5
allow tftpd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 40adb5
dontaudit tftpd_t self:capability sys_tty_config;
Chris PeBenito 40adb5
Chris PeBenito 40adb5
allow tftpd_t tftpdir_t:dir { getattr read search };
Chris PeBenito 40adb5
allow tftpd_t tftpdir_t:file { read getattr };
Chris PeBenito 40adb5
allow tftpd_t tftpdir_t:lnk_file { getattr read };
Chris PeBenito 40adb5
Chris PeBenito 40adb5
allow tftpd_t tftpd_var_run_t:file create_file_perms;
Chris PeBenito 40adb5
allow tftpd_t tftpd_var_run_t:dir rw_dir_perms;
Chris PeBenito 40adb5
files_create_pid(tftpd_t,tftpd_var_run_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
kernel_read_kernel_sysctl(tftpd_t)
Chris PeBenito 40adb5
kernel_list_proc(tftpd_t)
Chris PeBenito 40adb5
kernel_read_proc_symlinks(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
corenet_tcp_sendrecv_all_if(tftpd_t)
Chris PeBenito 40adb5
corenet_udp_sendrecv_all_if(tftpd_t)
Chris PeBenito 40adb5
corenet_raw_sendrecv_all_if(tftpd_t)
Chris PeBenito 40adb5
corenet_tcp_sendrecv_all_nodes(tftpd_t)
Chris PeBenito 40adb5
corenet_udp_sendrecv_all_nodes(tftpd_t)
Chris PeBenito 40adb5
corenet_raw_sendrecv_all_nodes(tftpd_t)
Chris PeBenito 40adb5
corenet_tcp_sendrecv_all_ports(tftpd_t)
Chris PeBenito 40adb5
corenet_udp_sendrecv_all_ports(tftpd_t)
Chris PeBenito 40adb5
corenet_tcp_bind_all_nodes(tftpd_t)
Chris PeBenito 40adb5
corenet_udp_bind_all_nodes(tftpd_t)
Chris PeBenito 40adb5
corenet_udp_bind_tftp_port(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
dev_read_sysfs(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
fs_getattr_all_fs(tftpd_t)
Chris PeBenito 40adb5
fs_search_auto_mountpoints(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
term_dontaudit_use_console(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
domain_use_wide_inherit_fd(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
files_read_etc_files(tftpd_t);
Chris PeBenito 40adb5
files_read_var_files(tftpd_t)
Chris PeBenito 40adb5
files_read_var_symlink(tftpd_t)
Chris PeBenito 40adb5
files_search_var(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
init_use_fd(tftpd_t)
Chris PeBenito 40adb5
init_use_script_pty(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
libs_use_ld_so(tftpd_t)
Chris PeBenito 40adb5
libs_use_shared_libs(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
logging_send_syslog_msg(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
miscfiles_read_localization(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
sysnet_read_config(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
userdom_dontaudit_use_unpriv_user_fd(tftpd_t)
Chris PeBenito 40adb5
userdom_dontaudit_use_sysadm_tty(tftpd_t)
Chris PeBenito 40adb5
userdom_dontaudit_search_sysadm_home_dir(tftpd_t)
Chris PeBenito 40adb5
Chris PeBenito 40adb5
ifdef(`targeted_policy', `
Chris PeBenito 40adb5
        term_dontaudit_use_unallocated_tty(tftpd_t)
Chris PeBenito 40adb5
        term_dontaudit_use_generic_pty(tftpd_t)
Chris PeBenito 40adb5
        files_dontaudit_read_root_file(tftpd_t)
Chris PeBenito 40adb5
')
Chris PeBenito 40adb5
Chris PeBenito 40adb5
optional_policy(`mount.te',`
Chris PeBenito 40adb5
        mount_send_nfs_client_request(tftpd_t)
Chris PeBenito 40adb5
')
Chris PeBenito 40adb5
Chris PeBenito 40adb5
optional_policy(`selinuxutil.te',`
Chris PeBenito 40adb5
        seutil_sigchld_newrole(tftpd_t)
Chris PeBenito 40adb5
')
Chris PeBenito 40adb5
optional_policy(`udev.te', `
Chris PeBenito 40adb5
        udev_read_db(tftpd_t)
Chris PeBenito 40adb5
')
Chris PeBenito 40adb5
Chris PeBenito 40adb5
ifdef(`TODO',`
Chris PeBenito 40adb5
optional_policy(`rhgb.te',`
Chris PeBenito 40adb5
        rhgb_domain(tftpd_t)
Chris PeBenito 40adb5
')
Chris PeBenito 40adb5
')