30e4dae
2e6f2a4
policy_module(icecream,0.0.36)
30e4dae
30e4dae
########################################
30e4dae
#
30e4dae
# Declarations
30e4dae
#
30e4dae
30e4dae
type iceccd_t;
30e4dae
type iceccd_exec_t;
30e4dae
init_daemon_domain(iceccd_t, iceccd_exec_t)
30e4dae
30e4dae
type iceccd_var_run_t;
30e4dae
files_pid_file(iceccd_var_run_t)
30e4dae
30e4dae
type iceccd_log_t;
30e4dae
logging_log_file(iceccd_log_t)
30e4dae
30e4dae
type iceccd_cache_t;
30e4dae
files_type(iceccd_cache_t)
30e4dae
30e4dae
type iceccd_tmp_t;
30e4dae
files_tmp_file(iceccd_tmp_t)
30e4dae
30e4dae
type iceccd_helper_t;
30e4dae
type iceccd_helper_exec_t;
30e4dae
domain_type(iceccd_helper_t)
30e4dae
domain_entry_file(iceccd_helper_t, iceccd_helper_exec_t)
30e4dae
role system_r types iceccd_helper_t;
30e4dae
30e4dae
# the cache contains foreign compilers and libraries
30e4dae
# the whole point of icecream is to run them...
30e4dae
type iceccd_untrusted_t;
30e4dae
domain_type(iceccd_untrusted_t);
30e4dae
domain_entry_file(iceccd_untrusted_t, iceccd_cache_t)
30e4dae
role system_r types iceccd_untrusted_t;
30e4dae
30e4dae
# XXX: something like this:
30e4dae
# network_port(iceccd, tcp,10245,s0)
30e4dae
#type iceccd_client_packet_t;
30e4dae
#type iceccd_server_packet_t;
30e4dae
# XXX: portcon only works in base policy module
30e4dae
#portcon tcp 10245 gen_context(system_u:object_r:iceccd_port_t, s0)
30e4dae
30e4dae
type iceccd_port_t;
30e4dae
type icecc_scheduler_port_t;
30e4dae
corenet_port(iceccd_port_t);
30e4dae
corenet_port(icecc_scheduler_port_t);
30e4dae
30e4dae
########################################
30e4dae
#
30e4dae
# Icecream local policy
30e4dae
#
30e4dae
30e4dae
allow iceccd_t self:process { signal_perms setsched setrlimit };
30e4dae
allow iceccd_t self:netlink_route_socket r_netlink_socket_perms;
30e4dae
allow iceccd_t self:tcp_socket create_stream_socket_perms;
30e4dae
allow iceccd_t self:udp_socket create_socket_perms;
30e4dae
allow iceccd_t iceccd_port_t:tcp_socket name_bind;
30e4dae
allow iceccd_t icecc_scheduler_port_t:tcp_socket { send_msg recv_msg name_connect };
89116ae
allow iceccd_t icecc_scheduler_port_t:udp_socket { send_msg recv_msg };
30e4dae
allow iceccd_t self:fifo_file { read write ioctl getattr };
30e4dae
# why exactly?:
30e4dae
allow iceccd_t self:capability { chown dac_override fsetid kill };
30e4dae
allow iceccd_t self:capability { setgid setuid };
30e4dae
allow iceccd_t self:capability { sys_chroot };
30e4dae
83c739d
allow iceccd_t iceccd_untrusted_t:process { siginh rlimitinh noatsecure signal };
30e4dae
30e4dae
allow iceccd_helper_t iceccd_t:process { sigchld };
30e4dae
allow iceccd_helper_t iceccd_log_t:file { append };
30e4dae
allow iceccd_helper_t self:fifo_file { read write ioctl getattr };
30e4dae
# needs investigating:
30e4dae
allow iceccd_helper_t iceccd_tmp_t:file { execute };
2e6f2a4
# rly needed?
2e6f2a4
allow iceccd_helper_t iceccd_t:udp_socket { read write };
30e4dae
83c739d
allow iceccd_untrusted_t self:fifo_file { read write getattr };
83c739d
allow iceccd_untrusted_t self:process { signal };
30e4dae
allow iceccd_untrusted_t iceccd_t:process { sigchld };
30e4dae
allow iceccd_untrusted_t iceccd_t:fifo_file { write };
30e4dae
allow iceccd_untrusted_t iceccd_t:unix_stream_socket { read write getattr };
30e4dae
allow iceccd_untrusted_t iceccd_cache_t:dir { search getattr write add_name remove_name };
30e4dae
allow iceccd_untrusted_t iceccd_cache_t:file { execute_no_trans write unlink create };
30e4dae
30e4dae
corenet_all_recvfrom_unlabeled(iceccd_t)
30e4dae
corenet_all_recvfrom_netlabel(iceccd_t)
30e4dae
corenet_tcp_sendrecv_all_if(iceccd_t)
30e4dae
corenet_udp_sendrecv_all_if(iceccd_t)
30e4dae
corenet_tcp_sendrecv_all_nodes(iceccd_t)
30e4dae
corenet_udp_sendrecv_all_nodes(iceccd_t)
30e4dae
# corenet_tcp_sendrecv_all_ports(iceccd_t)
30e4dae
# corenet_udp_sendrecv_all_ports(iceccd_t)
30e4dae
corenet_tcp_bind_all_nodes(iceccd_t)
30e4dae
30e4dae
manage_files_pattern(iceccd_t,iceccd_log_t,iceccd_log_t)
30e4dae
logging_log_filetrans(iceccd_t, iceccd_log_t, file)
30e4dae
30e4dae
manage_files_pattern(iceccd_t,iceccd_var_run_t,iceccd_var_run_t)
30e4dae
files_pid_filetrans(iceccd_t, iceccd_var_run_t, file)
30e4dae
30e4dae
manage_dirs_pattern(iceccd_t, iceccd_cache_t, iceccd_cache_t)
30e4dae
manage_files_pattern(iceccd_t, iceccd_cache_t, iceccd_cache_t)
30e4dae
30e4dae
manage_dirs_pattern(iceccd_helper_t, iceccd_cache_t, iceccd_cache_t)
30e4dae
manage_files_pattern(iceccd_helper_t, iceccd_cache_t, iceccd_cache_t)
30e4dae
30e4dae
libs_use_ld_so(iceccd_t)
30e4dae
libs_use_shared_libs(iceccd_t)
30e4dae
30e4dae
# for ldd
30e4dae
libs_exec_ld_so(iceccd_t)
30e4dae
30e4dae
files_read_etc_files(iceccd_t)
30e4dae
miscfiles_read_localization(iceccd_t)
30e4dae
kernel_read_system_state(iceccd_t)
30e4dae
sysnet_read_config(iceccd_t)
30e4dae
#files_read_usr_files(iceccd_t)
30e4dae
30e4dae
files_read_etc_files(iceccd_helper_t)
30e4dae
libs_use_ld_so(iceccd_helper_t)
30e4dae
libs_use_shared_libs(iceccd_helper_t)
30e4dae
miscfiles_read_localization(iceccd_helper_t)
30e4dae
corecmd_exec_bin(iceccd_helper_t)
30e4dae
corecmd_exec_shell(iceccd_helper_t)
30e4dae
dev_read_urand(iceccd_helper_t)
30e4dae
kernel_read_system_state(iceccd_helper_t)
30e4dae
files_read_usr_files(iceccd_helper_t)
30e4dae
libs_exec_ld_so(iceccd_helper_t)
30e4dae
libs_exec_lib_files(iceccd_helper_t)
30e4dae
nscd_socket_use(iceccd_helper_t)
30e4dae
30e4dae
# XXX: iceccd wants this every second. why?
30e4dae
fs_getattr_all_fs(iceccd_t)
30e4dae
30e4dae
corecmd_exec_bin(iceccd_t)
30e4dae
corecmd_read_bin_symlinks(iceccd_t)
30e4dae
30e4dae
# XXX: could iceccd be modified to not need this?
30e4dae
corecmd_exec_shell(iceccd_t)
30e4dae
30e4dae
# for mktemp
30e4dae
#dev_read_urand(iceccd_t)
30e4dae
files_getattr_tmp_dirs(iceccd_t)
30e4dae
files_search_tmp(iceccd_t)
30e4dae
30e4dae
manage_dirs_pattern(iceccd_t, iceccd_tmp_t, iceccd_tmp_t)
30e4dae
manage_files_pattern(iceccd_t, iceccd_tmp_t, iceccd_tmp_t)
30e4dae
files_tmp_filetrans(iceccd_t, iceccd_tmp_t, file)
30e4dae
30e4dae
manage_dirs_pattern(iceccd_helper_t, iceccd_tmp_t, iceccd_tmp_t)
30e4dae
manage_files_pattern(iceccd_helper_t, iceccd_tmp_t, iceccd_tmp_t)
30e4dae
files_tmp_filetrans(iceccd_helper_t, iceccd_tmp_t, file)
30e4dae
files_tmp_filetrans(iceccd_helper_t, iceccd_tmp_t, dir)
30e4dae
2e6f2a4
# to re-create /var/cache/icecream
2e6f2a4
files_var_filetrans(iceccd_t, iceccd_cache_t, dir)
2e6f2a4
2e6f2a4
# aka domain_auto_trans
30e4dae
domain_auto_transition_pattern(iceccd_t, iceccd_helper_exec_t, iceccd_helper_t)
30e4dae
domain_auto_transition_pattern(iceccd_t, iceccd_cache_t, iceccd_untrusted_t)
30e4dae
30e4dae
userdom_dontaudit_getattr_sysadm_home_dirs(iceccd_t)
30e4dae
#userdom_dontaudit_getattr_sysadm_home_dirs(iceccd_helper_t)
30e4dae
userdom_dontaudit_search_sysadm_home_dirs(iceccd_helper_t)
30e4dae
#userdom_getattr_sysadm_home_dirs(iceccd_t)
30e4dae