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