Chris PeBenito 17de1b
Chris PeBenito 17de1b
policy_module(bluetooth,1.2.8)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type bluetooth_t;
Chris PeBenito 17de1b
type bluetooth_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(bluetooth_t,bluetooth_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_conf_t;
Chris PeBenito 17de1b
files_type(bluetooth_conf_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_conf_rw_t;
Chris PeBenito 17de1b
files_type(bluetooth_conf_rw_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_helper_t;
Chris PeBenito 17de1b
type bluetooth_helper_exec_t;
Chris PeBenito 17de1b
domain_type(bluetooth_helper_t)
Chris PeBenito 17de1b
domain_entry_file(bluetooth_helper_t,bluetooth_helper_exec_t)
Chris PeBenito 17de1b
role system_r types bluetooth_helper_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_helper_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(bluetooth_helper_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_lock_t;
Chris PeBenito 17de1b
files_lock_file(bluetooth_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(bluetooth_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_var_lib_t;
Chris PeBenito 17de1b
files_type(bluetooth_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type bluetooth_var_run_t;
Chris PeBenito 17de1b
files_pid_file(bluetooth_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Bluetooth services local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t self:capability { net_admin net_raw sys_tty_config ipc_lock };
Chris PeBenito 17de1b
dontaudit bluetooth_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow bluetooth_t self:process { getsched signal_perms };
Chris PeBenito 17de1b
allow bluetooth_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow bluetooth_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_t:dir rw_dir_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_t:file { getattr read ioctl };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_rw_t:dir create_dir_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_rw_t:file create_file_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_rw_t:lnk_file create_lnk_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_rw_t:sock_file create_file_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_conf_rw_t:fifo_file create_file_perms;
Chris PeBenito 17de1b
type_transition bluetooth_t bluetooth_conf_t:{ dir file lnk_file sock_file fifo_file } bluetooth_conf_rw_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_auto_trans(bluetooth_t, bluetooth_helper_exec_t, bluetooth_helper_t)
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_helper_t:fd use;
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_t:fd use;
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_t:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_t:process sigchld;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_lock_t:file create_file_perms;
Chris PeBenito 17de1b
files_lock_filetrans(bluetooth_t,bluetooth_lock_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_tmp_t:dir create_dir_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_tmp_t:file create_file_perms;
Chris PeBenito 17de1b
files_tmp_filetrans(bluetooth_t, bluetooth_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_var_lib_t:file create_file_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_var_lib_t:dir create_dir_perms;
Chris PeBenito 17de1b
files_var_lib_filetrans(bluetooth_t,bluetooth_var_lib_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_var_run_t:dir rw_dir_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_var_run_t:file create_file_perms;
Chris PeBenito 17de1b
allow bluetooth_t bluetooth_var_run_t:sock_file create_file_perms;
Chris PeBenito 17de1b
files_pid_filetrans(bluetooth_t, bluetooth_var_run_t, { file sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(bluetooth_t)
Chris PeBenito 17de1b
kernel_read_system_state(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(bluetooth_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(bluetooth_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(bluetooth_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_all_if(bluetooth_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(bluetooth_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(bluetooth_t)
Chris PeBenito 17de1b
dev_rw_usbfs(bluetooth_t)
Chris PeBenito 17de1b
dev_rw_generic_usb_dev(bluetooth_t)
Chris PeBenito 17de1b
dev_read_urand(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(bluetooth_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(bluetooth_t)
Chris PeBenito 17de1b
#Handle bluetooth serial devices
Chris PeBenito 17de1b
term_use_unallocated_ttys(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_bin(bluetooth_t)
Chris PeBenito 17de1b
corecmd_exec_shell(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(bluetooth_t)
Chris PeBenito 17de1b
domain_dontaudit_search_all_domains_state(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(bluetooth_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(bluetooth_t)
Chris PeBenito 17de1b
files_read_usr_files(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(bluetooth_t)
Chris PeBenito 17de1b
init_use_script_ptys(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(bluetooth_t)
Chris PeBenito 17de1b
libs_use_shared_libs(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
locallogin_dontaudit_use_fds(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(bluetooth_t)
Chris PeBenito 17de1b
miscfiles_read_fonts(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
Chris PeBenito 17de1b
userdom_dontaudit_use_sysadm_ptys(bluetooth_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(bluetooth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(bluetooth_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(bluetooth_t)
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(bluetooth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dbus_system_bus_client_template(bluetooth,bluetooth_t)
Chris PeBenito 17de1b
	dbus_connect_system_bus(bluetooth_t)
Chris PeBenito 17de1b
	dbus_send_system_bus(bluetooth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(bluetooth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(bluetooth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(bluetooth_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Bluetooth helper local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_helper_t self:capability sys_nice;
Chris PeBenito 17de1b
allow bluetooth_helper_t self:process getsched;
Chris PeBenito 17de1b
allow bluetooth_helper_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow bluetooth_helper_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow bluetooth_helper_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 17de1b
allow bluetooth_helper_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_t:socket { read write };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_helper_tmp_t:dir manage_dir_perms;
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_helper_tmp_t:file manage_file_perms;
Chris PeBenito 17de1b
allow bluetooth_helper_t bluetooth_helper_tmp_t:sock_file manage_file_perms;
Chris PeBenito 17de1b
files_tmp_filetrans(bluetooth_helper_t, bluetooth_helper_tmp_t, { file dir sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(bluetooth_helper_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_all_user_ttys(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_bin(bluetooth_helper_t)
Chris PeBenito 17de1b
corecmd_exec_shell(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_read_all_domains_state(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(bluetooth_helper_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(bluetooth_helper_t)
Chris PeBenito 17de1b
files_read_usr_files(bluetooth_helper_t)
Chris PeBenito 17de1b
files_search_tmp(bluetooth_helper_t)
Chris PeBenito 17de1b
files_dontaudit_list_default(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(bluetooth_helper_t)
Chris PeBenito 17de1b
libs_use_shared_libs(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(bluetooth_helper_t) 
Chris PeBenito 17de1b
miscfiles_read_fonts(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	files_rw_generic_tmp_sockets(bluetooth_helper_t)
Chris PeBenito 17de1b
	files_manage_generic_tmp_files(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_rw_tmpfs_files(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	unconfined_stream_connect(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_manage_generic_user_home_content_files(bluetooth_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		xserver_stream_connect_xdm(bluetooth_helper_t)
Chris PeBenito 17de1b
		xserver_use_xdm_fds(bluetooth_helper_t)
Chris PeBenito 17de1b
		xserver_rw_xdm_pipes(bluetooth_helper_t)
Chris PeBenito 17de1b
		# when started via startx 
Chris PeBenito 17de1b
		xserver_stream_connect_xdm_xserver(bluetooth_helper_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	bluetooth_dbus_chat(bluetooth_helper_t)
Chris PeBenito 17de1b
	dbus_system_bus_client_template(bluetooth_helper,bluetooth_helper_t)
Chris PeBenito 17de1b
	dbus_connect_system_bus(bluetooth_helper_t)
Chris PeBenito 17de1b
	dbus_send_system_bus(bluetooth_helper_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(bluetooth_helper_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
       	xserver_stream_connect_xdm(bluetooth_helper_t)
Chris PeBenito 17de1b
')