|
|
9e78a22 |
|
|
|
04acc34 |
policy_module(icecream,0.1.9)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd declarations
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_t;
|
|
|
9e78a22 |
type iceccd_exec_t;
|
|
|
9e78a22 |
init_daemon_domain(iceccd_t, iceccd_exec_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_tmp_t;
|
|
|
9e78a22 |
files_tmp_file(iceccd_tmp_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_var_run_t;
|
|
|
9e78a22 |
files_pid_file(iceccd_var_run_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_cache_t;
|
|
|
9e78a22 |
files_type(iceccd_cache_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd_createenv declarations
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_createenv_t;
|
|
|
9e78a22 |
type iceccd_createenv_exec_t;
|
|
|
9e78a22 |
application_domain(iceccd_createenv_t, iceccd_createenv_exec_t)
|
|
|
9e78a22 |
role system_r types iceccd_createenv_t;
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# icecc_scheduler declarations
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type icecc_scheduler_t;
|
|
|
9e78a22 |
type icecc_scheduler_exec_t;
|
|
|
9e78a22 |
init_daemon_domain(icecc_scheduler_t, icecc_scheduler_exec_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd_untrusted declarations
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
type iceccd_untrusted_t;
|
|
|
9e78a22 |
domain_type(iceccd_untrusted_t);
|
|
|
9e78a22 |
domain_entry_file(iceccd_untrusted_t, iceccd_cache_t)
|
|
|
9e78a22 |
role system_r types iceccd_untrusted_t;
|
|
|
9e78a22 |
|
|
|
9e78a22 |
# port declarations. for separate module only.
|
|
|
9e78a22 |
type iceccd_port_t;
|
|
|
9e78a22 |
type icecc_scheduler_port_t;
|
|
|
9e78a22 |
corenet_port(iceccd_port_t);
|
|
|
9e78a22 |
corenet_port(icecc_scheduler_port_t);
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd policy
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
allow iceccd_t self:capability { chown dac_override fowner fsetid kill
|
|
|
48d39d8 |
setgid setuid sys_chroot setpcap };
|
|
|
9e78a22 |
allow iceccd_t self:fifo_file rw_fifo_file_perms;
|
|
|
9e78a22 |
allow iceccd_t self:netlink_route_socket r_netlink_socket_perms;
|
|
|
48d39d8 |
allow iceccd_t self:process { signal_perms setsched setrlimit setcap };
|
|
|
9e78a22 |
allow iceccd_t self:tcp_socket create_stream_socket_perms;
|
|
|
9e78a22 |
allow iceccd_t self:udp_socket create_socket_perms;
|
|
|
9e78a22 |
|
|
|
9e78a22 |
dontaudit iceccd_t iceccd_untrusted_t:process { siginh rlimitinh
|
|
|
9e78a22 |
noatsecure };
|
|
|
9e78a22 |
|
|
|
9e78a22 |
allow iceccd_t iceccd_untrusted_t:process signal;
|
|
|
9e78a22 |
|
|
|
48d39d8 |
allow iceccd_t iceccd_var_run_t:sock_file { create unlink };
|
|
|
48d39d8 |
|
|
|
9e78a22 |
domtrans_pattern(iceccd_t, iceccd_createenv_exec_t, iceccd_createenv_t)
|
|
|
9e78a22 |
domtrans_pattern(iceccd_t, iceccd_cache_t, iceccd_untrusted_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
manage_files_pattern(iceccd_t, iceccd_var_run_t, iceccd_var_run_t)
|
|
|
9e78a22 |
files_pid_filetrans(iceccd_t, iceccd_var_run_t, file)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
manage_dirs_pattern(iceccd_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
9e78a22 |
manage_files_pattern(iceccd_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
9e78a22 |
files_var_filetrans(iceccd_t, iceccd_cache_t, { dir file })
|
|
|
9e78a22 |
|
|
|
9e78a22 |
files_search_tmp(iceccd_t)
|
|
|
9e78a22 |
manage_dirs_pattern(iceccd_t, iceccd_tmp_t, iceccd_tmp_t)
|
|
|
9e78a22 |
manage_files_pattern(iceccd_t, iceccd_tmp_t, iceccd_tmp_t)
|
|
|
9e78a22 |
files_tmp_filetrans(iceccd_t, iceccd_tmp_t, { dir file })
|
|
|
9e78a22 |
|
|
|
9e78a22 |
corenet_all_recvfrom_unlabeled(iceccd_t)
|
|
|
9e78a22 |
corenet_all_recvfrom_netlabel(iceccd_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_generic_if(iceccd_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_generic_if(iceccd_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_generic_node(iceccd_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_generic_node(iceccd_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_all_ports(iceccd_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_all_ports(iceccd_t)
|
|
|
9e78a22 |
corenet_tcp_bind_generic_node(iceccd_t)
|
|
|
9e78a22 |
allow iceccd_t iceccd_port_t:tcp_socket { name_bind };
|
|
|
9e78a22 |
allow iceccd_t icecc_scheduler_port_t:tcp_socket { name_connect };
|
|
|
48d39d8 |
# tcp port 8765 is lirc_port_t
|
|
|
9e78a22 |
corenet_tcp_connect_lirc_port(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
corecmd_exec_bin(iceccd_t)
|
|
|
9e78a22 |
corecmd_read_bin_symlinks(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
#files_getattr_tmp_dirs(iceccd_t)
|
|
|
9e78a22 |
files_read_etc_files(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
fs_getattr_all_fs(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
kernel_read_system_state(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
sysnet_read_config(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
libs_use_ld_so(iceccd_t)
|
|
|
9e78a22 |
libs_use_shared_libs(iceccd_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
miscfiles_read_localization(iceccd_t)
|
|
|
9e78a22 |
|
|
|
48d39d8 |
auth_use_nsswitch(iceccd_t)
|
|
|
48d39d8 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd_createenv policy
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
allow iceccd_createenv_t self:fifo_file rw_fifo_file_perms;
|
|
|
9e78a22 |
|
|
|
04acc34 |
dontaudit iceccd_createenv_t self:process { setfscreate };
|
|
|
9e78a22 |
dontaudit iceccd_createenv_t iceccd_tmp_t:file { execute };
|
|
|
9e78a22 |
|
|
|
9e78a22 |
manage_dirs_pattern(iceccd_createenv_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
9e78a22 |
manage_files_pattern(iceccd_createenv_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
9e78a22 |
# no files_var_filetrans, createenv does not create the cache dir itself
|
|
|
9e78a22 |
|
|
|
9e78a22 |
manage_dirs_pattern(iceccd_createenv_t, iceccd_tmp_t, iceccd_tmp_t)
|
|
|
9e78a22 |
manage_files_pattern(iceccd_createenv_t, iceccd_tmp_t, iceccd_tmp_t)
|
|
|
04acc34 |
allow iceccd_createenv_t iceccd_tmp_t:file { map };
|
|
|
9e78a22 |
files_tmp_filetrans(iceccd_createenv_t, iceccd_tmp_t, { dir file })
|
|
|
9e78a22 |
|
|
|
9e78a22 |
corecmd_exec_bin(iceccd_createenv_t)
|
|
|
9e78a22 |
corecmd_exec_shell(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
dev_read_urand(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
files_read_etc_files(iceccd_createenv_t)
|
|
|
9e78a22 |
files_read_usr_files(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
kernel_read_system_state(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
libs_exec_ld_so(iceccd_createenv_t)
|
|
|
9e78a22 |
libs_exec_lib_files(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
48d39d8 |
libs_exec_ldconfig(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
libs_use_ld_so(iceccd_createenv_t)
|
|
|
9e78a22 |
libs_use_shared_libs(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
miscfiles_read_localization(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
04acc34 |
fs_getattr_tmpfs(iceccd_createenv_t)
|
|
|
04acc34 |
|
|
|
9e78a22 |
userdom_dontaudit_search_user_home_dirs(iceccd_createenv_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
optional_policy(`
|
|
|
9e78a22 |
nscd_socket_use(iceccd_createenv_t)
|
|
|
9e78a22 |
')
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# iceccd_untrusted policy
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
allow iceccd_untrusted_t self:fifo_file rw_fifo_file_perms;
|
|
|
9e78a22 |
allow iceccd_untrusted_t self:process signal_perms;
|
|
|
9e78a22 |
allow iceccd_untrusted_t iceccd_t:unix_stream_socket rw_stream_socket_perms;
|
|
|
9e78a22 |
|
|
|
9e78a22 |
manage_files_pattern(iceccd_untrusted_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
7fe5a6f |
manage_lnk_files_pattern(iceccd_untrusted_t, iceccd_cache_t, iceccd_cache_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
can_exec(iceccd_untrusted_t, iceccd_cache_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
fs_getattr_all_fs(iceccd_untrusted_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
########################################
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
# icecc_scheduler policy
|
|
|
9e78a22 |
#
|
|
|
9e78a22 |
|
|
|
9e78a22 |
allow icecc_scheduler_t self:tcp_socket create_stream_socket_perms;
|
|
|
9e78a22 |
allow icecc_scheduler_t self:udp_socket create_socket_perms;
|
|
|
577fbad |
allow icecc_scheduler_t self:netlink_route_socket r_netlink_socket_perms;
|
|
|
ee34f12 |
allow icecc_scheduler_t iceccd_port_t:tcp_socket { name_connect };
|
|
|
9e78a22 |
|
|
|
9e78a22 |
corenet_all_recvfrom_unlabeled(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_all_recvfrom_netlabel(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_generic_if(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_generic_if(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_generic_node(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_generic_node(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_tcp_sendrecv_all_ports(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_udp_sendrecv_all_ports(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_tcp_bind_generic_node(icecc_scheduler_t)
|
|
|
9e78a22 |
corenet_udp_bind_generic_node(icecc_scheduler_t)
|
|
|
9e78a22 |
allow icecc_scheduler_t icecc_scheduler_port_t:tcp_socket { name_bind };
|
|
|
9e78a22 |
corenet_tcp_bind_lirc_port(icecc_scheduler_t)
|
|
|
9e78a22 |
allow icecc_scheduler_t icecc_scheduler_port_t:udp_socket { name_bind };
|
|
|
9e78a22 |
corenet_udp_bind_lirc_port(icecc_scheduler_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
files_read_etc_files(icecc_scheduler_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
libs_use_ld_so(icecc_scheduler_t)
|
|
|
9e78a22 |
libs_use_shared_libs(icecc_scheduler_t)
|
|
|
9e78a22 |
|
|
|
9e78a22 |
miscfiles_read_localization(icecc_scheduler_t)
|
|
|
d7dd36b |
|
|
|
d7dd36b |
kernel_read_system_state(icecc_scheduler_t)
|
|
|
ee34f12 |
|
|
|
ee34f12 |
sysnet_read_config(icecc_scheduler_t)
|