|
|
1ec3d1a |
policy_module(boinc, 1.0.0)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# Declarations
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
attribute boinc_domain;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_t, boinc_domain;
|
|
|
1ec3d1a |
type boinc_exec_t;
|
|
|
1ec3d1a |
init_daemon_domain(boinc_t, boinc_exec_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_initrc_exec_t;
|
|
|
1ec3d1a |
init_script_file(boinc_initrc_exec_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_tmp_t;
|
|
|
1ec3d1a |
files_tmp_file(boinc_tmp_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_tmpfs_t;
|
|
|
1ec3d1a |
files_tmpfs_file(boinc_tmpfs_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_var_lib_t;
|
|
|
1ec3d1a |
files_type(boinc_var_lib_t)
|
|
|
1ec3d1a |
|
|
|
6146177 |
type boinc_log_t;
|
|
|
6146177 |
logging_log_file(boinc_log_t)
|
|
|
6146177 |
|
|
|
a8eaf4d |
type boinc_unit_file_t;
|
|
|
a8eaf4d |
systemd_unit_file(boinc_unit_file_t)
|
|
|
a8eaf4d |
|
|
|
1ec3d1a |
type boinc_project_t;
|
|
|
1ec3d1a |
domain_type(boinc_project_t)
|
|
|
1ec3d1a |
role system_r types boinc_project_t;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_project_tmp_t;
|
|
|
1ec3d1a |
files_tmp_file(boinc_project_tmp_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
type boinc_project_var_lib_t;
|
|
|
1ec3d1a |
files_type(boinc_project_var_lib_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
#######################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# boinc domain local policy
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_domain self:fifo_file rw_fifo_file_perms;
|
|
|
1ec3d1a |
allow boinc_domain self:sem create_sem_perms;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(boinc_domain, boinc_var_lib_t, boinc_var_lib_t)
|
|
|
1ec3d1a |
manage_files_pattern(boinc_domain, boinc_var_lib_t, boinc_var_lib_t)
|
|
|
23eb301 |
manage_lnk_files_pattern(boinc_domain, boinc_var_lib_t, boinc_var_lib_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
corecmd_exec_bin(boinc_domain)
|
|
|
1ec3d1a |
corecmd_exec_shell(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
dev_read_rand(boinc_domain)
|
|
|
1ec3d1a |
dev_read_urand(boinc_domain)
|
|
|
1ec3d1a |
dev_read_sysfs(boinc_domain)
|
|
|
1ec3d1a |
dev_rw_xserver_misc(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
domain_read_all_domains_state(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_read_etc_runtime_files(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
fs_getattr_all_fs(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
miscfiles_read_fonts(boinc_domain)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
sysnet_dns_name_resolve(boinc_domain)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# boinc local policy
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_t self:process { setsched setpgid signull sigkill };
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
1ec3d1a |
allow boinc_t self:tcp_socket create_stream_socket_perms;
|
|
|
1ec3d1a |
allow boinc_t self:shm create_shm_perms;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(boinc_t, boinc_tmp_t, boinc_tmp_t)
|
|
|
1ec3d1a |
manage_files_pattern(boinc_t, boinc_tmp_t, boinc_tmp_t)
|
|
|
1ec3d1a |
files_tmp_filetrans(boinc_t, boinc_tmp_t, { dir file })
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_files_pattern(boinc_t, boinc_tmpfs_t, boinc_tmpfs_t)
|
|
|
1ec3d1a |
fs_tmpfs_filetrans(boinc_t, boinc_tmpfs_t, file)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
exec_files_pattern(boinc_t, boinc_var_lib_t, boinc_var_lib_t)
|
|
|
1ec3d1a |
# this should be created by default by boinc
|
|
|
1ec3d1a |
# we need this label for transition to boinc_project_t
|
|
|
1ec3d1a |
# other boinc lib files will end up with boinc_var_lib_t
|
|
|
1ec3d1a |
filetrans_pattern(boinc_t, boinc_var_lib_t, boinc_project_var_lib_t, dir, "slots")
|
|
|
1ec3d1a |
filetrans_pattern(boinc_t, boinc_var_lib_t, boinc_project_var_lib_t, dir, "projects")
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
|
|
|
1ec3d1a |
manage_files_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
|
|
|
1ec3d1a |
|
|
|
fb3ccd9 |
manage_files_pattern(boinc_t, boinc_log_t, boinc_log_t)
|
|
|
fb3ccd9 |
logging_log_filetrans(boinc_t, boinc_log_t, { file })
|
|
|
6146177 |
|
|
|
1bafb67 |
# needs read /proc/interrupts
|
|
|
1bafb67 |
kernel_read_system_state(boinc_t)
|
|
|
1ec3d1a |
kernel_search_vm_sysctl(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_getattr_all_dirs(boinc_t)
|
|
|
1ec3d1a |
files_getattr_all_files(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
corenet_all_recvfrom_netlabel(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_generic_if(boinc_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_generic_if(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_generic_node(boinc_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_generic_node(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_sendrecv_all_ports(boinc_t)
|
|
|
1ec3d1a |
corenet_udp_sendrecv_all_ports(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_bind_generic_node(boinc_t)
|
|
|
1ec3d1a |
corenet_udp_bind_generic_node(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_bind_boinc_port(boinc_t)
|
|
|
1f86dac |
corenet_tcp_bind_boinc_client_port(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_connect_boinc_port(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_connect_http_port(boinc_t)
|
|
|
1ec3d1a |
corenet_tcp_connect_http_cache_port(boinc_t)
|
|
|
1b93ddf |
corenet_tcp_connect_squid_port(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_dontaudit_getattr_boot_dirs(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
auth_read_passwd(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
term_getattr_all_ptys(boinc_t)
|
|
|
1ec3d1a |
term_getattr_unallocated_ttys(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
init_read_utmp(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
logging_send_syslog_msg(boinc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
mta_send_mail(boinc_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
# boinc-projects local policy
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_project_t self:capability { setuid setgid };
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
domtrans_pattern(boinc_t, boinc_project_var_lib_t, boinc_project_t)
|
|
|
1ec3d1a |
allow boinc_t boinc_project_t:process sigkill;
|
|
|
1ec3d1a |
allow boinc_t boinc_project_t:process noatsecure;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_project_t self:process { ptrace setcap getcap setpgid setsched signal signull sigkill sigstop };
|
|
|
1ec3d1a |
allow boinc_project_t self:process { execmem execstack };
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_dirs_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t)
|
|
|
1ec3d1a |
manage_files_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t)
|
|
|
1ec3d1a |
manage_sock_files_pattern(boinc_project_t, boinc_project_tmp_t, boinc_project_tmp_t)
|
|
|
1ec3d1a |
files_tmp_filetrans(boinc_project_t, boinc_project_tmp_t, { dir file sock_file})
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_project_t boinc_project_var_lib_t:file entrypoint;
|
|
|
1ec3d1a |
exec_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
|
|
|
1ec3d1a |
manage_dirs_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
|
|
|
1ec3d1a |
manage_files_pattern(boinc_project_t, boinc_project_var_lib_t, boinc_project_var_lib_t)
|
|
|
1ec3d1a |
files_var_lib_filetrans(boinc_project_t, boinc_project_var_lib_t, dir, "projects")
|
|
|
1ec3d1a |
files_var_lib_filetrans(boinc_project_t, boinc_project_var_lib_t, dir, "slots" )
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_project_t boinc_project_var_lib_t:file execmod;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow boinc_project_t boinc_t:shm rw_shm_perms;
|
|
|
1ec3d1a |
allow boinc_project_t boinc_tmpfs_t:file rw_inherited_file_perms;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
kernel_read_kernel_sysctls(boinc_project_t)
|
|
|
1ec3d1a |
kernel_search_vm_sysctl(boinc_project_t)
|
|
|
1ec3d1a |
kernel_read_network_state(boinc_project_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
corenet_tcp_connect_boinc_port(boinc_project_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_dontaudit_search_home(boinc_project_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
# needed by java
|
|
|
1ec3d1a |
fs_read_hugetlbfs_files(boinc_project_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
gnome_read_gconf_config(boinc_project_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
java_exec(boinc_project_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
# until solution for VirtualBox, java ..
|
|
|
1ec3d1a |
optional_policy(`
|
|
|
1ec3d1a |
unconfined_domain(boinc_project_t)
|
|
|
1ec3d1a |
')
|