2 ## Copyright (c) 2008-2010 Robert N. M. Watson
3 ## All rights reserved.
5 ## This software was developed at the University of Cambridge Computer
6 ## Laboratory with support from a grant from Google, Inc.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted provided that the following conditions
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.
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
29 ## List of system calls enabled in capability mode, one name per line.
32 ## - sys_exit(2), abort2(2) and close(2) are very important.
33 ## - Sorted alphabetically, please keep it that way.
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).
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.
63 ## Allow umtx operations as these are scoped by address space.
65 ## XXRW: Need to check this very carefully.
70 ## Allow process termination using abort2(2).
75 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
76 ## relies on existing bindings on a socket, subject to capability rights.
82 ## Allow AIO operations by file descriptor, subject to capability rights.
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.
107 ## Allow capability mode and capability system calls.
119 ## Allow read-only clock operations.
125 ## Always allow file descriptor close(2).
131 ## Allow connectat(2).
136 ## copy_file_range(2) reads from one descriptor and writes to the other.
141 ## cpuset(2) and related calls are limited to caller's own process/thread.
150 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
156 ## Allow extended attribute operations by file descriptor, subject to
157 ## capability rights.
165 ## Allow changing file flags, mode, and owner by file descriptor, subject to
166 ## capability rights.
173 ## For now, allow fcntl(2), subject to capability rights, but this probably
174 ## needs additional scoping.
179 ## Allow fexecve(2), subject to capability rights. We perform some scoping,
180 ## such as disallowing privilege escalation.
185 ## Allow flock(2), subject to capability rights.
190 ## Allow fork(2), even though it returns pids -- some applications seem to
191 ## prefer this interface.
196 ## Allow fpathconf(2), subject to capability rights.
201 ## Allow various file descriptor-based I/O operations, subject to capability
206 freebsd11_getdirentries
216 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
217 ## subject to capability rights.
223 ## Allow further file descriptor-based I/O operations, subject to capability
230 ## Allow futimens(2) and futimes(2), subject to capability rights.
236 ## Allow querying process audit state, subject to normal access control.
243 ## Allow thread context management with getcontext(2).
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.
257 ## Allow querying certain trivial global state.
262 ## Allow querying certain per-process resource limit state.
267 ## Allow querying current process credential state.
273 ## Allow querying certain trivial global state.
279 ## Allow querying per-process timer.
284 ## Allow querying current process credential state.
291 ## Allow querying certain trivial global state.
297 ## Allow querying certain per-process scheduling, resource limit, and
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.
321 ## Allow querying socket state, subject to capability rights.
323 ## XXXRW: getsockopt(2) may need more attention.
329 ## Allow querying the global clock.
334 ## Allow querying current process credential state.
339 ## Allow ioctl(2), which hopefully will be limited by applications only to
340 ## required commands with cap_ioctls_limit(2) syscall.
345 ## Allow querying current process credential state.
350 ## Allow kevent(2), as we will authorize based on capability rights on the
351 ## target descriptor.
356 ## Allow kill(2), as we allow the process to send signals only to himself.
361 ## Allow message queue operations on file descriptors, subject to capability
363 ## NOTE: Corresponding sysents are initialized in sys/kern/uipc_mqueue.c with
372 ## Allow kqueue(2), we will control use.
377 ## Allow managing per-process timers.
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.
392 ## Allow AIO operations by file descriptor, subject to capability rights.
397 ## Allow listen(2), subject to capability rights.
399 ## XXXRW: One might argue this manipulates a global namespace.
404 ## Allow I/O-related file descriptors, subject to capability rights.
409 ## Allow simple VM operations on the current process.
418 ## Allow memory mapping a file descriptor, and updating protections, subject
419 ## to capability rights.
425 ## Allow simple VM operations on the current process.
433 ## Allow the current process to sleep.
438 ## Allow querying the global clock.
443 ## Allow AIO operations by file descriptor, subject to capability rights.
449 ## Allow simple VM operations on the current process.
454 ## Allow AIO operations by file descriptor, subject to capability rights.
459 ## Operations relative to directory capabilities.
480 ## Process descriptor-related system calls are allowed.
485 #pdwait4 # not yet implemented
494 ## Allow poll(2), which will be scoped by capability rights.
500 ## Allow I/O-related file descriptors, subject to capability rights.
507 ## Allow access to profiling state on the current process.
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
519 ## Allow I/O-related file descriptors, subject to capability rights.
530 ## Allow real-time scheduling primitives to be used.
532 ## XXXRW: These require scoping.
538 ## Allow simple VM operations on the current process.
543 ## Allow querying trivial global scheduler state.
545 sched_get_priority_max
546 sched_get_priority_min
549 ## Allow various thread/process scheduler operations.
551 ## XXXRW: Some of these require further scoping.
555 sched_rr_get_interval
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.
567 sctp_generic_sendmsg_iov
571 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
579 ## Allow I/O-related file descriptors, subject to capability rights. Use of
580 ## explicit addresses here is restricted by the system calls themselves.
588 ## Allow setting per-process audit state, which is controlled separately by
596 ## Allow setting thread context.
601 ## Allow setting current process credential state, which is controlled
602 ## separately by privilege.
609 ## Allow use of the process interval timer.
614 ## Allow setpriority(2).
616 ## XXXRW: Requires scoping.
621 ## Allow setting current process credential state, which is controlled
622 ## separately by privilege.
630 ## Allow setting process resource limits with setrlimit(2).
635 ## Allow creating a new session with setsid(2).
640 ## Allow setting socket options with setsockopt(2), subject to capability
643 ## XXXRW: Might require scoping.
648 ## Allow setting current process credential state, which is controlled
649 ## separately by privilege.
654 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
659 ## Allow I/O-related file descriptors, subject to capability rights.
664 ## Allow signal control on current process.
682 ## Allow creating new socket pairs with socket(2) and socketpair(2).
688 ## Allow simple VM operations on the current process.
690 ## XXXRW: Kernel doesn't implement this, so drop?
695 ## Do allow sync(2) for now, but possibly shouldn't.
700 ## Always allow process termination with sys_exit(2).
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
712 ## Allow thread operations operating only on current process.
719 ## Disallow thr_kill2(2), as it may operate beyond the current process.
721 ## XXXRW: Requires scoping.
726 ## Allow thread operations operating only on current process.
735 ## Allow manipulation of the current process umask with umask(2).
740 ## Allow submitting of process trace entries with utrace(2).
745 ## Allow generating UUIDs with uuidgen(2).
750 ## Allow I/O-related file descriptors, subject to capability rights.
756 ## Allow processes to yield(2).