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