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