Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | # |
2 | # Define common prefixes for access vectors | ||||
3 | # | ||||
4 | # common common_name { permission_name ... } | ||||
5 | |||||
6 | |||||
7 | # | ||||
8 | # Define a common prefix for file access vectors. | ||||
9 | # | ||||
10 | |||||
11 | common file | ||||
12 | { | ||||
13 | ioctl | ||||
14 | read | ||||
15 | write | ||||
16 | create | ||||
17 | getattr | ||||
18 | setattr | ||||
19 | lock | ||||
20 | relabelfrom | ||||
21 | relabelto | ||||
22 | append | ||||
23 | unlink | ||||
24 | link | ||||
25 | rename | ||||
26 | execute | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 27 | quotaon |
28 | mounton | ||||
29 | } | ||||
30 | |||||
31 | |||||
32 | # | ||||
33 | # Define a common prefix for socket access vectors. | ||||
34 | # | ||||
35 | |||||
36 | common socket | ||||
37 | { | ||||
38 | # inherited from file | ||||
39 | ioctl | ||||
40 | read | ||||
41 | write | ||||
42 | create | ||||
43 | getattr | ||||
44 | setattr | ||||
45 | lock | ||||
46 | relabelfrom | ||||
47 | relabelto | ||||
48 | append | ||||
49 | # socket-specific | ||||
50 | bind | ||||
51 | connect | ||||
52 | listen | ||||
53 | accept | ||||
54 | getopt | ||||
55 | setopt | ||||
56 | shutdown | ||||
57 | recvfrom | ||||
58 | sendto | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 59 | name_bind |
60 | } | ||||
61 | |||||
62 | # | ||||
63 | # Define a common prefix for ipc access vectors. | ||||
64 | # | ||||
65 | |||||
66 | common ipc | ||||
67 | { | ||||
68 | create | ||||
69 | destroy | ||||
70 | getattr | ||||
71 | setattr | ||||
72 | read | ||||
73 | write | ||||
74 | associate | ||||
75 | unix_read | ||||
76 | unix_write | ||||
77 | } | ||||
78 | |||||
79 | # | ||||
Stephen Smalley | 8a00360 | 2016-04-27 09:42:57 -0400 | [diff] [blame^] | 80 | # Define a common for capability access vectors. |
81 | # | ||||
82 | common cap | ||||
83 | { | ||||
84 | # The capabilities are defined in include/linux/capability.h | ||||
85 | # Capabilities >= 32 are defined in the cap2 common. | ||||
86 | # Care should be taken to ensure that these are consistent with | ||||
87 | # those definitions. (Order matters) | ||||
88 | |||||
89 | chown | ||||
90 | dac_override | ||||
91 | dac_read_search | ||||
92 | fowner | ||||
93 | fsetid | ||||
94 | kill | ||||
95 | setgid | ||||
96 | setuid | ||||
97 | setpcap | ||||
98 | linux_immutable | ||||
99 | net_bind_service | ||||
100 | net_broadcast | ||||
101 | net_admin | ||||
102 | net_raw | ||||
103 | ipc_lock | ||||
104 | ipc_owner | ||||
105 | sys_module | ||||
106 | sys_rawio | ||||
107 | sys_chroot | ||||
108 | sys_ptrace | ||||
109 | sys_pacct | ||||
110 | sys_admin | ||||
111 | sys_boot | ||||
112 | sys_nice | ||||
113 | sys_resource | ||||
114 | sys_time | ||||
115 | sys_tty_config | ||||
116 | mknod | ||||
117 | lease | ||||
118 | audit_write | ||||
119 | audit_control | ||||
120 | setfcap | ||||
121 | } | ||||
122 | |||||
123 | common cap2 | ||||
124 | { | ||||
125 | mac_override # unused by SELinux | ||||
126 | mac_admin # unused by SELinux | ||||
127 | syslog | ||||
128 | wake_alarm | ||||
129 | block_suspend | ||||
130 | audit_read | ||||
131 | } | ||||
132 | |||||
133 | # | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 134 | # Define the access vectors. |
135 | # | ||||
136 | # class class_name [ inherits common_name ] { permission_name ... } | ||||
137 | |||||
138 | |||||
139 | # | ||||
140 | # Define the access vector interpretation for file-related objects. | ||||
141 | # | ||||
142 | |||||
143 | class filesystem | ||||
144 | { | ||||
145 | mount | ||||
146 | remount | ||||
147 | unmount | ||||
148 | getattr | ||||
149 | relabelfrom | ||||
150 | relabelto | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 151 | associate |
152 | quotamod | ||||
153 | quotaget | ||||
154 | } | ||||
155 | |||||
156 | class dir | ||||
157 | inherits file | ||||
158 | { | ||||
159 | add_name | ||||
160 | remove_name | ||||
161 | reparent | ||||
162 | search | ||||
163 | rmdir | ||||
164 | open | ||||
165 | audit_access | ||||
166 | execmod | ||||
167 | } | ||||
168 | |||||
169 | class file | ||||
170 | inherits file | ||||
171 | { | ||||
172 | execute_no_trans | ||||
173 | entrypoint | ||||
174 | execmod | ||||
175 | open | ||||
176 | audit_access | ||||
177 | } | ||||
178 | |||||
179 | class lnk_file | ||||
180 | inherits file | ||||
181 | { | ||||
182 | open | ||||
183 | audit_access | ||||
184 | execmod | ||||
185 | } | ||||
186 | |||||
187 | class chr_file | ||||
188 | inherits file | ||||
189 | { | ||||
190 | execute_no_trans | ||||
191 | entrypoint | ||||
192 | execmod | ||||
193 | open | ||||
194 | audit_access | ||||
195 | } | ||||
196 | |||||
197 | class blk_file | ||||
198 | inherits file | ||||
199 | { | ||||
200 | open | ||||
201 | audit_access | ||||
202 | execmod | ||||
203 | } | ||||
204 | |||||
205 | class sock_file | ||||
206 | inherits file | ||||
207 | { | ||||
208 | open | ||||
209 | audit_access | ||||
210 | execmod | ||||
211 | } | ||||
212 | |||||
213 | class fifo_file | ||||
214 | inherits file | ||||
215 | { | ||||
216 | open | ||||
217 | audit_access | ||||
218 | execmod | ||||
219 | } | ||||
220 | |||||
221 | class fd | ||||
222 | { | ||||
223 | use | ||||
224 | } | ||||
225 | |||||
226 | |||||
227 | # | ||||
228 | # Define the access vector interpretation for network-related objects. | ||||
229 | # | ||||
230 | |||||
231 | class socket | ||||
232 | inherits socket | ||||
233 | |||||
234 | class tcp_socket | ||||
235 | inherits socket | ||||
236 | { | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 237 | node_bind |
238 | name_connect | ||||
239 | } | ||||
240 | |||||
241 | class udp_socket | ||||
242 | inherits socket | ||||
243 | { | ||||
244 | node_bind | ||||
245 | } | ||||
246 | |||||
247 | class rawip_socket | ||||
248 | inherits socket | ||||
249 | { | ||||
250 | node_bind | ||||
251 | } | ||||
252 | |||||
253 | class node | ||||
254 | { | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 255 | recvfrom |
256 | sendto | ||||
257 | } | ||||
258 | |||||
259 | class netif | ||||
260 | { | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 261 | ingress |
262 | egress | ||||
263 | } | ||||
264 | |||||
265 | class netlink_socket | ||||
266 | inherits socket | ||||
267 | |||||
268 | class packet_socket | ||||
269 | inherits socket | ||||
270 | |||||
271 | class key_socket | ||||
272 | inherits socket | ||||
273 | |||||
274 | class unix_stream_socket | ||||
275 | inherits socket | ||||
276 | { | ||||
277 | connectto | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 278 | } |
279 | |||||
280 | class unix_dgram_socket | ||||
281 | inherits socket | ||||
282 | |||||
283 | # | ||||
284 | # Define the access vector interpretation for process-related objects | ||||
285 | # | ||||
286 | |||||
287 | class process | ||||
288 | { | ||||
289 | fork | ||||
290 | transition | ||||
291 | sigchld # commonly granted from child to parent | ||||
292 | sigkill # cannot be caught or ignored | ||||
293 | sigstop # cannot be caught or ignored | ||||
294 | signull # for kill(pid, 0) | ||||
295 | signal # all other signals | ||||
296 | ptrace | ||||
297 | getsched | ||||
298 | setsched | ||||
299 | getsession | ||||
300 | getpgid | ||||
301 | setpgid | ||||
302 | getcap | ||||
303 | setcap | ||||
304 | share | ||||
305 | getattr | ||||
306 | setexec | ||||
307 | setfscreate | ||||
308 | noatsecure | ||||
309 | siginh | ||||
310 | setrlimit | ||||
311 | rlimitinh | ||||
312 | dyntransition | ||||
313 | setcurrent | ||||
314 | execmem | ||||
315 | execstack | ||||
316 | execheap | ||||
317 | setkeycreate | ||||
318 | setsockcreate | ||||
319 | } | ||||
320 | |||||
321 | |||||
322 | # | ||||
323 | # Define the access vector interpretation for ipc-related objects | ||||
324 | # | ||||
325 | |||||
326 | class ipc | ||||
327 | inherits ipc | ||||
328 | |||||
329 | class sem | ||||
330 | inherits ipc | ||||
331 | |||||
332 | class msgq | ||||
333 | inherits ipc | ||||
334 | { | ||||
335 | enqueue | ||||
336 | } | ||||
337 | |||||
338 | class msg | ||||
339 | { | ||||
340 | send | ||||
341 | receive | ||||
342 | } | ||||
343 | |||||
344 | class shm | ||||
345 | inherits ipc | ||||
346 | { | ||||
347 | lock | ||||
348 | } | ||||
349 | |||||
350 | |||||
351 | # | ||||
352 | # Define the access vector interpretation for the security server. | ||||
353 | # | ||||
354 | |||||
355 | class security | ||||
356 | { | ||||
357 | compute_av | ||||
358 | compute_create | ||||
359 | compute_member | ||||
360 | check_context | ||||
361 | load_policy | ||||
362 | compute_relabel | ||||
363 | compute_user | ||||
364 | setenforce # was avc_toggle in system class | ||||
365 | setbool | ||||
366 | setsecparam | ||||
367 | setcheckreqprot | ||||
368 | read_policy | ||||
369 | } | ||||
370 | |||||
371 | |||||
372 | # | ||||
373 | # Define the access vector interpretation for system operations. | ||||
374 | # | ||||
375 | |||||
376 | class system | ||||
377 | { | ||||
378 | ipc_info | ||||
379 | syslog_read | ||||
380 | syslog_mod | ||||
381 | syslog_console | ||||
382 | module_request | ||||
Jeff Vander Stoep | a16b058 | 2016-04-07 11:06:05 -0700 | [diff] [blame] | 383 | module_load |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 384 | } |
385 | |||||
386 | # | ||||
Stephen Smalley | 8a00360 | 2016-04-27 09:42:57 -0400 | [diff] [blame^] | 387 | # Define the access vector interpretation for controlling capabilities |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 388 | # |
389 | |||||
390 | class capability | ||||
Stephen Smalley | 8a00360 | 2016-04-27 09:42:57 -0400 | [diff] [blame^] | 391 | inherits cap |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 392 | |
393 | class capability2 | ||||
Stephen Smalley | 8a00360 | 2016-04-27 09:42:57 -0400 | [diff] [blame^] | 394 | inherits cap2 |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 395 | |
396 | # | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 397 | # Extended Netlink classes |
398 | # | ||||
399 | class netlink_route_socket | ||||
400 | inherits socket | ||||
401 | { | ||||
402 | nlmsg_read | ||||
403 | nlmsg_write | ||||
404 | } | ||||
405 | |||||
406 | class netlink_firewall_socket | ||||
407 | inherits socket | ||||
408 | { | ||||
409 | nlmsg_read | ||||
410 | nlmsg_write | ||||
411 | } | ||||
412 | |||||
413 | class netlink_tcpdiag_socket | ||||
414 | inherits socket | ||||
415 | { | ||||
416 | nlmsg_read | ||||
417 | nlmsg_write | ||||
418 | } | ||||
419 | |||||
420 | class netlink_nflog_socket | ||||
421 | inherits socket | ||||
422 | |||||
423 | class netlink_xfrm_socket | ||||
424 | inherits socket | ||||
425 | { | ||||
426 | nlmsg_read | ||||
427 | nlmsg_write | ||||
428 | } | ||||
429 | |||||
430 | class netlink_selinux_socket | ||||
431 | inherits socket | ||||
432 | |||||
433 | class netlink_audit_socket | ||||
434 | inherits socket | ||||
435 | { | ||||
436 | nlmsg_read | ||||
437 | nlmsg_write | ||||
438 | nlmsg_relay | ||||
439 | nlmsg_readpriv | ||||
440 | nlmsg_tty_audit | ||||
441 | } | ||||
442 | |||||
443 | class netlink_ip6fw_socket | ||||
444 | inherits socket | ||||
445 | { | ||||
446 | nlmsg_read | ||||
447 | nlmsg_write | ||||
448 | } | ||||
449 | |||||
450 | class netlink_dnrt_socket | ||||
451 | inherits socket | ||||
452 | |||||
453 | # Define the access vector interpretation for controlling | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 454 | # access to IPSec network data by association |
455 | # | ||||
456 | class association | ||||
457 | { | ||||
458 | sendto | ||||
459 | recvfrom | ||||
460 | setcontext | ||||
461 | polmatch | ||||
462 | } | ||||
463 | |||||
464 | # Updated Netlink class for KOBJECT_UEVENT family. | ||||
465 | class netlink_kobject_uevent_socket | ||||
466 | inherits socket | ||||
467 | |||||
468 | class appletalk_socket | ||||
469 | inherits socket | ||||
470 | |||||
471 | class packet | ||||
472 | { | ||||
473 | send | ||||
474 | recv | ||||
475 | relabelto | ||||
476 | flow_in # deprecated | ||||
477 | flow_out # deprecated | ||||
478 | forward_in | ||||
479 | forward_out | ||||
480 | } | ||||
481 | |||||
482 | class key | ||||
483 | { | ||||
484 | view | ||||
485 | read | ||||
486 | write | ||||
487 | search | ||||
488 | link | ||||
489 | setattr | ||||
490 | create | ||||
491 | } | ||||
492 | |||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 493 | class dccp_socket |
494 | inherits socket | ||||
495 | { | ||||
496 | node_bind | ||||
497 | name_connect | ||||
498 | } | ||||
499 | |||||
500 | class memprotect | ||||
501 | { | ||||
502 | mmap_zero | ||||
503 | } | ||||
504 | |||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 505 | # network peer labels |
506 | class peer | ||||
507 | { | ||||
508 | recv | ||||
509 | } | ||||
510 | |||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 511 | class kernel_service |
512 | { | ||||
513 | use_as_override | ||||
514 | create_files_as | ||||
515 | } | ||||
516 | |||||
517 | class tun_socket | ||||
518 | inherits socket | ||||
Nick Kralevich | d7af45d | 2014-06-06 16:51:11 -0700 | [diff] [blame] | 519 | { |
520 | attach_queue | ||||
521 | } | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 522 | |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 523 | class binder |
524 | { | ||||
525 | impersonate | ||||
526 | call | ||||
527 | set_context_mgr | ||||
528 | transfer | ||||
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 529 | } |
530 | |||||
Stephen Smalley | 01d95c2 | 2015-05-21 16:17:26 -0400 | [diff] [blame] | 531 | class netlink_iscsi_socket |
532 | inherits socket | ||||
533 | |||||
534 | class netlink_fib_lookup_socket | ||||
535 | inherits socket | ||||
536 | |||||
537 | class netlink_connector_socket | ||||
538 | inherits socket | ||||
539 | |||||
540 | class netlink_netfilter_socket | ||||
541 | inherits socket | ||||
542 | |||||
543 | class netlink_generic_socket | ||||
544 | inherits socket | ||||
545 | |||||
546 | class netlink_scsitransport_socket | ||||
547 | inherits socket | ||||
548 | |||||
549 | class netlink_rdma_socket | ||||
550 | inherits socket | ||||
551 | |||||
552 | class netlink_crypto_socket | ||||
553 | inherits socket | ||||
554 | |||||
Stephen Smalley | 8a00360 | 2016-04-27 09:42:57 -0400 | [diff] [blame^] | 555 | # |
556 | # Define the access vector interpretation for controlling capabilities | ||||
557 | # in user namespaces | ||||
558 | # | ||||
559 | |||||
560 | class cap_userns | ||||
561 | inherits cap | ||||
562 | |||||
563 | class cap2_userns | ||||
564 | inherits cap2 | ||||
565 | |||||
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 566 | class property_service |
567 | { | ||||
568 | set | ||||
569 | } | ||||
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 570 | |
571 | class service_manager | ||||
572 | { | ||||
573 | add | ||||
Riley Spahn | b8511e0 | 2014-07-07 13:56:27 -0700 | [diff] [blame] | 574 | find |
575 | list | ||||
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 576 | } |
Riley Spahn | 1196d2a | 2014-06-17 14:58:52 -0700 | [diff] [blame] | 577 | |
578 | class keystore_key | ||||
579 | { | ||||
Chad Brubaker | cbc8f79 | 2015-05-13 14:39:48 -0700 | [diff] [blame] | 580 | get_state |
Riley Spahn | 1196d2a | 2014-06-17 14:58:52 -0700 | [diff] [blame] | 581 | get |
582 | insert | ||||
583 | delete | ||||
584 | exist | ||||
Chad Brubaker | cbc8f79 | 2015-05-13 14:39:48 -0700 | [diff] [blame] | 585 | list |
Riley Spahn | 1196d2a | 2014-06-17 14:58:52 -0700 | [diff] [blame] | 586 | reset |
587 | password | ||||
588 | lock | ||||
589 | unlock | ||||
Chad Brubaker | cbc8f79 | 2015-05-13 14:39:48 -0700 | [diff] [blame] | 590 | is_empty |
Riley Spahn | 1196d2a | 2014-06-17 14:58:52 -0700 | [diff] [blame] | 591 | sign |
592 | verify | ||||
593 | grant | ||||
594 | duplicate | ||||
595 | clear_uid | ||||
Chad Brubaker | 8927772 | 2015-03-31 13:03:06 -0700 | [diff] [blame] | 596 | add_auth |
Chad Brubaker | 520bb81 | 2015-05-12 12:33:40 -0700 | [diff] [blame] | 597 | user_changed |
Riley Spahn | 1196d2a | 2014-06-17 14:58:52 -0700 | [diff] [blame] | 598 | } |
Stephen Smalley | ba99249 | 2014-07-24 15:25:43 -0400 | [diff] [blame] | 599 | |
Riley Spahn | 70f75ce | 2014-07-02 12:42:59 -0700 | [diff] [blame] | 600 | class drmservice { |
601 | consumeRights | ||||
602 | setPlaybackStatus | ||||
603 | openDecryptSession | ||||
604 | closeDecryptSession | ||||
605 | initializeDecryptUnit | ||||
606 | decrypt | ||||
607 | finalizeDecryptUnit | ||||
608 | pread | ||||
609 | } |