2010-05-24 19:32:01 +00:00
|
|
|
policy_module(rsync, 1.10.0)
|
2005-08-22 21:17:10 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2007-11-15 20:10:26 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
2007-12-07 15:44:53 +00:00
|
|
|
## Allow rsync to export any files/directories read only.
|
2007-11-15 20:10:26 +00:00
|
|
|
## </p>
|
|
|
|
## </desc>
|
2008-07-23 21:38:39 +00:00
|
|
|
gen_tunable(rsync_export_all_ro, false)
|
2007-11-15 20:10:26 +00:00
|
|
|
|
2007-03-26 18:41:45 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Allow rsync to modify public files
|
2007-12-07 15:44:53 +00:00
|
|
|
## used for public file transfer services. Files/Directories must be
|
|
|
|
## labeled public_content_rw_t.
|
2007-03-26 18:41:45 +00:00
|
|
|
## </p>
|
|
|
|
## </desc>
|
2008-07-23 21:38:39 +00:00
|
|
|
gen_tunable(allow_rsync_anon_write, false)
|
2007-03-26 18:41:45 +00:00
|
|
|
|
2005-08-22 21:17:10 +00:00
|
|
|
type rsync_t;
|
|
|
|
type rsync_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
init_daemon_domain(rsync_t, rsync_exec_t)
|
2007-10-11 18:12:29 +00:00
|
|
|
application_executable_file(rsync_exec_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
role system_r types rsync_t;
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
type rsync_etc_t;
|
|
|
|
files_config_file(rsync_etc_t)
|
|
|
|
|
2005-08-22 21:17:10 +00:00
|
|
|
type rsync_data_t;
|
|
|
|
files_type(rsync_data_t)
|
|
|
|
|
2008-08-07 14:17:50 +00:00
|
|
|
type rsync_log_t;
|
|
|
|
logging_log_file(rsync_log_t)
|
|
|
|
|
2005-08-22 21:17:10 +00:00
|
|
|
type rsync_tmp_t;
|
|
|
|
files_tmp_file(rsync_tmp_t)
|
|
|
|
|
|
|
|
type rsync_var_run_t;
|
|
|
|
files_pid_file(rsync_var_run_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2008-11-06 22:36:50 +00:00
|
|
|
allow rsync_t self:capability { chown dac_read_search dac_override fowner fsetid setuid setgid sys_chroot };
|
2005-08-22 21:17:10 +00:00
|
|
|
allow rsync_t self:process signal_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow rsync_t self:fifo_file rw_fifo_file_perms;
|
2006-05-30 19:46:34 +00:00
|
|
|
allow rsync_t self:tcp_socket create_stream_socket_perms;
|
2005-10-24 17:06:34 +00:00
|
|
|
allow rsync_t self:udp_socket connected_socket_perms;
|
2005-08-22 21:17:10 +00:00
|
|
|
|
|
|
|
# for identd
|
|
|
|
# cjp: this should probably only be inetd_child_t rules?
|
|
|
|
# search home and kerberos also.
|
|
|
|
allow rsync_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
|
#end for identd
|
|
|
|
|
2010-02-08 18:38:48 +00:00
|
|
|
allow rsync_t rsync_etc_t:file read_file_perms;
|
2010-01-05 15:26:14 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow rsync_t rsync_data_t:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
|
read_lnk_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
|
2008-08-07 14:45:37 +00:00
|
|
|
manage_files_pattern(rsync_t, rsync_log_t, rsync_log_t)
|
|
|
|
logging_log_filetrans(rsync_t, rsync_log_t, file)
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(rsync_t, rsync_tmp_t, rsync_tmp_t)
|
|
|
|
manage_files_pattern(rsync_t, rsync_tmp_t, rsync_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(rsync_t, rsync_tmp_t, { file dir })
|
2005-08-22 21:17:10 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(rsync_t, rsync_var_run_t, rsync_var_run_t)
|
|
|
|
files_pid_filetrans(rsync_t, rsync_var_run_t, file)
|
2005-08-22 21:17:10 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(rsync_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
kernel_read_system_state(rsync_t)
|
|
|
|
kernel_read_network_state(rsync_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(rsync_t)
|
|
|
|
corenet_all_recvfrom_netlabel(rsync_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(rsync_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(rsync_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(rsync_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(rsync_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(rsync_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(rsync_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(rsync_t)
|
2006-04-12 15:04:28 +00:00
|
|
|
corenet_tcp_bind_rsync_port(rsync_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_rsync_server_packets(rsync_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
|
|
|
|
dev_read_urand(rsync_t)
|
|
|
|
|
|
|
|
fs_getattr_xattr_fs(rsync_t)
|
|
|
|
|
|
|
|
files_read_etc_files(rsync_t)
|
|
|
|
files_search_home(rsync_t)
|
|
|
|
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(rsync_t)
|
|
|
|
|
2005-08-22 21:17:10 +00:00
|
|
|
logging_send_syslog_msg(rsync_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(rsync_t)
|
2005-10-25 19:03:15 +00:00
|
|
|
miscfiles_read_public_files(rsync_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
|
2005-10-25 19:03:15 +00:00
|
|
|
tunable_policy(`allow_rsync_anon_write',`
|
|
|
|
miscfiles_manage_public_files(rsync_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-16 18:30:14 +00:00
|
|
|
daemontools_service_domain(rsync_t, rsync_exec_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-22 21:17:10 +00:00
|
|
|
kerberos_use(rsync_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-07-23 21:38:39 +00:00
|
|
|
inetd_service_domain(rsync_t, rsync_exec_t)
|
2006-01-12 16:03:18 +00:00
|
|
|
')
|
|
|
|
|
2007-11-15 20:10:26 +00:00
|
|
|
tunable_policy(`rsync_export_all_ro',`
|
|
|
|
fs_read_noxattr_fs_files(rsync_t)
|
2009-06-12 19:44:10 +00:00
|
|
|
fs_read_nfs_files(rsync_t)
|
|
|
|
fs_read_cifs_files(rsync_t)
|
2011-07-14 15:04:44 +00:00
|
|
|
auth_read_all_dirs_except_auth_files(rsync_t)
|
|
|
|
auth_read_all_files_except_auth_files(rsync_t)
|
|
|
|
auth_read_all_symlinks_except_auth_files(rsync_t)
|
2009-03-23 14:56:43 +00:00
|
|
|
auth_tunable_read_shadow(rsync_t)
|
2005-08-22 21:17:10 +00:00
|
|
|
')
|
2009-03-23 14:56:43 +00:00
|
|
|
auth_can_read_shadow_passwords(rsync_t)
|