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