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.
72 ## Allow process termination using abort2(2).
77 ## Allow accept(2) since it doesn't manipulate namespaces directly, rather
78 ## relies on existing bindings on a socket, subject to capability rights.
84 ## Allow AIO operations by file descriptor, subject to capability rights.
96 ## audit(2) is a global operation, submitting to the global trail, but it is
97 ## controlled by privilege, and it might be useful to be able to submit
98 ## records from sandboxes. For now, disallow, but we may want to think about
99 ## providing some sort of proxy service for this.
109 ## Allow capability mode and capability system calls.
121 ## Allow read-only clock operations.
127 ## Always allow file descriptor close(2).
133 ## Allow connectat(2).
138 ## cpuset(2) and related calls require scoping by process, but should
139 ## eventually be allowed, at least in the current process case.
148 ## Always allow dup(2) and dup2(2) manipulation of the file descriptor table.
154 ## Allow extended attribute operations by file descriptor, subject to
155 ## capability rights.
163 ## Allow changing file flags, mode, and owner by file descriptor, subject to
164 ## capability rights.
171 ## For now, allow fcntl(2), subject to capability rights, but this probably
172 ## needs additional scoping.
177 ## Allow fexecve(2), subject to capability rights. We perform some scoping,
178 ## such as disallowing privilege escalation.
183 ## Allow flock(2), subject to capability rights.
188 ## Allow fork(2), even though it returns pids -- some applications seem to
189 ## prefer this interface.
194 ## Allow fpathconf(2), subject to capability rights.
199 ## Allow various file descriptor-based I/O operations, subject to capability
209 ## Allow querying file and file system state with fstat(2) and fstatfs(2),
210 ## subject to capability rights.
216 ## Allow further file descriptor-based I/O operations, subject to capability
223 ## Allow futimens(2) and futimes(2), subject to capability rights.
229 ## Allow querying process audit state, subject to normal access control.
236 ## Allow thread context management with getcontext(2).
241 ## Allow directory I/O on a file descriptor, subject to capability rights.
242 ## Originally we had separate capabilities for directory-specific read
243 ## operations, but on BSD we allow reading the raw directory data, so we just
244 ## rely on CAP_READ now.
250 ## Allow querying certain trivial global state.
255 ## Allow querying current process credential state.
261 ## Allow querying certain trivial global state.
267 ## Allow querying per-process timer.
272 ## Allow querying current process credential state.
279 ## Allow querying certain trivial global state.
285 ## Allow querying certain per-process scheduling, resource limit, and
288 ## XXXRW: getpgid(2) needs scoping. It's not clear if it's worth scoping
289 ## getppid(2). getpriority(2) needs scoping. getrusage(2) needs scoping.
290 ## getsid(2) needs scoping.
304 ## Allow querying socket state, subject to capability rights.
306 ## XXXRW: getsockopt(2) may need more attention.
312 ## Allow querying the global clock.
317 ## Allow querying current process credential state.
322 ## Allow ioctl(2), which hopefully will be limited by applications only to
323 ## required commands with cap_ioctls_limit(2) syscall.
328 ## Allow querying current process credential state.
333 ## Allow kevent(2), as we will authorize based on capability rights on the
334 ## target descriptor.
339 ## Allow kill(2), as we allow the process to send signals only to himself.
344 ## Allow message queue operations on file descriptors, subject to capability
353 ## Allow kqueue(2), we will control use.
358 ## Allow managing per-process timers.
367 ## We can't allow ktrace(2) because it relies on a global namespace, but we
368 ## might want to introduce an fktrace(2) of some sort.
373 ## Allow AIO operations by file descriptor, subject to capability rights.
378 ## Allow listen(2), subject to capability rights.
380 ## XXXRW: One might argue this manipulates a global namespace.
385 ## Allow I/O-related file descriptors, subject to capability rights.
390 ## Allow simple VM operations on the current process.
399 ## Allow memory mapping a file descriptor, and updating protections, subject
400 ## to capability rights.
406 ## Allow simple VM operations on the current process.
414 ## Allow the current process to sleep.
419 ## Allow querying the global clock.
424 ## Allow AIO operations by file descriptor, subject to capability rights.
430 ## Allow simple VM operations on the current process.
435 ## Allow AIO operations by file descriptor, subject to capability rights.
440 ## Operations relative to directory capabilities.
460 ## Allow entry into open(2). This system call will fail, since access to the
461 ## global file namespace has been disallowed, but allowing entry into the
462 ## syscall means that an audit trail will be generated (which is also very
463 ## useful for debugging).
468 ## Allow poll(2), which will be scoped by capability rights.
470 ## XXXRW: Perhaps we don't need the OpenBSD version?
471 ## XXXRW: We don't yet do that scoping.
476 ## Process descriptor-related system calls are allowed.
481 #pdwait4 # not yet implemented
490 ## Allow poll(2), which will be scoped by capability rights.
491 ## XXXRW: We don't yet do that scoping.
496 ## Allow I/O-related file descriptors, subject to capability rights.
502 ## Allow access to profiling state on the current process.
507 ## Disallow ptrace(2) for now, but we do need debugging facilities in
508 ## capability mode, so we will want to revisit this, possibly by scoping its
514 ## Allow I/O-related file descriptors, subject to capability rights.
525 ## Allow real-time scheduling primitives to be used.
527 ## XXXRW: These require scoping.
533 ## Allow simple VM operations on the current process.
538 ## Allow querying trivial global scheduler state.
540 sched_get_priority_max
541 sched_get_priority_min
544 ## Allow various thread/process scheduler operations.
546 ## XXXRW: Some of these require further scoping.
550 sched_rr_get_interval
556 ## Allow I/O-related file descriptors, subject to capability rights.
560 sctp_generic_sendmsg_iov
564 ## Allow pselect(2) and select(2), which will be scoped by capability rights.
572 ## Allow I/O-related file descriptors, subject to capability rights. Use of
573 ## explicit addresses here is restricted by the system calls themselves.
581 ## Allow setting per-process audit state, which is controlled separately by
589 ## Allow setting thread context.
594 ## Allow setting current process credential state, which is controlled
595 ## separately by privilege.
602 ## Allow use of the process interval timer.
607 ## Allow setpriority(2).
609 ## XXXRW: Requires scoping.
614 ## Allow setting current process credential state, which is controlled
615 ## separately by privilege.
623 ## Allow setting process resource limits with setrlimit(2).
628 ## Allow creating a new session with setsid(2).
633 ## Allow setting socket options with setsockopt(2), subject to capability
636 ## XXXRW: Might require scoping.
641 ## Allow setting current process credential state, which is controlled
642 ## separately by privilege.
647 ## shm_open(2) is scoped so as to allow only access to new anonymous objects.
652 ## Allow I/O-related file descriptors, subject to capability rights.
657 ## Allow signal control on current process.
675 ## Allow creating new socket pairs with socket(2) and socketpair(2).
681 ## Allow simple VM operations on the current process.
683 ## XXXRW: Kernel doesn't implement this, so drop?
688 ## Do allow sync(2) for now, but possibly shouldn't.
693 ## Always allow process termination with sys_exit(2).
698 ## sysarch(2) does rather diverse things, but is required on at least i386
699 ## in order to configure per-thread data. As such, it's scoped on each
705 ## Allow thread operations operating only on current process.
712 ## Disallow thr_kill2(2), as it may operate beyond the current process.
714 ## XXXRW: Requires scoping.
719 ## Allow thread operations operating only on current process.
728 ## Allow manipulation of the current process umask with umask(2).
733 ## Allow submitting of process trace entries with utrace(2).
738 ## Allow generating UUIDs with uuidgen(2).
743 ## Allow I/O-related file descriptors, subject to capability rights.
749 ## Allow processes to yield(2).