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