Blob Blame History Raw

policy_module(bluetooth,2.0.1)

########################################
#
# Declarations
#
type bluetooth_t;
type bluetooth_exec_t;
init_daemon_domain(bluetooth_t,bluetooth_exec_t)

type bluetooth_conf_t;
files_type(bluetooth_conf_t)

type bluetooth_conf_rw_t;
files_type(bluetooth_conf_rw_t)

attribute bluetooth_helper_domain;

type bluetooth_helper_exec_t;
application_executable_file(bluetooth_helper_exec_t)

type bluetooth_lock_t;
files_lock_file(bluetooth_lock_t)

type bluetooth_tmp_t;
files_tmp_file(bluetooth_tmp_t)

type bluetooth_var_lib_t;
files_type(bluetooth_var_lib_t)

type bluetooth_var_run_t;
files_pid_file(bluetooth_var_run_t)

########################################
#
# Bluetooth services local policy
#

allow bluetooth_t self:capability { net_bind_service net_admin net_raw sys_tty_config ipc_lock };
dontaudit bluetooth_t self:capability sys_tty_config;
allow bluetooth_t self:process { getsched signal_perms };
allow bluetooth_t self:fifo_file rw_fifo_file_perms;
allow bluetooth_t self:shm create_shm_perms;
allow bluetooth_t self:socket create_stream_socket_perms;
allow bluetooth_t self:unix_dgram_socket create_socket_perms;
allow bluetooth_t self:unix_stream_socket create_stream_socket_perms;
allow bluetooth_t self:tcp_socket create_stream_socket_perms;
allow bluetooth_t self:udp_socket create_socket_perms;

read_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_t)

manage_dirs_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t)
manage_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t)
manage_lnk_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t)
manage_fifo_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t)
manage_sock_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t)
filetrans_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_rw_t,{ dir file lnk_file sock_file fifo_file })

can_exec(bluetooth_t, bluetooth_helper_exec_t)

allow bluetooth_t bluetooth_lock_t:file manage_file_perms;
files_lock_filetrans(bluetooth_t,bluetooth_lock_t,file)

manage_dirs_pattern(bluetooth_t,bluetooth_tmp_t,bluetooth_tmp_t)
manage_files_pattern(bluetooth_t,bluetooth_tmp_t,bluetooth_tmp_t)
files_tmp_filetrans(bluetooth_t, bluetooth_tmp_t, { file dir })

manage_dirs_pattern(bluetooth_t,bluetooth_var_lib_t,bluetooth_var_lib_t)
manage_files_pattern(bluetooth_t,bluetooth_var_lib_t,bluetooth_var_lib_t)
files_var_lib_filetrans(bluetooth_t,bluetooth_var_lib_t,{ dir file } )

manage_files_pattern(bluetooth_t,bluetooth_var_run_t,bluetooth_var_run_t)
manage_sock_files_pattern(bluetooth_t,bluetooth_var_run_t,bluetooth_var_run_t)
files_pid_filetrans(bluetooth_t, bluetooth_var_run_t, { file sock_file })

kernel_read_kernel_sysctls(bluetooth_t)
kernel_read_system_state(bluetooth_t)

corenet_all_recvfrom_unlabeled(bluetooth_t)
corenet_all_recvfrom_netlabel(bluetooth_t)
corenet_tcp_sendrecv_all_if(bluetooth_t)
corenet_udp_sendrecv_all_if(bluetooth_t)
corenet_raw_sendrecv_all_if(bluetooth_t)
corenet_tcp_sendrecv_all_nodes(bluetooth_t)
corenet_udp_sendrecv_all_nodes(bluetooth_t)
corenet_raw_sendrecv_all_nodes(bluetooth_t)
corenet_tcp_sendrecv_all_ports(bluetooth_t)
corenet_udp_sendrecv_all_ports(bluetooth_t)

dev_read_sysfs(bluetooth_t)
dev_rw_usbfs(bluetooth_t)
dev_rw_generic_usb_dev(bluetooth_t)
dev_read_urand(bluetooth_t)

fs_getattr_all_fs(bluetooth_t)
fs_search_auto_mountpoints(bluetooth_t)
fs_list_inotifyfs(bluetooth_t)

#Handle bluetooth serial devices
term_use_unallocated_ttys(bluetooth_t)

corecmd_exec_bin(bluetooth_t)
corecmd_exec_shell(bluetooth_t)

domain_use_interactive_fds(bluetooth_t)
domain_dontaudit_search_all_domains_state(bluetooth_t)

files_read_etc_files(bluetooth_t)
files_read_etc_runtime_files(bluetooth_t)
files_read_usr_files(bluetooth_t)

libs_use_ld_so(bluetooth_t)
libs_use_shared_libs(bluetooth_t)

logging_send_syslog_msg(bluetooth_t)

miscfiles_read_localization(bluetooth_t)
miscfiles_read_fonts(bluetooth_t)

sysnet_read_config(bluetooth_t)

userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
userdom_dontaudit_use_sysadm_ptys(bluetooth_t)
userdom_dontaudit_search_sysadm_home_dirs(bluetooth_t)

optional_policy(`
	dbus_system_bus_client_template(bluetooth,bluetooth_t)
	dbus_connect_system_bus(bluetooth_t)
')

optional_policy(`
	nis_use_ypbind(bluetooth_t)
')

optional_policy(`
	seutil_sigchld_newrole(bluetooth_t)
')

optional_policy(`
	udev_read_db(bluetooth_t)
')

optional_policy(`
	ppp_domtrans(bluetooth_t)
')