]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/kern/capabilities.conf
Allow getdtablesize in capability mode
[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 getdtablesize
252
253 ##
254 ## Allow querying current process credential state.
255 ##
256 getegid
257 geteuid
258
259 ##
260 ## Allow querying certain trivial global state.
261 ##
262 gethostid
263 gethostname
264
265 ##
266 ## Allow querying per-process timer.
267 ##
268 getitimer
269
270 ##
271 ## Allow querying current process credential state.
272 ##
273 getgid
274 getgroups
275 getlogin
276
277 ##
278 ## Allow querying certain trivial global state.
279 ##
280 getpagesize
281 getpeername
282
283 ##
284 ## Allow querying certain per-process scheduling, resource limit, and
285 ## credential state.
286 ##
287 ## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
288 ## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
289 ## getsid(2) needs scoping.
290 ##
291 getpgid
292 getpgrp
293 getpid
294 getppid
295 getpriority
296 getresgid
297 getresuid
298 getrlimit
299 getrusage
300 getsid
301
302 ##
303 ## Allow querying socket state, subject to capability rights.
304 ##
305 ## XXXRW: getsockopt(2) may need more attention.
306 ##
307 getsockname
308 getsockopt
309
310 ##
311 ## Allow querying the global clock.
312 ##
313 gettimeofday
314
315 ##
316 ## Allow querying current process credential state.
317 ##
318 getuid
319
320 ##
321 ## Allow ioctl(2), which hopefully will be limited by applications only to
322 ## required commands with cap_ioctls_limit(2) syscall.
323 ##
324 ioctl
325
326 ##
327 ## Allow querying current process credential state.
328 ##
329 issetugid
330
331 ##
332 ## Allow kevent(2), as we will authorize based on capability rights on the
333 ## target descriptor.
334 ##
335 kevent
336
337 ##
338 ## Allow kill(2), as we allow the process to send signals only to himself.
339 ##
340 kill
341
342 ##
343 ## Allow message queue operations on file descriptors, subject to capability
344 ## rights.
345 ##
346 kmq_notify
347 kmq_setattr
348 kmq_timedreceive
349 kmq_timedsend
350
351 ##
352 ## Allow kqueue(2), we will control use.
353 ##
354 kqueue
355
356 ##
357 ## Allow managing per-process timers.
358 ##
359 ktimer_create
360 ktimer_delete
361 ktimer_getoverrun
362 ktimer_gettime
363 ktimer_settime
364
365 ##
366 ## We can't allow ktrace(2) because it relies on a global namespace, but we
367 ## might want to introduce an fktrace(2) of some sort.
368 ##
369 #ktrace
370
371 ##
372 ## Allow AIO operations by file descriptor, subject to capability rights.
373 ##
374 lio_listio
375
376 ##
377 ## Allow listen(2), subject to capability rights.
378 ##
379 ## XXXRW: One might argue this manipulates a global namespace.
380 ##
381 listen
382
383 ##
384 ## Allow I/O-related file descriptors, subject to capability rights.
385 ##
386 lseek
387
388 ##
389 ## Allow simple VM operations on the current process.
390 ##
391 madvise
392 mincore
393 minherit
394 mlock
395 mlockall
396
397 ##
398 ## Allow memory mapping a file descriptor, and updating protections, subject
399 ## to capability rights.
400 ##
401 mmap
402 mprotect
403
404 ##
405 ## Allow simple VM operations on the current process.
406 ##
407 msync
408 munlock
409 munlockall
410 munmap
411
412 ##
413 ## Allow the current process to sleep.
414 ##
415 nanosleep
416
417 ##
418 ## Allow querying the global clock.
419 ##
420 ntp_gettime
421
422 ##
423 ## Allow AIO operations by file descriptor, subject to capability rights.
424 ##
425 oaio_read
426 oaio_write
427
428 ##
429 ## Allow simple VM operations on the current process.
430 ##
431 obreak
432
433 ##
434 ## Allow AIO operations by file descriptor, subject to capability rights.
435 ##
436 olio_listio
437
438 ##
439 ## Operations relative to directory capabilities.
440 ##
441 chflagsat
442 faccessat
443 fchmodat
444 fchownat
445 fstatat
446 futimesat
447 linkat
448 mkdirat
449 mkfifoat
450 mknodat
451 openat
452 readlinkat
453 renameat
454 symlinkat
455 unlinkat
456 utimensat
457
458 ##
459 ## Allow entry into open(2). This system call will fail, since access to the
460 ## global file namespace has been disallowed, but allowing entry into the
461 ## syscall means that an audit trail will be generated (which is also very
462 ## useful for debugging).
463 ##
464 open
465
466 ##
467 ## Process descriptor-related system calls are allowed.
468 ##
469 pdfork
470 pdgetpid
471 pdkill
472 #pdwait4        # not yet implemented
473
474 ##
475 ## Allow pipe(2).
476 ##
477 pipe
478 pipe2
479
480 ##
481 ## Allow poll(2), which will be scoped by capability rights.
482 ## XXXRW: We don't yet do that scoping.
483 ##
484 poll
485
486 ##
487 ## Allow I/O-related file descriptors, subject to capability rights.
488 ##
489 pread
490 preadv
491
492 ##
493 ## Allow access to profiling state on the current process.
494 ##
495 profil
496
497 ##
498 ## Disallow ptrace(2) for now, but we do need debugging facilities in
499 ## capability mode, so we will want to revisit this, possibly by scoping its
500 ## operation.
501 ##
502 #ptrace
503
504 ##
505 ## Allow I/O-related file descriptors, subject to capability rights.
506 ##
507 pwrite
508 pwritev
509 read
510 readv
511 recv
512 recvfrom
513 recvmsg
514
515 ##
516 ## Allow real-time scheduling primitives to be used.
517 ##
518 ## XXXRW: These require scoping.
519 ##
520 rtprio
521 rtprio_thread
522
523 ##
524 ## Allow simple VM operations on the current process.
525 ##
526 sbrk
527
528 ##
529 ## Allow querying trivial global scheduler state.
530 ##
531 sched_get_priority_max
532 sched_get_priority_min
533
534 ##
535 ## Allow various thread/process scheduler operations.
536 ##
537 ## XXXRW: Some of these require further scoping.
538 ##
539 sched_getparam
540 sched_getscheduler
541 sched_rr_get_interval
542 sched_setparam
543 sched_setscheduler
544 sched_yield
545
546 ##
547 ## Allow I/O-related file descriptors, subject to capability rights.
548 ##
549 sctp_generic_recvmsg
550 sctp_generic_sendmsg
551 sctp_generic_sendmsg_iov
552 sctp_peeloff
553
554 ##
555 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
556 ##
557 ## XXXRW: But is it?
558 ##
559 pselect
560 select
561
562 ##
563 ## Allow I/O-related file descriptors, subject to capability rights.  Use of
564 ## explicit addresses here is restricted by the system calls themselves.
565 ##
566 send
567 sendfile
568 sendmsg
569 sendto
570
571 ##
572 ## Allow setting per-process audit state, which is controlled separately by
573 ## privileges.
574 ##
575 setaudit
576 setaudit_addr
577 setauid
578
579 ##
580 ## Allow setting thread context.
581 ##
582 setcontext
583
584 ##
585 ## Allow setting current process credential state, which is controlled
586 ## separately by privilege.
587 ##
588 setegid
589 seteuid
590 setgid
591
592 ##
593 ## Allow use of the process interval timer.
594 ##
595 setitimer
596
597 ##
598 ## Allow setpriority(2).
599 ##
600 ## XXXRW: Requires scoping.
601 ##
602 setpriority
603
604 ##
605 ## Allow setting current process credential state, which is controlled
606 ## separately by privilege.
607 ##
608 setregid
609 setresgid
610 setresuid
611 setreuid
612
613 ##
614 ## Allow setting process resource limits with setrlimit(2).
615 ##
616 setrlimit
617
618 ##
619 ## Allow creating a new session with setsid(2).
620 ##
621 setsid
622
623 ##
624 ## Allow setting socket options with setsockopt(2), subject to capability
625 ## rights.
626 ##
627 ## XXXRW: Might require scoping.
628 ##
629 setsockopt
630
631 ##
632 ## Allow setting current process credential state, which is controlled
633 ## separately by privilege.
634 ##
635 setuid
636
637 ##
638 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
639 ##
640 shm_open
641
642 ##
643 ## Allow I/O-related file descriptors, subject to capability rights.
644 ##
645 shutdown
646
647 ##
648 ## Allow signal control on current process.
649 ##
650 sigaction
651 sigaltstack
652 sigblock
653 sigpending
654 sigprocmask
655 sigqueue
656 sigreturn
657 sigsetmask
658 sigstack
659 sigsuspend
660 sigtimedwait
661 sigvec
662 sigwaitinfo
663 sigwait
664
665 ##
666 ## Allow creating new socket pairs with socket(2) and socketpair(2).
667 ##
668 socket
669 socketpair
670
671 ##
672 ## Allow simple VM operations on the current process.
673 ##
674 ## XXXRW: Kernel doesn't implement this, so drop?
675 ##
676 sstk
677
678 ##
679 ## Do allow sync(2) for now, but possibly shouldn't.
680 ##
681 sync
682
683 ##
684 ## Always allow process termination with sys_exit(2).
685 ##
686 sys_exit
687
688 ##
689 ## sysarch(2) does rather diverse things, but is required on at least i386
690 ## in order to configure per-thread data.  As such, it's scoped on each
691 ## architecture.
692 ##
693 sysarch
694
695 ##
696 ## Allow thread operations operating only on current process.
697 ##
698 thr_create
699 thr_exit
700 thr_kill
701
702 ##
703 ## Disallow thr_kill2(2), as it may operate beyond the current process.
704 ##
705 ## XXXRW: Requires scoping.
706 ##
707 #thr_kill2
708
709 ##
710 ## Allow thread operations operating only on current process.
711 ##
712 thr_new
713 thr_self
714 thr_set_name
715 thr_suspend
716 thr_wake
717
718 ##
719 ## Allow manipulation of the current process umask with umask(2).
720 ##
721 umask
722
723 ##
724 ## Allow submitting of process trace entries with utrace(2).
725 ##
726 utrace
727
728 ##
729 ## Allow generating UUIDs with uuidgen(2).
730 ##
731 uuidgen
732
733 ##
734 ## Allow I/O-related file descriptors, subject to capability rights.
735 ##
736 write
737 writev
738
739 ##
740 ## Allow processes to yield(2).
741 ##
742 yield