]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - policy/modules/services/bluetooth.te
Bump module versions for release.
[people/stevee/selinux-policy.git] / policy / modules / services / bluetooth.te
CommitLineData
d4dca585 1
29af4c13 2policy_module(bluetooth, 3.3.0)
d4dca585
CP
3
4########################################
5#
6# Declarations
7#
8type bluetooth_t;
9type bluetooth_exec_t;
0bfccda4 10init_daemon_domain(bluetooth_t, bluetooth_exec_t)
d4dca585
CP
11
12type bluetooth_conf_t;
13files_type(bluetooth_conf_t)
14
d8636fc9
CP
15type bluetooth_conf_rw_t;
16files_type(bluetooth_conf_rw_t)
17
296273a7 18type bluetooth_helper_t;
350b6ab7 19type bluetooth_helper_exec_t;
296273a7
CP
20typealias bluetooth_helper_t alias { user_bluetooth_helper_t staff_bluetooth_helper_t sysadm_bluetooth_helper_t };
21typealias bluetooth_helper_t alias { auditadm_bluetooth_helper_t secadm_bluetooth_helper_t };
22application_domain(bluetooth_helper_t, bluetooth_helper_exec_t)
23ubac_constrained(bluetooth_helper_t)
24
25type bluetooth_helper_tmp_t;
26typealias bluetooth_helper_tmp_t alias { user_bluetooth_helper_tmp_t staff_bluetooth_helper_tmp_t sysadm_bluetooth_helper_tmp_t };
27typealias bluetooth_helper_tmp_t alias { auditadm_bluetooth_helper_tmp_t secadm_bluetooth_helper_tmp_t };
28files_tmp_file(bluetooth_helper_tmp_t)
29ubac_constrained(bluetooth_helper_tmp_t)
30
31type bluetooth_helper_tmpfs_t;
32typealias bluetooth_helper_tmpfs_t alias { user_bluetooth_helper_tmpfs_t staff_bluetooth_helper_tmpfs_t sysadm_bluetooth_helper_tmpfs_t };
33typealias bluetooth_helper_tmpfs_t alias { auditadm_bluetooth_helper_tmpfs_t secadm_bluetooth_helper_tmpfs_t };
34files_tmpfs_file(bluetooth_helper_tmpfs_t)
35ubac_constrained(bluetooth_helper_tmpfs_t)
19b5555f 36
fcee22ad
CP
37type bluetooth_initrc_exec_t;
38init_script_file(bluetooth_initrc_exec_t)
39
d4dca585
CP
40type bluetooth_lock_t;
41files_lock_file(bluetooth_lock_t)
42
43type bluetooth_tmp_t;
44files_tmp_file(bluetooth_tmp_t)
45
d8636fc9
CP
46type bluetooth_var_lib_t;
47files_type(bluetooth_var_lib_t)
48
d4dca585
CP
49type bluetooth_var_run_t;
50files_pid_file(bluetooth_var_run_t)
51
52########################################
53#
d8636fc9 54# Bluetooth services local policy
d4dca585 55#
d8636fc9 56
84ce9c33
JS
57#sys_admin capability - redhat bug 573015
58allow bluetooth_t self:capability { dac_override net_bind_service net_admin net_raw setpcap sys_admin sys_tty_config ipc_lock };
d4dca585 59dontaudit bluetooth_t self:capability sys_tty_config;
c5155ac0 60allow bluetooth_t self:process { getcap setcap getsched signal_perms };
c0868a7a 61allow bluetooth_t self:fifo_file rw_fifo_file_perms;
d8636fc9 62allow bluetooth_t self:shm create_shm_perms;
d4dca585
CP
63allow bluetooth_t self:socket create_stream_socket_perms;
64allow bluetooth_t self:unix_dgram_socket create_socket_perms;
fcee22ad 65allow bluetooth_t self:unix_stream_socket { connectto create_stream_socket_perms };
3d03a4f4 66allow bluetooth_t self:tcp_socket create_stream_socket_perms;
d4dca585 67allow bluetooth_t self:udp_socket create_socket_perms;
c5155ac0 68allow bluetooth_t self:netlink_kobject_uevent_socket create_socket_perms;
d4dca585 69
0bfccda4 70read_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_t)
d4dca585 71
0bfccda4
CP
72manage_dirs_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t)
73manage_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t)
74manage_lnk_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t)
75manage_fifo_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t)
76manage_sock_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t)
77filetrans_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_rw_t, { dir file lnk_file sock_file fifo_file })
d8636fc9 78
350b6ab7 79can_exec(bluetooth_t, bluetooth_helper_exec_t)
9bbc757a 80
d9845ae9 81allow bluetooth_t bluetooth_lock_t:file manage_file_perms;
3f67f722 82files_lock_filetrans(bluetooth_t, bluetooth_lock_t, file)
d4dca585 83
0bfccda4
CP
84manage_dirs_pattern(bluetooth_t, bluetooth_tmp_t, bluetooth_tmp_t)
85manage_files_pattern(bluetooth_t, bluetooth_tmp_t, bluetooth_tmp_t)
103fe280 86files_tmp_filetrans(bluetooth_t, bluetooth_tmp_t, { file dir })
d4dca585 87
0bfccda4
CP
88manage_dirs_pattern(bluetooth_t, bluetooth_var_lib_t, bluetooth_var_lib_t)
89manage_files_pattern(bluetooth_t, bluetooth_var_lib_t, bluetooth_var_lib_t)
90files_var_lib_filetrans(bluetooth_t, bluetooth_var_lib_t, { dir file } )
d8636fc9 91
0bfccda4
CP
92manage_files_pattern(bluetooth_t, bluetooth_var_run_t, bluetooth_var_run_t)
93manage_sock_files_pattern(bluetooth_t, bluetooth_var_run_t, bluetooth_var_run_t)
103fe280 94files_pid_filetrans(bluetooth_t, bluetooth_var_run_t, { file sock_file })
d4dca585 95
445522dc 96kernel_read_kernel_sysctls(bluetooth_t)
d8636fc9 97kernel_read_system_state(bluetooth_t)
8f800d48 98kernel_read_network_state(bluetooth_t)
c5155ac0 99kernel_request_load_module(bluetooth_t)
84ce9c33
JS
100#search debugfs - redhat bug 548206
101kernel_search_debugfs(bluetooth_t)
d4dca585 102
19006686
CP
103corenet_all_recvfrom_unlabeled(bluetooth_t)
104corenet_all_recvfrom_netlabel(bluetooth_t)
668b3093
CP
105corenet_tcp_sendrecv_generic_if(bluetooth_t)
106corenet_udp_sendrecv_generic_if(bluetooth_t)
107corenet_raw_sendrecv_generic_if(bluetooth_t)
c1262146
CP
108corenet_tcp_sendrecv_generic_node(bluetooth_t)
109corenet_udp_sendrecv_generic_node(bluetooth_t)
110corenet_raw_sendrecv_generic_node(bluetooth_t)
d4dca585
CP
111corenet_tcp_sendrecv_all_ports(bluetooth_t)
112corenet_udp_sendrecv_all_ports(bluetooth_t)
113
114dev_read_sysfs(bluetooth_t)
115dev_rw_usbfs(bluetooth_t)
8cf67141 116dev_rw_generic_usb_dev(bluetooth_t)
d8636fc9 117dev_read_urand(bluetooth_t)
fcee22ad 118dev_rw_input_dev(bluetooth_t)
c5155ac0 119dev_rw_wireless(bluetooth_t)
d4dca585
CP
120
121fs_getattr_all_fs(bluetooth_t)
122fs_search_auto_mountpoints(bluetooth_t)
7487a667 123fs_list_inotifyfs(bluetooth_t)
d4dca585 124
d8636fc9 125#Handle bluetooth serial devices
1815bad1 126term_use_unallocated_ttys(bluetooth_t)
d4dca585
CP
127
128corecmd_exec_bin(bluetooth_t)
d8636fc9 129corecmd_exec_shell(bluetooth_t)
d4dca585 130
15722ec9 131domain_use_interactive_fds(bluetooth_t)
a3cf80d8 132domain_dontaudit_search_all_domains_state(bluetooth_t)
d4dca585 133
d8636fc9
CP
134files_read_etc_files(bluetooth_t)
135files_read_etc_runtime_files(bluetooth_t)
136files_read_usr_files(bluetooth_t)
137
fcee22ad
CP
138auth_use_nsswitch(bluetooth_t)
139
d4dca585
CP
140logging_send_syslog_msg(bluetooth_t)
141
142miscfiles_read_localization(bluetooth_t)
d8636fc9 143miscfiles_read_fonts(bluetooth_t)
fcee22ad 144miscfiles_read_hwdata(bluetooth_t)
d4dca585 145
15722ec9 146userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
296273a7
CP
147userdom_dontaudit_use_user_terminals(bluetooth_t)
148userdom_dontaudit_search_user_home_dirs(bluetooth_t)
d4dca585 149
bb7170f6 150optional_policy(`
296273a7 151 dbus_system_bus_client(bluetooth_t)
a3cf80d8 152 dbus_connect_system_bus(bluetooth_t)
fcee22ad
CP
153
154 optional_policy(`
155 cups_dbus_chat(bluetooth_t)
156 ')
d4dca585 157
8f800d48
CP
158 optional_policy(`
159 hal_dbus_chat(bluetooth_t)
160 ')
b93a7dac 161
c5155ac0
CP
162 optional_policy(`
163 networkmanager_dbus_chat(bluetooth_t)
164 ')
165
b93a7dac
CP
166 optional_policy(`
167 pulseaudio_dbus_chat(bluetooth_t)
168 ')
d4dca585
CP
169')
170
bb7170f6 171optional_policy(`
d4dca585
CP
172 seutil_sigchld_newrole(bluetooth_t)
173')
174
bb7170f6 175optional_policy(`
d4dca585
CP
176 udev_read_db(bluetooth_t)
177')
178
8708d9be
CP
179optional_policy(`
180 ppp_domtrans(bluetooth_t)
181')
296273a7
CP
182
183########################################
184#
185# Bluetooth helper programs local policy
186#
187
188allow bluetooth_helper_t self:capability sys_nice;
189allow bluetooth_helper_t self:process getsched;
190allow bluetooth_helper_t self:fifo_file rw_fifo_file_perms;
191allow bluetooth_helper_t self:shm create_shm_perms;
192allow bluetooth_helper_t self:unix_stream_socket { create_stream_socket_perms connectto };
193allow bluetooth_helper_t self:tcp_socket create_socket_perms;
194allow bluetooth_helper_t self:netlink_route_socket r_netlink_socket_perms;
195
196allow bluetooth_helper_t bluetooth_t:socket { read write };
197
198manage_dirs_pattern(bluetooth_helper_t, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
199manage_files_pattern(bluetooth_helper_t, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
200manage_sock_files_pattern(bluetooth_helper_t, bluetooth_helper_tmp_t, bluetooth_helper_tmp_t)
201files_tmp_filetrans(bluetooth_helper_t, bluetooth_helper_tmp_t, { file dir sock_file })
202
203manage_dirs_pattern(bluetooth_helper_t, bluetooth_helper_tmpfs_t, bluetooth_helper_tmpfs_t)
204manage_files_pattern(bluetooth_helper_t, bluetooth_helper_tmpfs_t, bluetooth_helper_tmpfs_t)
205fs_tmpfs_filetrans(bluetooth_helper_t, bluetooth_helper_tmpfs_t, { dir file })
206
207kernel_read_system_state(bluetooth_helper_t)
208kernel_read_kernel_sysctls(bluetooth_helper_t)
209
210dev_read_urand(bluetooth_helper_t)
211
c3c753f7 212term_dontaudit_use_all_ttys(bluetooth_helper_t)
296273a7
CP
213
214corecmd_exec_bin(bluetooth_helper_t)
215corecmd_exec_shell(bluetooth_helper_t)
216
217domain_read_all_domains_state(bluetooth_helper_t)
218
219files_read_etc_files(bluetooth_helper_t)
220files_read_etc_runtime_files(bluetooth_helper_t)
221files_read_usr_files(bluetooth_helper_t)
222files_dontaudit_list_default(bluetooth_helper_t)
223
224locallogin_dontaudit_use_fds(bluetooth_helper_t)
225
226logging_send_syslog_msg(bluetooth_helper_t)
227
c5155ac0 228miscfiles_read_localization(bluetooth_helper_t)
296273a7
CP
229
230sysnet_read_config(bluetooth_helper_t)
231
232optional_policy(`
233 bluetooth_dbus_chat(bluetooth_helper_t)
234
235 dbus_system_bus_client(bluetooth_helper_t)
236 dbus_connect_system_bus(bluetooth_helper_t)
237')
238
239optional_policy(`
240 nscd_socket_use(bluetooth_helper_t)
241')
242
243optional_policy(`
244 xserver_user_x_domain_template(bluetooth_helper, bluetooth_helper_t, bluetooth_helper_tmpfs_t)
245')