Dominick Grift 9a0f79
policy_module(boinc, 1.0.0)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
# Declarations
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_t;
Dan Walsh 3eaa99
type boinc_exec_t;
Dan Walsh 3eaa99
init_daemon_domain(boinc_t, boinc_exec_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_initrc_exec_t;
Dan Walsh 3eaa99
init_script_file(boinc_initrc_exec_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_tmp_t;
Dan Walsh 3eaa99
files_tmp_file(boinc_tmp_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_tmpfs_t;
Dan Walsh 3eaa99
files_tmpfs_file(boinc_tmpfs_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_var_lib_t;
Dan Walsh 3eaa99
files_type(boinc_var_lib_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
type boinc_project_t;
Dan Walsh 3eaa99
domain_type(boinc_project_t)
Dan Walsh 3eaa99
role system_r types boinc_project_t;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
permissive boinc_project_t;
Dan Walsh 3eaa99
Miroslav Grepl b0a5fc
type boinc_project_tmp_t;
Miroslav Grepl b0a5fc
files_tmp_file(boinc_project_tmp_t)
Miroslav Grepl b0a5fc
Dan Walsh 3eaa99
type boinc_project_var_lib_t;
Dan Walsh 3eaa99
files_type(boinc_project_var_lib_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
# boinc local policy
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_t self:capability { kill };
Dan Walsh 3eaa99
allow boinc_t self:process { setsched sigkill };
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_t self:fifo_file rw_fifo_file_perms;
Dan Walsh 3eaa99
allow boinc_t self:unix_stream_socket create_stream_socket_perms;
Dan Walsh 3eaa99
allow boinc_t self:tcp_socket create_stream_socket_perms;
Dan Walsh 3eaa99
allow boinc_t self:sem create_sem_perms;
Dan Walsh 3eaa99
allow boinc_t self:shm create_shm_perms;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
manage_dirs_pattern(boinc_t, boinc_tmp_t, boinc_tmp_t)
Dan Walsh 3eaa99
manage_files_pattern(boinc_t, boinc_tmp_t, boinc_tmp_t)
Dan Walsh 3eaa99
files_tmp_filetrans(boinc_t, boinc_tmp_t, { dir file })
Dan Walsh 3eaa99
Dan Walsh 3eaa99
manage_files_pattern(boinc_t, boinc_tmpfs_t, boinc_tmpfs_t)
Dominick Grift 9a0f79
fs_tmpfs_filetrans(boinc_t, boinc_tmpfs_t, file)
Dan Walsh 3eaa99
Dominick Grift 9a0f79
exec_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t)
Dominick Grift 9a0f79
manage_dirs_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t)
Dominick Grift 9a0f79
manage_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t)
Dan Walsh 3eaa99
filetrans_pattern(boinc_t, boinc_var_lib_t, boinc_project_var_lib_t, { dir })
Dan Walsh 3eaa99
Dominick Grift 9a0f79
manage_dirs_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
Dominick Grift 9a0f79
manage_files_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
kernel_read_system_state(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
files_getattr_all_dirs(boinc_t)
Dan Walsh 3eaa99
files_getattr_all_files(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
corecmd_exec_bin(boinc_t)
Dan Walsh 3eaa99
corecmd_exec_shell(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
corenet_all_recvfrom_unlabeled(boinc_t)
Dan Walsh 3eaa99
corenet_all_recvfrom_netlabel(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_sendrecv_generic_if(boinc_t)
Dan Walsh 3eaa99
corenet_udp_sendrecv_generic_if(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_sendrecv_generic_node(boinc_t)
Dan Walsh 3eaa99
corenet_udp_sendrecv_generic_node(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_sendrecv_all_ports(boinc_t)
Dan Walsh 3eaa99
corenet_udp_sendrecv_all_ports(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_bind_generic_node(boinc_t)
Dan Walsh 3eaa99
corenet_udp_bind_generic_node(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_bind_boinc_port(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_connect_boinc_port(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_connect_http_port(boinc_t)
Dan Walsh 3eaa99
corenet_tcp_connect_http_cache_port(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
dev_list_sysfs(boinc_t)
Dan Walsh 3eaa99
dev_read_rand(boinc_t)
Dan Walsh 3eaa99
dev_read_urand(boinc_t)
Dan Walsh 3eaa99
dev_read_sysfs(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
domain_read_all_domains_state(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
files_dontaudit_getattr_boot_dirs(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
files_read_etc_files(boinc_t)
Dan Walsh 3eaa99
files_read_usr_files(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
fs_getattr_all_fs(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
term_dontaudit_getattr_ptmx(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
miscfiles_read_localization(boinc_t)
Dan Walsh 366396
miscfiles_read_generic_certs(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
logging_send_syslog_msg(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
sysnet_dns_name_resolve(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
mta_send_mail(boinc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
# boinc-projects local policy
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
Dan Walsh 3eaa99
domtrans_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_t)
Dan Walsh 3eaa99
allow boinc_t boinc_project_t:process sigkill;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_project_t self:process { ptrace setsched signal signull sigkill sigstop };
Dan Walsh 3eaa99
allow boinc_project_t self:process { execmem execstack };
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_project_t self:fifo_file rw_fifo_file_perms;
Dan Walsh 3eaa99
Miroslav Grepl b0a5fc
manage_dirs_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t)
Miroslav Grepl b0a5fc
manage_files_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t)
Miroslav Grepl b0a5fc
files_tmp_filetrans(boinc_project_t, boinc_project_tmp_t, { dir file })
Miroslav Grepl b0a5fc
Dan Walsh 3eaa99
allow boinc_project_t boinc_project_var_lib_t:file entrypoint;
Dominick Grift 9a0f79
exec_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
Dominick Grift 9a0f79
manage_dirs_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
Dominick Grift 9a0f79
manage_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
Dan Walsh 3eaa99
files_var_lib_filetrans(boinc_project_t, boinc_project_var_lib_t, { file dir })
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_project_t boinc_project_var_lib_t:file execmod;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow boinc_project_t boinc_t:shm rw_shm_perms;
Dominick Grift 72ba80
allow boinc_project_t boinc_tmpfs_t:file rw_inherited_file_perms;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
list_dirs_pattern(boinc_project_t, boinc_var_lib_t, boinc_var_lib_t)
Dan Walsh 3eaa99
rw_files_pattern(boinc_project_t, boinc_var_lib_t, boinc_var_lib_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
kernel_read_system_state(boinc_project_t)
Dan Walsh 3eaa99
kernel_read_kernel_sysctls(boinc_project_t)
Dan Walsh 3eaa99
kernel_search_vm_sysctl(boinc_project_t)
Dan Walsh 3eaa99
kernel_read_network_state(boinc_project_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
corecmd_exec_bin(boinc_project_t)
Dan Walsh 3eaa99
corecmd_exec_shell(boinc_project_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
corenet_tcp_connect_boinc_port(boinc_project_t)
Dan Walsh 3eaa99
Miroslav Grepl b0a5fc
dev_read_rand(boinc_project_t)
Dan Walsh 4765a5
dev_read_urand(boinc_project_t)
Miroslav Grepl b0a5fc
dev_read_sysfs(boinc_project_t)
Dan Walsh 3eaa99
dev_rw_xserver_misc(boinc_project_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
files_read_etc_files(boinc_project_t)
Dan Walsh 3eaa99
Miroslav Grepl b0a5fc
miscfiles_read_fonts(boinc_project_t)
Dan Walsh 3eaa99
miscfiles_read_localization(boinc_project_t)
Dan Walsh 3eaa99
Miroslav Grepl b0a5fc
optional_policy(`
Dominick Grift 9a0f79
	java_exec(boinc_project_t)
Miroslav Grepl b0a5fc
')