]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/capabilities.conf
Add liblutok a lightweight C++ API for lua.
[FreeBSD/FreeBSD.git] / sys / kern / capabilities.conf
1 ##
2 ## Copyright (c) 2008-2010 Robert N. M. Watson
3 ## All rights reserved.
4 ##
5 ## This software was developed at the University of Cambridge Computer
6 ## Laboratory with support from a grant from Google, Inc.
7 ##
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted provided that the following conditions
10 ## are met:
11 ## 1. Redistributions of source code must retain the above copyright
12 ##    notice, this list of conditions and the following disclaimer.
13 ## 2. Redistributions in binary form must reproduce the above copyright
14 ##    notice, this list of conditions and the following disclaimer in the
15 ##    documentation and/or other materials provided with the distribution.
16 ##
17 ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ## ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 ## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 ## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 ## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 ## SUCH DAMAGE.
28 ##
29 ## List of system calls enabled in capability mode, one name per line.
30 ##
31 ## Notes:
32 ## - sys_exit(2), abort2(2) and close(2) are very important.
33 ## - Sorted alphabetically, please keep it that way.
34 ##
35 ## $FreeBSD$
36 ##
37
38 ##
39 ## Allow ACL and MAC label operations by file descriptor, subject to
40 ## capability rights.  Allow MAC label operations on the current process but
41 ## we will need to scope __mac_get_pid(2).
42 ##
43 __acl_aclcheck_fd
44 __acl_delete_fd
45 __acl_get_fd
46 __acl_set_fd
47 __mac_get_fd
48 #__mac_get_pid
49 __mac_get_proc
50 __mac_set_fd
51 __mac_set_proc
52
53 ##
54 ## Allow sysctl(2) as we scope internal to the call; this is a global
55 ## namespace, but there are several critical sysctls required for almost
56 ## anything to run, such as hw.pagesize.  For now that policy lives in the
57 ## kernel for performance and simplicity, but perhaps it could move to a
58 ## proxying daemon in userspace.
59 ##
60 __sysctl
61 __sysctlbyname
62
63 ##
64 ## Allow umtx operations as these are scoped by address space.
65 ##
66 ## XXRW: Need to check this very carefully.
67 ##
68 _umtx_op
69
70 ##
71 ## Allow process termination using abort2(2).
72 ##
73 abort2
74
75 ##
76 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
77 ## relies on existing bindings on a socket, subject to capability rights.
78 ##
79 accept
80 accept4
81
82 ##
83 ## Allow AIO operations by file descriptor, subject to capability rights.
84 ##
85 aio_cancel
86 aio_error
87 aio_fsync
88 aio_read
89 aio_return
90 aio_suspend
91 aio_waitcomplete
92 aio_write
93
94 ##
95 ## audit(2) is a global operation, submitting to the global trail, but it is
96 ## controlled by privilege, and it might be useful to be able to submit
97 ## records from sandboxes.  For now, disallow, but we may want to think about
98 ## providing some sort of proxy service for this.
99 ##
100 #audit
101
102 ##
103 ## Allow bindat(2).
104 ##
105 bindat
106
107 ##
108 ## Allow capability mode and capability system calls.
109 ##
110 cap_enter
111 cap_fcntls_get
112 cap_fcntls_limit
113 cap_getmode
114 cap_ioctls_get
115 cap_ioctls_limit
116 __cap_rights_get
117 cap_rights_limit
118
119 ##
120 ## Allow read-only clock operations.
121 ##
122 clock_getres
123 clock_gettime
124
125 ##
126 ## Always allow file descriptor close(2).
127 ##
128 close
129 closefrom
130
131 ##
132 ## Allow connectat(2).
133 ##
134 connectat
135
136 ##
137 ## copy_file_range(2) reads from one descriptor and writes to the other.
138 ##
139 copy_file_range
140
141 ##
142 ## cpuset(2) and related calls are limited to caller's own process/thread.
143 ##
144 #cpuset
145 cpuset_getaffinity
146 #cpuset_getid
147 cpuset_setaffinity
148 #cpuset_setid
149
150 ##
151 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
152 ##
153 dup
154 dup2
155
156 ##
157 ## Allow extended attribute operations by file descriptor, subject to
158 ## capability rights.
159 ##
160 extattr_delete_fd
161 extattr_get_fd
162 extattr_list_fd
163 extattr_set_fd
164
165 ##
166 ## Allow changing file flags, mode, and owner by file descriptor, subject to
167 ## capability rights.
168 ##
169 fchflags
170 fchmod
171 fchown
172
173 ##
174 ## For now, allow fcntl(2), subject to capability rights, but this probably
175 ## needs additional scoping.
176 ##
177 fcntl
178
179 ##
180 ## Allow fexecve(2), subject to capability rights.  We perform some scoping,
181 ## such as disallowing privilege escalation.
182 ##
183 fexecve
184
185 ##
186 ## Allow flock(2), subject to capability rights.
187 ##
188 flock
189
190 ##
191 ## Allow fork(2), even though it returns pids -- some applications seem to
192 ## prefer this interface.
193 ##
194 fork
195
196 ##
197 ## Allow fpathconf(2), subject to capability rights.
198 ##
199 fpathconf
200
201 ##
202 ## Allow various file descriptor-based I/O operations, subject to capability
203 ## rights.
204 ##
205 freebsd11_fstat
206 freebsd11_fstatat
207 freebsd11_getdirentries
208 freebsd11_fstatfs
209 freebsd11_mknodat
210 freebsd6_ftruncate
211 freebsd6_lseek
212 freebsd6_mmap
213 freebsd6_pread
214 freebsd6_pwrite
215
216 ##
217 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
218 ## subject to capability rights.
219 ##
220 fstat
221 fstatfs
222
223 ##
224 ## Allow further file descriptor-based I/O operations, subject to capability
225 ## rights.
226 ##
227 fdatasync
228 fsync
229 ftruncate
230
231 ##
232 ## Allow futimens(2) and futimes(2), subject to capability rights.
233 ##
234 futimens
235 futimes
236
237 ##
238 ## Allow querying process audit state, subject to normal access control.
239 ##
240 getaudit
241 getaudit_addr
242 getauid
243
244 ##
245 ## Allow thread context management with getcontext(2).
246 ##
247 getcontext
248
249 ##
250 ## Allow directory I/O on a file descriptor, subject to capability rights.
251 ## Originally we had separate capabilities for directory-specific read
252 ## operations, but on BSD we allow reading the raw directory data, so we just
253 ## rely on CAP_READ now.
254 ##
255 getdents
256 getdirentries
257
258 ##
259 ## Allow querying certain trivial global state.
260 ##
261 getdomainname
262
263 ##
264 ## Allow querying certain per-process resource limit state.
265 ##
266 getdtablesize
267
268 ##
269 ## Allow querying current process credential state.
270 ##
271 getegid
272 geteuid
273
274 ##
275 ## Allow querying certain trivial global state.
276 ##
277 gethostid
278 gethostname
279
280 ##
281 ## Allow querying per-process timer.
282 ##
283 getitimer
284
285 ##
286 ## Allow querying current process credential state.
287 ##
288 getgid
289 getgroups
290 getlogin
291 getloginclass
292
293 ##
294 ## Allow querying certain trivial global state.
295 ##
296 getpagesize
297 getpeername
298
299 ##
300 ## Allow querying certain per-process scheduling, resource limit, and
301 ## credential state.
302 ##
303 ## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
304 ## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
305 ## getsid(2) needs scoping.
306 ##
307 getpgid
308 getpgrp
309 getpid
310 getppid
311 getpriority
312 getresgid
313 getresuid
314 getrlimit
315 getrusage
316 getsid
317
318 ##
319 ## Allow getrandom
320 ##
321 getrandom
322
323 ##
324 ## Allow querying socket state, subject to capability rights.
325 ##
326 ## XXXRW: getsockopt(2) may need more attention.
327 ##
328 getsockname
329 getsockopt
330
331 ##
332 ## Allow querying the global clock.
333 ##
334 gettimeofday
335
336 ##
337 ## Allow querying current process credential state.
338 ##
339 getuid
340
341 ##
342 ## Allow ioctl(2), which hopefully will be limited by applications only to
343 ## required commands with cap_ioctls_limit(2) syscall.
344 ##
345 ioctl
346
347 ##
348 ## Allow querying current process credential state.
349 ##
350 issetugid
351
352 ##
353 ## Allow kevent(2), as we will authorize based on capability rights on the
354 ## target descriptor.
355 ##
356 kevent
357
358 ##
359 ## Allow kill(2), as we allow the process to send signals only to himself.
360 ##
361 kill
362
363 ##
364 ## Allow message queue operations on file descriptors, subject to capability
365 ## rights.
366 ## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with
367 ## SYF_CAPENABLED.
368 ##
369 kmq_notify
370 kmq_setattr
371 kmq_timedreceive
372 kmq_timedsend
373
374 ##
375 ## Allow kqueue(2), we will control use.
376 ##
377 kqueue
378
379 ##
380 ## Allow managing per-process timers.
381 ##
382 ktimer_create
383 ktimer_delete
384 ktimer_getoverrun
385 ktimer_gettime
386 ktimer_settime
387
388 ##
389 ## We can't allow ktrace(2) because it relies on a global namespace, but we
390 ## might want to introduce an fktrace(2) of some sort.
391 ##
392 #ktrace
393
394 ##
395 ## Allow AIO operations by file descriptor, subject to capability rights.
396 ##
397 lio_listio
398
399 ##
400 ## Allow listen(2), subject to capability rights.
401 ##
402 ## XXXRW: One might argue this manipulates a global namespace.
403 ##
404 listen
405
406 ##
407 ## Allow I/O-related file descriptors, subject to capability rights.
408 ##
409 lseek
410
411 ##
412 ## Allow simple VM operations on the current process.
413 ##
414 madvise
415 mincore
416 minherit
417 mlock
418 mlockall
419
420 ##
421 ## Allow memory mapping a file descriptor, and updating protections, subject
422 ## to capability rights.
423 ##
424 mmap
425 mprotect
426
427 ##
428 ## Allow simple VM operations on the current process.
429 ##
430 msync
431 munlock
432 munlockall
433 munmap
434
435 ##
436 ## Allow the current process to sleep.
437 ##
438 nanosleep
439
440 ##
441 ## Allow querying the global clock.
442 ##
443 ntp_gettime
444
445 ##
446 ## Allow AIO operations by file descriptor, subject to capability rights.
447 ##
448 oaio_read
449 oaio_write
450
451 ##
452 ## Allow simple VM operations on the current process.
453 ##
454 break
455
456 ##
457 ## Allow AIO operations by file descriptor, subject to capability rights.
458 ##
459 olio_listio
460
461 ##
462 ## Operations relative to directory capabilities.
463 ##
464 chflagsat
465 faccessat
466 fchmodat
467 fchownat
468 fstatat
469 futimesat
470 linkat
471 mkdirat
472 mkfifoat
473 mknodat
474 openat
475 readlinkat
476 renameat
477 symlinkat
478 unlinkat
479 funlinkat
480 utimensat
481
482 ##
483 ## Process descriptor-related system calls are allowed.
484 ##
485 pdfork
486 pdgetpid
487 pdkill
488 #pdwait4        # not yet implemented
489
490 ##
491 ## Allow pipe(2).
492 ##
493 pipe
494 pipe2
495
496 ##
497 ## Allow poll(2), which will be scoped by capability rights.
498 ##
499 poll
500 ppoll
501
502 ##
503 ## Allow I/O-related file descriptors, subject to capability rights.
504 ##
505 posix_fallocate
506 pread
507 preadv
508
509 ##
510 ## Allow access to profiling state on the current process.
511 ##
512 profil
513
514 ##
515 ## Disallow ptrace(2) for now, but we do need debugging facilities in
516 ## capability mode, so we will want to revisit this, possibly by scoping its
517 ## operation.
518 ##
519 #ptrace
520
521 ##
522 ## Allow I/O-related file descriptors, subject to capability rights.
523 ##
524 pwrite
525 pwritev
526 read
527 readv
528 recv
529 recvfrom
530 recvmsg
531
532 ##
533 ## Allow real-time scheduling primitives to be used.
534 ##
535 ## XXXRW: These require scoping.
536 ##
537 rtprio
538 rtprio_thread
539
540 ##
541 ## Allow simple VM operations on the current process.
542 ##
543 sbrk
544
545 ##
546 ## Allow querying trivial global scheduler state.
547 ##
548 sched_get_priority_max
549 sched_get_priority_min
550
551 ##
552 ## Allow various thread/process scheduler operations.
553 ##
554 ## XXXRW: Some of these require further scoping.
555 ##
556 sched_getparam
557 sched_getscheduler
558 sched_rr_get_interval
559 sched_setparam
560 sched_setscheduler
561 sched_yield
562
563 ##
564 ## Allow I/O-related file descriptors, subject to capability rights.
565 ## NOTE: Corresponding sysents are initialized in sys/netinet/sctp_syscalls.c
566 ## with SYF_CAPENABLED.
567 ##
568 sctp_generic_recvmsg
569 sctp_generic_sendmsg
570 sctp_generic_sendmsg_iov
571 sctp_peeloff
572
573 ##
574 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
575 ##
576 ## XXXRW: But is it?
577 ##
578 pselect
579 select
580
581 ##
582 ## Allow I/O-related file descriptors, subject to capability rights.  Use of
583 ## explicit addresses here is restricted by the system calls themselves.
584 ##
585 send
586 sendfile
587 sendmsg
588 sendto
589
590 ##
591 ## Allow setting per-process audit state, which is controlled separately by
592 ## privileges.
593 ##
594 setaudit
595 setaudit_addr
596 setauid
597
598 ##
599 ## Allow setting thread context.
600 ##
601 setcontext
602
603 ##
604 ## Allow setting current process credential state, which is controlled
605 ## separately by privilege.
606 ##
607 setegid
608 seteuid
609 setgid
610
611 ##
612 ## Allow use of the process interval timer.
613 ##
614 setitimer
615
616 ##
617 ## Allow setpriority(2).
618 ##
619 ## XXXRW: Requires scoping.
620 ##
621 setpriority
622
623 ##
624 ## Allow setting current process credential state, which is controlled
625 ## separately by privilege.
626 ##
627 setregid
628 setresgid
629 setresuid
630 setreuid
631
632 ##
633 ## Allow setting process resource limits with setrlimit(2).
634 ##
635 setrlimit
636
637 ##
638 ## Allow creating a new session with setsid(2).
639 ##
640 setsid
641
642 ##
643 ## Allow setting socket options with setsockopt(2), subject to capability
644 ## rights.
645 ##
646 ## XXXRW: Might require scoping.
647 ##
648 setsockopt
649
650 ##
651 ## Allow setting current process credential state, which is controlled
652 ## separately by privilege.
653 ##
654 setuid
655
656 ##
657 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
658 ##
659 shm_open
660 shm_open2
661
662 ##
663 ## Allow I/O-related file descriptors, subject to capability rights.
664 ##
665 shutdown
666
667 ##
668 ## Allow signal control on current process.
669 ##
670 sigaction
671 sigaltstack
672 sigblock
673 sigfastblock
674 sigpending
675 sigprocmask
676 sigqueue
677 sigreturn
678 sigsetmask
679 sigstack
680 sigsuspend
681 sigtimedwait
682 sigvec
683 sigwaitinfo
684 sigwait
685
686 ##
687 ## Allow creating new socket pairs with socket(2) and socketpair(2).
688 ##
689 socket
690 socketpair
691
692 ##
693 ## Allow simple VM operations on the current process.
694 ##
695 ## XXXRW: Kernel doesn't implement this, so drop?
696 ##
697 sstk
698
699 ##
700 ## Do allow sync(2) for now, but possibly shouldn't.
701 ##
702 sync
703
704 ##
705 ## Always allow process termination with sys_exit(2).
706 ##
707 sys_exit
708
709 ##
710 ## sysarch(2) does rather diverse things, but is required on at least i386
711 ## in order to configure per-thread data.  As such, it's scoped on each
712 ## architecture.
713 ##
714 sysarch
715
716 ##
717 ## Allow thread operations operating only on current process.
718 ##
719 thr_create
720 thr_exit
721 thr_kill
722
723 ##
724 ## Disallow thr_kill2(2), as it may operate beyond the current process.
725 ##
726 ## XXXRW: Requires scoping.
727 ##
728 #thr_kill2
729
730 ##
731 ## Allow thread operations operating only on current process.
732 ##
733 thr_new
734 thr_self
735 thr_set_name
736 thr_suspend
737 thr_wake
738
739 ##
740 ## Allow manipulation of the current process umask with umask(2).
741 ##
742 umask
743
744 ##
745 ## Allow submitting of process trace entries with utrace(2).
746 ##
747 utrace
748
749 ##
750 ## Allow generating UUIDs with uuidgen(2).
751 ##
752 uuidgen
753
754 ##
755 ## Allow I/O-related file descriptors, subject to capability rights.
756 ##
757 write
758 writev
759
760 ##
761 ## Allow processes to yield(2).
762 ##
763 yield