Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
policy_module(rsync,1.0)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
########################################
Chris PeBenito 35ecf8
#
Chris PeBenito 35ecf8
# Declarations
Chris PeBenito 35ecf8
#
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
type rsync_t;
Chris PeBenito 35ecf8
type rsync_exec_t;
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
inetd_tcp_service_domain(rsync_t,rsync_exec_t)
Chris PeBenito 35ecf8
role system_r types rsync_t;
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
type rsync_data_t;
Chris PeBenito 35ecf8
files_type(rsync_data_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
type rsync_tmp_t;
Chris PeBenito 35ecf8
files_tmp_file(rsync_tmp_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
type rsync_var_run_t;
Chris PeBenito 35ecf8
files_pid_file(rsync_var_run_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
########################################
Chris PeBenito 35ecf8
#
Chris PeBenito 35ecf8
# Local policy
Chris PeBenito 35ecf8
#
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
allow rsync_t self:process signal_perms;
Chris PeBenito 35ecf8
allow rsync_t self:fifo_file rw_file_perms;
Chris PeBenito 35ecf8
allow rsync_t self:tcp_socket { listen accept connected_socket_perms };
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
# for identd
Chris PeBenito 35ecf8
# cjp: this should probably only be inetd_child_t rules?
Chris PeBenito 35ecf8
# search home and kerberos also.
Chris PeBenito 35ecf8
allow rsync_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
Chris PeBenito 35ecf8
allow rsync_t self:capability { setuid setgid };
Chris PeBenito 35ecf8
#end for identd
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
allow rsync_t rsync_data_t:dir r_dir_perms;
Chris PeBenito 35ecf8
allow rsync_t rsync_data_t:file r_file_perms;
Chris PeBenito 35ecf8
allow rsync_t rsync_data_t:lnk_file r_file_perms;
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
allow rsync_t rsync_tmp_t:dir create_dir_perms;
Chris PeBenito 35ecf8
allow rsync_t rsync_tmp_t:file create_file_perms;
Chris PeBenito 35ecf8
files_create_tmp_files(rsync_t, rsync_tmp_t, { file dir })
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
allow rsync_t rsync_var_run_t:file create_file_perms;
Chris PeBenito 35ecf8
files_create_pid(rsync_t,rsync_var_run_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
kernel_read_kernel_sysctl(rsync_t)
Chris PeBenito 35ecf8
kernel_read_system_state(rsync_t)
Chris PeBenito 35ecf8
kernel_read_network_state(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
corenet_tcp_sendrecv_all_if(rsync_t)
Chris PeBenito 35ecf8
corenet_raw_sendrecv_all_if(rsync_t)
Chris PeBenito 35ecf8
corenet_tcp_sendrecv_all_nodes(rsync_t)
Chris PeBenito 35ecf8
corenet_raw_sendrecv_all_nodes(rsync_t)
Chris PeBenito 35ecf8
corenet_tcp_sendrecv_all_ports(rsync_t)
Chris PeBenito 35ecf8
corenet_tcp_bind_all_nodes(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
dev_read_urand(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
fs_getattr_xattr_fs(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
files_read_etc_files(rsync_t)
Chris PeBenito 35ecf8
files_search_home(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
libs_use_ld_so(rsync_t)
Chris PeBenito 35ecf8
libs_use_shared_libs(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
logging_send_syslog_msg(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
miscfiles_read_localization(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
sysnet_read_config(rsync_t)
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
optional_policy(`kerberos.te',`
Chris PeBenito 35ecf8
	kerberos_use(rsync_t)
Chris PeBenito 35ecf8
')
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
optional_policy(`nis.te',`
Chris PeBenito 35ecf8
	nis_use_ypbind(rsync_t)
Chris PeBenito 35ecf8
')
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
optional_policy(`nscd.te',`
Chris PeBenito 35ecf8
	nscd_use_socket(rsync_t)
Chris PeBenito 35ecf8
')
Chris PeBenito 35ecf8
Chris PeBenito 35ecf8
ifdef(`TODO',`
Chris PeBenito 35ecf8
ifdef(`ftpd.te', `
Chris PeBenito 35ecf8
r_dir_file(rsync_t, ftpd_anon_t)
Chris PeBenito 35ecf8
')
Chris PeBenito 35ecf8
') dnl end TODO