selinux-refpolicy/policy/modules/services/bluetooth.te

248 lines
7.6 KiB
Plaintext
Raw Normal View History

2005-10-07 21:45:04 +00:00
policy_module(bluetooth,1.6.0)
2005-10-07 21:45:04 +00:00
########################################
#
# 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)
2005-10-14 17:55:40 +00:00
type bluetooth_conf_rw_t;
files_type(bluetooth_conf_rw_t)
type bluetooth_helper_t;
type bluetooth_helper_exec_t;
domain_type(bluetooth_helper_t)
domain_entry_file(bluetooth_helper_t,bluetooth_helper_exec_t)
role system_r types bluetooth_helper_t;
2005-10-24 03:21:26 +00:00
type bluetooth_helper_tmp_t;
files_tmp_file(bluetooth_helper_tmp_t)
2005-10-07 21:45:04 +00:00
type bluetooth_lock_t;
files_lock_file(bluetooth_lock_t)
type bluetooth_tmp_t;
files_tmp_file(bluetooth_tmp_t)
2005-10-14 17:55:40 +00:00
type bluetooth_var_lib_t;
files_type(bluetooth_var_lib_t)
2005-10-07 21:45:04 +00:00
type bluetooth_var_run_t;
files_pid_file(bluetooth_var_run_t)
########################################
#
2005-10-14 17:55:40 +00:00
# Bluetooth services local policy
2005-10-07 21:45:04 +00:00
#
2005-10-14 17:55:40 +00:00
allow bluetooth_t self:capability { net_bind_service net_admin net_raw sys_tty_config ipc_lock };
2005-10-07 21:45:04 +00:00
dontaudit bluetooth_t self:capability sys_tty_config;
2005-10-14 17:55:40 +00:00
allow bluetooth_t self:process { getsched signal_perms };
2006-12-12 20:08:08 +00:00
allow bluetooth_t self:fifo_file rw_fifo_file_perms;
2005-10-14 17:55:40 +00:00
allow bluetooth_t self:shm create_shm_perms;
2005-10-07 21:45:04 +00:00
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;
2006-06-02 15:06:45 +00:00
allow bluetooth_t self:tcp_socket create_stream_socket_perms;
2005-10-07 21:45:04 +00:00
allow bluetooth_t self:udp_socket create_socket_perms;
2006-12-12 20:08:08 +00:00
read_files_pattern(bluetooth_t,bluetooth_conf_t,bluetooth_conf_t)
2005-10-07 21:45:04 +00:00
2006-12-12 20:08:08 +00:00
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 })
2005-10-14 17:55:40 +00:00
2006-12-12 20:08:08 +00:00
domtrans_pattern(bluetooth_t, bluetooth_helper_exec_t, bluetooth_helper_t)
2005-10-24 18:40:24 +00:00
allow bluetooth_t bluetooth_lock_t:file manage_file_perms;
files_lock_filetrans(bluetooth_t,bluetooth_lock_t,file)
2005-10-07 21:45:04 +00:00
2006-12-12 20:08:08 +00:00
manage_dirs_pattern(bluetooth_t,bluetooth_tmp_t,bluetooth_tmp_t)
manage_files_pattern(bluetooth_t,bluetooth_tmp_t,bluetooth_tmp_t)
2006-02-21 18:40:44 +00:00
files_tmp_filetrans(bluetooth_t, bluetooth_tmp_t, { file dir })
2005-10-07 21:45:04 +00:00
2006-12-12 20:08:08 +00:00
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 } )
2005-10-14 17:55:40 +00:00
2006-12-12 20:08:08 +00:00
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)
2006-02-21 18:40:44 +00:00
files_pid_filetrans(bluetooth_t, bluetooth_var_run_t, { file sock_file })
2005-10-07 21:45:04 +00:00
kernel_read_kernel_sysctls(bluetooth_t)
2005-10-14 17:55:40 +00:00
kernel_read_system_state(bluetooth_t)
2005-10-07 21:45:04 +00:00
corenet_all_recvfrom_unlabeled(bluetooth_t)
corenet_all_recvfrom_netlabel(bluetooth_t)
2005-10-07 21:45:04 +00:00
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)
2005-10-14 17:55:40 +00:00
dev_read_urand(bluetooth_t)
2005-10-07 21:45:04 +00:00
fs_getattr_all_fs(bluetooth_t)
fs_search_auto_mountpoints(bluetooth_t)
2007-04-30 14:33:12 +00:00
fs_list_inotifyfs(bluetooth_t)
2005-10-07 21:45:04 +00:00
2005-10-14 17:55:40 +00:00
#Handle bluetooth serial devices
2006-02-02 21:08:12 +00:00
term_use_unallocated_ttys(bluetooth_t)
2005-10-07 21:45:04 +00:00
corecmd_exec_bin(bluetooth_t)
2005-10-14 17:55:40 +00:00
corecmd_exec_shell(bluetooth_t)
2005-10-07 21:45:04 +00:00
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(bluetooth_t)
domain_dontaudit_search_all_domains_state(bluetooth_t)
2005-10-07 21:45:04 +00:00
2005-10-14 17:55:40 +00:00
files_read_etc_files(bluetooth_t)
files_read_etc_runtime_files(bluetooth_t)
files_read_usr_files(bluetooth_t)
2005-10-07 21:45:04 +00:00
libs_use_ld_so(bluetooth_t)
libs_use_shared_libs(bluetooth_t)
locallogin_dontaudit_use_fds(bluetooth_helper_t)
2005-10-07 21:45:04 +00:00
logging_send_syslog_msg(bluetooth_t)
miscfiles_read_localization(bluetooth_t)
2005-10-14 17:55:40 +00:00
miscfiles_read_fonts(bluetooth_t)
2005-10-07 21:45:04 +00:00
sysnet_read_config(bluetooth_t)
2006-02-20 21:33:25 +00:00
userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
2006-02-02 21:08:12 +00:00
userdom_dontaudit_use_sysadm_ptys(bluetooth_t)
2006-02-21 18:40:44 +00:00
userdom_dontaudit_search_sysadm_home_dirs(bluetooth_t)
2005-10-07 21:45:04 +00:00
ifdef(`targeted_policy',`
2006-02-02 21:08:12 +00:00
term_dontaudit_use_unallocated_ttys(bluetooth_t)
term_dontaudit_use_generic_ptys(bluetooth_t)
files_dontaudit_read_root_files(bluetooth_t)
2005-10-07 21:45:04 +00:00
')
optional_policy(`
2005-10-07 21:45:04 +00:00
dbus_system_bus_client_template(bluetooth,bluetooth_t)
dbus_connect_system_bus(bluetooth_t)
2006-02-02 21:08:12 +00:00
dbus_send_system_bus(bluetooth_t)
2005-10-07 21:45:04 +00:00
')
optional_policy(`
2005-10-07 21:45:04 +00:00
nis_use_ypbind(bluetooth_t)
')
optional_policy(`
2005-10-07 21:45:04 +00:00
seutil_sigchld_newrole(bluetooth_t)
')
optional_policy(`
2005-10-07 21:45:04 +00:00
udev_read_db(bluetooth_t)
')
2005-10-14 17:55:40 +00:00
########################################
#
# Bluetooth helper local policy
#
allow bluetooth_helper_t self:capability sys_nice;
2005-10-21 19:36:49 +00:00
allow bluetooth_helper_t self:process getsched;
2006-12-12 20:08:08 +00:00
allow bluetooth_helper_t self:fifo_file rw_fifo_file_perms;
2005-10-14 17:55:40 +00:00
allow bluetooth_helper_t self:shm create_shm_perms;
2005-10-21 19:36:49 +00:00
allow bluetooth_helper_t self:unix_stream_socket { create_stream_socket_perms connectto };
allow bluetooth_helper_t self:tcp_socket create_socket_perms;
allow bluetooth_helper_t self:netlink_route_socket r_netlink_socket_perms;
2005-10-14 17:55:40 +00:00
allow bluetooth_helper_t bluetooth_t:socket { read write };
2006-12-12 20:08:08 +00:00
manage_dirs_pattern(bluetooth_helper_t,bluetooth_helper_tmp_t,bluetooth_helper_tmp_t)
manage_files_pattern(bluetooth_helper_t,bluetooth_helper_tmp_t,bluetooth_helper_tmp_t)
manage_sock_files_pattern(bluetooth_helper_t,bluetooth_helper_tmp_t,bluetooth_helper_tmp_t)
files_tmp_filetrans(bluetooth_helper_t, bluetooth_helper_tmp_t, { file dir sock_file })
2005-10-24 03:21:26 +00:00
2005-10-14 17:55:40 +00:00
kernel_read_system_state(bluetooth_helper_t)
kernel_read_kernel_sysctls(bluetooth_helper_t)
2005-10-14 17:55:40 +00:00
2005-10-24 03:21:26 +00:00
dev_read_urand(bluetooth_helper_t)
2005-10-14 17:55:40 +00:00
term_dontaudit_use_all_user_ttys(bluetooth_helper_t)
corecmd_exec_bin(bluetooth_helper_t)
corecmd_exec_shell(bluetooth_helper_t)
domain_read_all_domains_state(bluetooth_helper_t)
files_read_etc_files(bluetooth_helper_t)
files_read_etc_runtime_files(bluetooth_helper_t)
files_read_usr_files(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
files_search_tmp(bluetooth_helper_t)
2005-10-14 17:55:40 +00:00
files_dontaudit_list_default(bluetooth_helper_t)
libs_use_ld_so(bluetooth_helper_t)
libs_use_shared_libs(bluetooth_helper_t)
2005-10-24 18:40:24 +00:00
logging_send_syslog_msg(bluetooth_helper_t)
2005-10-14 17:55:40 +00:00
miscfiles_read_localization(bluetooth_helper_t)
miscfiles_read_fonts(bluetooth_helper_t)
sysnet_read_config(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
ifdef(`targeted_policy',`
files_rw_generic_tmp_sockets(bluetooth_helper_t)
files_manage_generic_tmp_files(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
fs_rw_tmpfs_files(bluetooth_helper_t)
term_dontaudit_use_generic_ptys(bluetooth_helper_t)
term_dontaudit_use_unallocated_ttys(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
unconfined_stream_connect(bluetooth_helper_t)
userdom_manage_generic_user_home_content_files(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
optional_policy(`
corenet_tcp_connect_xserver_port(bluetooth_helper_t)
#Bugzilla https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205956
xserver_read_xdm_tmp_files(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
xserver_stream_connect_xdm(bluetooth_helper_t)
xserver_use_xdm_fds(bluetooth_helper_t)
xserver_rw_xdm_pipes(bluetooth_helper_t)
# when started via startx
xserver_stream_connect_xdm_xserver(bluetooth_helper_t)
2006-03-29 14:31:10 +00:00
')
')
optional_policy(`
bluetooth_dbus_chat(bluetooth_helper_t)
dbus_system_bus_client_template(bluetooth_helper,bluetooth_helper_t)
dbus_connect_system_bus(bluetooth_helper_t)
dbus_send_system_bus(bluetooth_helper_t)
')
2005-11-08 22:00:30 +00:00
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(bluetooth_helper_t)
2005-10-14 17:55:40 +00:00
')
optional_policy(`
ppp_domtrans(bluetooth_t)
')
optional_policy(`
xserver_stream_connect_xdm(bluetooth_helper_t)
')