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