Chris PeBenito d4dca5
Chris PeBenito 8cf671
policy_module(bluetooth,1.1.1)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
########################################
Chris PeBenito d4dca5
#
Chris PeBenito d4dca5
# Declarations
Chris PeBenito d4dca5
#
Chris PeBenito d4dca5
type bluetooth_t;
Chris PeBenito d4dca5
type bluetooth_exec_t;
Chris PeBenito d4dca5
init_daemon_domain(bluetooth_t,bluetooth_exec_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
type bluetooth_conf_t;
Chris PeBenito d4dca5
files_type(bluetooth_conf_t)
Chris PeBenito d4dca5
Chris PeBenito d8636f
type bluetooth_conf_rw_t;
Chris PeBenito d8636f
files_type(bluetooth_conf_rw_t)
Chris PeBenito d8636f
Chris PeBenito d8636f
type bluetooth_helper_t;
Chris PeBenito d8636f
type bluetooth_helper_exec_t;
Chris PeBenito d8636f
domain_type(bluetooth_helper_t)
Chris PeBenito d8636f
domain_entry_file(bluetooth_helper_t,bluetooth_helper_exec_t)
Chris PeBenito d8636f
role system_r types bluetooth_helper_t;
Chris PeBenito d8636f
Chris PeBenito 19b555
type bluetooth_helper_tmp_t;
Chris PeBenito 19b555
files_tmp_file(bluetooth_helper_tmp_t)
Chris PeBenito 19b555
Chris PeBenito d4dca5
type bluetooth_lock_t;
Chris PeBenito d4dca5
files_lock_file(bluetooth_lock_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
type bluetooth_tmp_t;
Chris PeBenito d4dca5
files_tmp_file(bluetooth_tmp_t)
Chris PeBenito d4dca5
Chris PeBenito d8636f
type bluetooth_var_lib_t;
Chris PeBenito d8636f
files_type(bluetooth_var_lib_t)
Chris PeBenito d8636f
Chris PeBenito d4dca5
type bluetooth_var_run_t;
Chris PeBenito d4dca5
files_pid_file(bluetooth_var_run_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
########################################
Chris PeBenito d4dca5
#
Chris PeBenito d8636f
# Bluetooth services local policy
Chris PeBenito d4dca5
#
Chris PeBenito d8636f
Chris PeBenito d4dca5
allow bluetooth_t self:capability { net_admin net_raw sys_tty_config };
Chris PeBenito d4dca5
dontaudit bluetooth_t self:capability sys_tty_config;
Chris PeBenito d8636f
allow bluetooth_t self:process { getsched signal_perms };
Chris PeBenito d8636f
allow bluetooth_t self:fifo_file rw_file_perms;
Chris PeBenito d8636f
allow bluetooth_t self:shm create_shm_perms;
Chris PeBenito d4dca5
allow bluetooth_t self:socket create_stream_socket_perms;
Chris PeBenito d4dca5
allow bluetooth_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito d4dca5
allow bluetooth_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito d4dca5
allow bluetooth_t self:tcp_socket { create_stream_socket_perms connect };
Chris PeBenito d4dca5
allow bluetooth_t self:udp_socket create_socket_perms;
Chris PeBenito d4dca5
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_t:dir rw_dir_perms;
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_conf_t:file { getattr read ioctl };
Chris PeBenito d4dca5
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_rw_t:dir create_dir_perms;
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_rw_t:file create_file_perms;
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_rw_t:lnk_file create_lnk_perms;
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_rw_t:sock_file create_file_perms;
Chris PeBenito d8636f
allow bluetooth_t bluetooth_conf_rw_t:fifo_file create_file_perms;
Chris PeBenito 33acca
type_transition bluetooth_t bluetooth_conf_t:{ dir file lnk_file sock_file fifo_file } bluetooth_conf_rw_t;
Chris PeBenito d8636f
Chris PeBenito 9bbc75
domain_auto_trans(bluetooth_t, bluetooth_helper_exec_t, bluetooth_helper_t)
Chris PeBenito 9bbc75
allow bluetooth_t bluetooth_helper_t:fd use;
Chris PeBenito 9bbc75
allow bluetooth_helper_t bluetooth_t:fd use;
Chris PeBenito 9bbc75
allow bluetooth_helper_t bluetooth_t:fifo_file rw_file_perms;
Chris PeBenito 9bbc75
allow bluetooth_helper_t bluetooth_t:process sigchld;
Chris PeBenito 9bbc75
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_lock_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_lock(bluetooth_t,bluetooth_lock_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_tmp_t:dir create_dir_perms;
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_tmp_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_tmp(bluetooth_t, bluetooth_tmp_t, { file dir })
Chris PeBenito d4dca5
Chris PeBenito d8636f
allow bluetooth_t bluetooth_var_lib_t:file create_file_perms;
Chris PeBenito d8636f
allow bluetooth_t bluetooth_var_lib_t:dir create_dir_perms;
Chris PeBenito 9d5949
files_filetrans_var_lib(bluetooth_t,bluetooth_var_lib_t)
Chris PeBenito d8636f
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_var_run_t:dir rw_dir_perms;
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_var_run_t:file create_file_perms;
Chris PeBenito d4dca5
allow bluetooth_t bluetooth_var_run_t:sock_file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_pid(bluetooth_t, bluetooth_var_run_t, { file sock_file })
Chris PeBenito d4dca5
Chris PeBenito 445522
kernel_read_kernel_sysctls(bluetooth_t)
Chris PeBenito d8636f
kernel_read_system_state(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
corenet_tcp_sendrecv_all_if(bluetooth_t)
Chris PeBenito d4dca5
corenet_udp_sendrecv_all_if(bluetooth_t)
Chris PeBenito d4dca5
corenet_raw_sendrecv_all_if(bluetooth_t)
Chris PeBenito d4dca5
corenet_tcp_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito d4dca5
corenet_udp_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito d4dca5
corenet_raw_sendrecv_all_nodes(bluetooth_t)
Chris PeBenito d4dca5
corenet_tcp_sendrecv_all_ports(bluetooth_t)
Chris PeBenito d4dca5
corenet_udp_sendrecv_all_ports(bluetooth_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(bluetooth_t)
Chris PeBenito bd7037
corenet_tcp_bind_all_nodes(bluetooth_t)
Chris PeBenito bd7037
corenet_udp_bind_all_nodes(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
dev_read_sysfs(bluetooth_t)
Chris PeBenito d4dca5
dev_rw_usbfs(bluetooth_t)
Chris PeBenito 8cf671
dev_rw_generic_usb_dev(bluetooth_t)
Chris PeBenito d8636f
dev_read_urand(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
fs_getattr_all_fs(bluetooth_t)
Chris PeBenito d4dca5
fs_search_auto_mountpoints(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
term_dontaudit_use_console(bluetooth_t)
Chris PeBenito d8636f
#Handle bluetooth serial devices
Chris PeBenito 1815ba
term_use_unallocated_ttys(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
corecmd_exec_bin(bluetooth_t)
Chris PeBenito d8636f
corecmd_exec_shell(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
domain_use_wide_inherit_fd(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d8636f
files_read_etc_files(bluetooth_t)
Chris PeBenito d8636f
files_read_etc_runtime_files(bluetooth_t)
Chris PeBenito d8636f
files_read_usr_files(bluetooth_t)
Chris PeBenito d8636f
Chris PeBenito d4dca5
init_use_fd(bluetooth_t)
Chris PeBenito 1815ba
init_use_script_ptys(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
libs_use_ld_so(bluetooth_t)
Chris PeBenito d4dca5
libs_use_shared_libs(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
logging_send_syslog_msg(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
miscfiles_read_localization(bluetooth_t)
Chris PeBenito d8636f
miscfiles_read_fonts(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
sysnet_read_config(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
userdom_dontaudit_use_unpriv_user_fd(bluetooth_t)
Chris PeBenito 1815ba
userdom_dontaudit_use_sysadm_ptys(bluetooth_t)
Chris PeBenito d4dca5
userdom_dontaudit_search_sysadm_home_dir(bluetooth_t)
Chris PeBenito d4dca5
Chris PeBenito d4dca5
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(bluetooth_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(bluetooth_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(bluetooth_t)
Chris PeBenito d4dca5
')
Chris PeBenito d4dca5
Chris PeBenito 132880
optional_policy(`dbus',`
Chris PeBenito d4dca5
	dbus_system_bus_client_template(bluetooth,bluetooth_t)
Chris PeBenito 1815ba
	dbus_send_system_bus(bluetooth_t)
Chris PeBenito d4dca5
')
Chris PeBenito d4dca5
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito d4dca5
	nis_use_ypbind(bluetooth_t)
Chris PeBenito d4dca5
')
Chris PeBenito d4dca5
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito d4dca5
	seutil_sigchld_newrole(bluetooth_t)
Chris PeBenito d4dca5
')
Chris PeBenito d4dca5
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito d4dca5
	udev_read_db(bluetooth_t)
Chris PeBenito d4dca5
')
Chris PeBenito d4dca5
Chris PeBenito d8636f
########################################
Chris PeBenito d8636f
#
Chris PeBenito d8636f
# Bluetooth helper local policy
Chris PeBenito d8636f
#
Chris PeBenito d8636f
Chris PeBenito d8636f
allow bluetooth_helper_t self:capability sys_nice;
Chris PeBenito da4fc9
allow bluetooth_helper_t self:process getsched;
Chris PeBenito d8636f
allow bluetooth_helper_t self:fifo_file rw_file_perms;
Chris PeBenito d8636f
allow bluetooth_helper_t self:shm create_shm_perms;
Chris PeBenito da4fc9
allow bluetooth_helper_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito d8636f
Chris PeBenito d8636f
allow bluetooth_helper_t bluetooth_t:socket { read write };
Chris PeBenito d8636f
Chris PeBenito 19b555
allow bluetooth_helper_t bluetooth_helper_tmp_t:dir create_dir_perms;
Chris PeBenito 19b555
allow bluetooth_helper_t bluetooth_helper_tmp_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_tmp(bluetooth_helper_t, bluetooth_helper_tmp_t, { file dir })
Chris PeBenito 19b555
Chris PeBenito d8636f
kernel_read_system_state(bluetooth_helper_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito 19b555
dev_read_urand(bluetooth_helper_t)
Chris PeBenito 19b555
Chris PeBenito d8636f
term_dontaudit_use_all_user_ttys(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito d8636f
corecmd_exec_bin(bluetooth_helper_t)
Chris PeBenito d8636f
corecmd_exec_shell(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito d8636f
domain_read_all_domains_state(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito d8636f
files_read_etc_files(bluetooth_helper_t)
Chris PeBenito d8636f
files_read_etc_runtime_files(bluetooth_helper_t)
Chris PeBenito d8636f
files_read_usr_files(bluetooth_helper_t)
Chris PeBenito d8636f
files_dontaudit_list_default(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito d8636f
libs_use_ld_so(bluetooth_helper_t)
Chris PeBenito d8636f
libs_use_shared_libs(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito 9bbc75
logging_send_syslog_msg(bluetooth_helper_t)
Chris PeBenito 9bbc75
Chris PeBenito d8636f
miscfiles_read_localization(bluetooth_helper_t) 
Chris PeBenito d8636f
miscfiles_read_fonts(bluetooth_helper_t)
Chris PeBenito d8636f
Chris PeBenito 725926
userdom_search_all_users_home(bluetooth_helper_t)
Chris PeBenito 725926
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(bluetooth_helper_t)
Chris PeBenito d8636f
')
Chris PeBenito d8636f
Chris PeBenito d8636f
ifdef(`TODO',`
Chris PeBenito d8636f
allow bluetooth_helper_t tmp_t:dir search;
Chris PeBenito d8636f
Chris PeBenito d8636f
ifdef(`xserver.te', `
Chris PeBenito d8636f
	allow bluetooth_helper_t xserver_log_t:dir search;
Chris PeBenito d8636f
	allow bluetooth_helper_t xserver_log_t:file { getattr read };
Chris PeBenito d8636f
')
Chris PeBenito d8636f
Chris PeBenito 6f81e1
ifdef(`strict_policy',`
Chris PeBenito 6f81e1
	ifdef(`xdm.te',`
Chris PeBenito d8636f
		allow bluetooth_helper_t xdm_xserver_tmp_t:sock_file { read write };
Chris PeBenito d8636f
	')
Chris PeBenito d4dca5
')
Chris PeBenito d8636f
') dnl end TODO
Chris PeBenito 0b12fa
Chris PeBenito 0b12fa
ifdef(`targeted_policy',`
Chris PeBenito 6f81e1
	files_rw_generic_tmp_sockets(bluetooth_helper_t)
Chris PeBenito 725926
	allow bluetooth_helper_t tmpfs_t:file { read write };
Chris PeBenito 725926
	allow bluetooth_helper_t unconfined_t:unix_stream_socket connectto;
Chris PeBenito 0b12fa
')