]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/capsicum.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / capsicum.4
1 .\"
2 .\" Copyright (c) 2011, 2013 Robert N. M. Watson
3 .\" Copyright (c) 2011 Jonathan Anderson
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD$
28 .\"
29 .Dd October 19, 2013
30 .Dt CAPSICUM 4
31 .Os
32 .Sh NAME
33 .Nm Capsicum
34 .Nd lightweight OS capability and sandbox framework
35 .Sh SYNOPSIS
36 .Cd "options CAPABILITY_MODE"
37 .Cd "options CAPABILITIES"
38 .Cd "options PROCDESC"
39 .Sh DESCRIPTION
40 .Nm
41 is a lightweight OS capability and sandbox framework implementing a hybrid
42 capability system model.
43 .Nm
44 can be used for application and library compartmentalisation, the
45 decomposition of larger bodies of software into isolated (sandboxed)
46 components in order to implement security policies and limit the impact of
47 software vulnerabilities.
48 .Pp
49 .Nm
50 provides two core kernel primitives:
51 .Bl -tag -width indent
52 .It capability mode
53 A process mode, entered by invoking
54 .Xr cap_enter 2 ,
55 in which access to global OS namespaces (such as the file system and PID
56 namespaces) is restricted; only explicitly delegated rights, referenced by
57 memory mappings or file descriptors, may be used.
58 Once set, the flag is inherited by future children processes, and may not be
59 cleared.
60 .It capabilities
61 Limit operations that can be called on file descriptors.
62 For example, a file descriptor returned by
63 .Xr open 2
64 may be refined using
65 .Xr cap_rights_limit 2
66 so that only
67 .Xr read 2
68 and
69 .Xr write 2
70 can be called, but not
71 .Xr fchmod 2 .
72 The complete list of the capability rights can be found in the
73 .Xr rights 4
74 manual page.
75 .El
76 .Pp
77 In some cases,
78 .Nm
79 requires use of alternatives to traditional POSIX APIs in order to name
80 objects using capabilities rather than global namespaces:
81 .Bl -tag -width indent
82 .It process descriptors
83 File descriptors representing processes, allowing parent processes to manage
84 child processes without requiring access to the PID namespace; described in
85 greater detail in
86 .Xr procdesc 4 .
87 .It anonymous shared memory
88 An extension to the POSIX shared memory API to support anonymous swap objects
89 associated with file descriptors; described in greater detail in
90 .Xr shm_open 2 .
91 .El
92 .Sh SEE ALSO
93 .Xr cap_enter 2 ,
94 .Xr cap_fcntls_limit 2 ,
95 .Xr cap_getmode 2 ,
96 .Xr cap_ioctls_limit 2 ,
97 .Xr cap_rights_limit 2 ,
98 .Xr fchmod 2 ,
99 .Xr open 2 ,
100 .Xr pdfork 2 ,
101 .Xr pdgetpid 2 ,
102 .Xr pdkill 2 ,
103 .Xr pdwait4 2 ,
104 .Xr read 2 ,
105 .Xr shm_open 2 ,
106 .Xr write 2 ,
107 .Xr cap_rights_get 3 ,
108 .Xr procdesc 4
109 .Sh HISTORY
110 .Nm
111 first appeared in
112 .Fx 9.0 ,
113 and was developed at the University of Cambridge.
114 .Sh AUTHORS
115 .Nm
116 was developed by
117 .An -nosplit
118 .An "Robert Watson" Aq rwatson@FreeBSD.org
119 and
120 .An "Jonathan Anderson" Aq jonathan@FreeBSD.org
121 at the University of Cambridge, and
122 .An "Ben Laurie" Aq benl@FreeBSD.org
123 and
124 .An "Kris Kennaway" Aq kris@FreeBSD.org
125 at Google, Inc., and
126 .An "Pawel Jakub Dawidek" Aq pawel@dawidek.net .
127 .Sh BUGS
128 .Nm
129 is considered experimental in
130 .Fx .