|
Chris PeBenito |
1a411e9 |
policy_module(rsync, 1.12.0)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# Declarations
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## Allow rsync servers to share cifs files systems
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(rsync_use_cifs, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## Allow rsync servers to share nfs files systems
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(rsync_use_nfs, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## Allow rsync to run as a client
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(rsync_client, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## Allow rsync to export any files/directories read only.
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
1ec3d1a |
gen_tunable(rsync_export_all_ro, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
## <desc>
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## Allow rsync to modify public files
|
|
|
1ec3d1a |
## used for public file transfer services. Files/Directories must be
|
|
|
1ec3d1a |
## labeled public_content_rw_t.
|
|
|
1ec3d1a |
##
|
|
|
1ec3d1a |
## </desc>
|
|
|
b28be49 |
gen_tunable(rsync_anon_write, false)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_t;
|
|
|
1ec3d1a |
type rsync_exec_t;
|
|
Chris PeBenito |
9401ae1 |
init_daemon_domain(rsync_t, rsync_exec_t)
|
|
|
1ec3d1a |
application_executable_file(rsync_exec_t)
|
|
|
1ec3d1a |
role system_r types rsync_t;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_etc_t;
|
|
|
1ec3d1a |
files_config_file(rsync_etc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_data_t;
|
|
|
1ec3d1a |
files_type(rsync_data_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_log_t;
|
|
|
1ec3d1a |
logging_log_file(rsync_log_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_tmp_t;
|
|
|
1ec3d1a |
files_tmp_file(rsync_tmp_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type rsync_var_run_t;
|
|
|
1ec3d1a |
files_pid_file(rsync_var_run_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# Local policy
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow rsync_t self:capability { chown dac_read_search dac_override fowner fsetid setuid setgid sys_chroot };
|
|
|
1ec3d1a |
allow rsync_t self:process signal_perms;
|
|
|
1ec3d1a |
allow rsync_t self:fifo_file rw_fifo_file_perms;
|
|
|
1ec3d1a |
allow rsync_t self:tcp_socket create_stream_socket_perms;
|
|
|
1ec3d1a |
allow rsync_t self:udp_socket connected_socket_perms;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
# for identd
|
|
|
1ec3d1a |
# cjp: this should probably only be inetd_child_t rules?
|
|
|
1ec3d1a |
# search home and kerberos also.
|
|
|
1ec3d1a |
allow rsync_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
1ec3d1a |
#end for identd
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
read_files_pattern(rsync_t, rsync_etc_t, rsync_etc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow rsync_t rsync_data_t:dir list_dir_perms;
|
|
|
1ec3d1a |
read_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
1ec3d1a |
read_lnk_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_files_pattern(rsync_t, rsync_log_t, rsync_log_t)
|
|
|
1ec3d1a |
logging_log_filetrans(rsync_t, rsync_log_t, file)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(rsync_t, rsync_tmp_t, rsync_tmp_t)
|
|
|
1ec3d1a |
manage_files_pattern(rsync_t, rsync_tmp_t, rsync_tmp_t)
|
|
|
1ec3d1a |
files_tmp_filetrans(rsync_t, rsync_tmp_t, { file dir })
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_files_pattern(rsync_t, rsync_var_run_t, rsync_var_run_t)
|
|
|
1ec3d1a |
files_pid_filetrans(rsync_t, rsync_var_run_t, file)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
kernel_read_kernel_sysctls(rsync_t)
|
|
|
1ec3d1a |
kernel_read_system_state(rsync_t)
|
|
|
1ec3d1a |
kernel_read_network_state(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
corenet_all_recvfrom_netlabel(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_generic_if(rsync_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_generic_if(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_generic_node(rsync_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_generic_node(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_all_ports(rsync_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_all_ports(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_bind_generic_node(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_bind_rsync_port(rsync_t)
|
|
|
1ec3d1a |
corenet_sendrecv_rsync_server_packets(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
dev_read_urand(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
fs_getattr_xattr_fs(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_search_home(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
auth_use_nsswitch(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
logging_send_syslog_msg(rsync_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
miscfiles_read_public_files(rsync_t)
|
|
|
1ec3d1a |
|
|
|
b28be49 |
tunable_policy(`rsync_anon_write',`
|
|
|
1ec3d1a |
miscfiles_manage_public_files(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
daemontools_service_domain(rsync_t, rsync_exec_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
kerberos_use(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
inetd_service_domain(rsync_t, rsync_exec_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
tunable_policy(`rsync_use_cifs',`
|
|
|
1ec3d1a |
fs_list_cifs(rsync_t)
|
|
|
1ec3d1a |
fs_read_cifs_files(rsync_t)
|
|
|
1ec3d1a |
fs_read_cifs_symlinks(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
tunable_policy(`rsync_use_nfs',`
|
|
|
1ec3d1a |
fs_list_nfs(rsync_t)
|
|
|
1ec3d1a |
fs_read_nfs_files(rsync_t)
|
|
|
1ec3d1a |
fs_read_nfs_symlinks(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
tunable_policy(`rsync_export_all_ro',`
|
|
|
1ec3d1a |
files_getattr_all_pipes(rsync_t)
|
|
|
1ec3d1a |
fs_read_noxattr_fs_files(rsync_t)
|
|
|
1ec3d1a |
fs_read_nfs_files(rsync_t)
|
|
|
1ec3d1a |
fs_read_cifs_files(rsync_t)
|
|
|
1ec3d1a |
files_read_non_security_files(rsync_t)
|
|
|
1ec3d1a |
auth_tunable_read_shadow(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
tunable_policy(`rsync_client',`
|
|
|
1ec3d1a |
corenet_tcp_connect_rsync_port(rsync_t)
|
|
|
1ec3d1a |
corenet_tcp_connect_ssh_port(rsync_t)
|
|
|
1ec3d1a |
manage_dirs_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
1ec3d1a |
manage_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
1ec3d1a |
manage_lnk_files_pattern(rsync_t, rsync_data_t, rsync_data_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
tunable_policy(`rsync_client',`
|
|
|
1ec3d1a |
ssh_exec(rsync_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
auth_can_read_shadow_passwords(rsync_t)
|