xref: /freebsd/lib/libc/posix1e/mac.3 (revision 3a5146d9e27e4472cb615d1d5e7027d0e331bec3)
1ecf88982SRobert Watson.\" Copyright (c) 2001, 2003 Networks Associates Technology, Inc.
2d97fcfceSRobert Watson.\" All rights reserved.
3d97fcfceSRobert Watson.\"
4d97fcfceSRobert Watson.\" This software was developed for the FreeBSD Project by Chris
5ec05f17eSRobert Watson.\" Costello at Safeport Network Services and Network Associates
6ec05f17eSRobert Watson.\" Laboratories, the Security Research Division of Network Associates,
7ec05f17eSRobert Watson.\" Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part
8ec05f17eSRobert Watson.\" of the DARPA CHATS research program.
9d97fcfceSRobert Watson.\"
10d97fcfceSRobert Watson.\" Redistribution and use in source and binary forms, with or without
11d97fcfceSRobert Watson.\" modification, are permitted provided that the following conditions
12d97fcfceSRobert Watson.\" are met:
13d97fcfceSRobert Watson.\" 1. Redistributions of source code must retain the above copyright
14d97fcfceSRobert Watson.\"    notice, this list of conditions and the following disclaimer.
15d97fcfceSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
16d97fcfceSRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
17d97fcfceSRobert Watson.\"    documentation and/or other materials provided with the distribution.
18d97fcfceSRobert Watson.\"
19d97fcfceSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20d97fcfceSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21d97fcfceSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22d97fcfceSRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23d97fcfceSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24d97fcfceSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25d97fcfceSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26d97fcfceSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27d97fcfceSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28d97fcfceSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29d97fcfceSRobert Watson.\" SUCH DAMAGE.
30d97fcfceSRobert Watson.\"
31d97fcfceSRobert Watson.\" $FreeBSD$
323b296920SRuslan Ermilov.\"
338aa884cbSRobert Watson.Dd April 19, 2003
34d97fcfceSRobert Watson.Dt MAC 3
35051bb54bSRuslan Ermilov.Os
36d97fcfceSRobert Watson.Sh NAME
37d97fcfceSRobert Watson.Nm mac
383a5146d9SRuslan Ermilov.Nd introduction to the MAC security API
39d97fcfceSRobert Watson.Sh LIBRARY
40d97fcfceSRobert Watson.Lb libc
41d97fcfceSRobert Watson.Sh SYNOPSIS
42d97fcfceSRobert Watson.In sys/mac.h
43d97fcfceSRobert Watson.Pp
44d97fcfceSRobert WatsonIn the kernel configuration file:
45d97fcfceSRobert Watson.Cd "options MAC"
46d97fcfceSRobert Watson.Sh DESCRIPTION
47d97fcfceSRobert Watson.Fx
48d97fcfceSRobert Watsonpermits administrators to define Mandatory Access Control labels
49d97fcfceSRobert Watsondefining levels for the privacy and integrity of data,
50d97fcfceSRobert Watsonoverriding discretionary policies
51d97fcfceSRobert Watsonfor those objects.
52d97fcfceSRobert WatsonNot all objects currently provide support for MAC labels,
53d97fcfceSRobert Watsonand MAC support must be explicitly enabled by the administrator.
54d97fcfceSRobert WatsonThe library calls include routines to retrieve, duplicate,
55d97fcfceSRobert Watsonand set MAC labels associated with files and processes.
56d97fcfceSRobert Watson.Pp
57d97fcfceSRobert WatsonPOSIX.1e describes a set of MAC manipulation routines
58d97fcfceSRobert Watsonto manage the contents of MAC labels,
59d97fcfceSRobert Watsonas well as their relationships with
60d97fcfceSRobert Watsonfiles and processes;
61d97fcfceSRobert Watsonalmost all of these support routines
62d97fcfceSRobert Watsonare implemented in
63d97fcfceSRobert Watson.Fx .
64d97fcfceSRobert Watson.Pp
65d97fcfceSRobert WatsonAvailable functions, sorted by behavior, include:
66d97fcfceSRobert Watson.Bl -tag -width indent
67d97fcfceSRobert Watson.It Fn mac_get_fd
68d97fcfceSRobert WatsonThis function is described in
69d97fcfceSRobert Watson.Xr mac_get 3 ,
70d97fcfceSRobert Watsonand may be used to retrieve the
71d97fcfceSRobert WatsonMAC label associated with
72d97fcfceSRobert Watsona specific file descriptor.
73d97fcfceSRobert Watson.It Fn mac_get_file
74d97fcfceSRobert WatsonThis function is described in
75d97fcfceSRobert Watson.Xr mac_get 3 ,
76d97fcfceSRobert Watsonand may be used to retrieve the
77d97fcfceSRobert WatsonMAC label associated with
78d97fcfceSRobert Watsona named file.
79d97fcfceSRobert Watson.It Fn mac_get_proc
80d97fcfceSRobert WatsonThis function is described in
81d97fcfceSRobert Watson.Xr mac_get 3 ,
82d97fcfceSRobert Watsonand may be used to retrieve the
83d97fcfceSRobert WatsonMAC label associated with
84d97fcfceSRobert Watsonthe calling process.
85d97fcfceSRobert Watson.It Fn mac_set_fd
86d97fcfceSRobert WatsonThis function is described in
87d97fcfceSRobert Watson.Xr mac_set 3 ,
88d97fcfceSRobert Watsonand may be used to set the
89d97fcfceSRobert WatsonMAC label associated with
90d97fcfceSRobert Watsona specific file descriptor.
91d97fcfceSRobert Watson.It Fn mac_set_file
92d97fcfceSRobert WatsonThis function is described in
93d97fcfceSRobert Watson.Xr mac_set 3 ,
94d97fcfceSRobert Watsonand may be used to set the
95d97fcfceSRobert WatsonMAC label associated with
96d97fcfceSRobert Watsona named file.
97d97fcfceSRobert Watson.It Fn mac_set_proc
98d97fcfceSRobert WatsonThis function is described in
99d97fcfceSRobert Watson.Xr mac_set 3 ,
100d97fcfceSRobert Watsonand may be used to set the
101d97fcfceSRobert WatsonMAC label associated with
102d97fcfceSRobert Watsonthe calling process.
103d97fcfceSRobert Watson.It Fn mac_free
104d97fcfceSRobert WatsonThis function is described in
105d97fcfceSRobert Watson.Xr mac_free 3 ,
106d97fcfceSRobert Watsonand may be used to free
107d97fcfceSRobert Watsonuserland working MAC label storage.
108d97fcfceSRobert Watson.It Fn mac_from_text
109d97fcfceSRobert WatsonThis function is described in
110d97fcfceSRobert Watson.Xr mac_text 3 ,
111d97fcfceSRobert Watsonand may be used to convert
112d97fcfceSRobert Watsona text-form MAC label
113d97fcfceSRobert Watsoninto a working
114d97fcfceSRobert Watson.Vt mac_t .
11523408b00SRobert Watson.It Fn mac_prepare
11623408b00SRobert Watson.It Fn mac_prepare_file_label
11723408b00SRobert Watson.It Fn mac_prepare_ifnet_label
11823408b00SRobert Watson.It Fn mac_prepare_process_label
11923408b00SRobert WatsonThese functions are described in
12023408b00SRobert Watson.Xr mac_prepare 3 ,
12123408b00SRobert Watsonand may be used to preallocate storage for MAC label retrieval.
12223408b00SRobert Watson.Xr mac_prepare 3
12323408b00SRobert Watsonprepares a label based on caller-specified label names; the other calls
12423408b00SRobert Watsonrely on the default configuration specified in
12523408b00SRobert Watson.Xr mac.conf 5 .
126d97fcfceSRobert Watson.It Fn mac_to_text
127d97fcfceSRobert WatsonThis function is described in
128d97fcfceSRobert Watson.Xr mac_text 3 ,
129d97fcfceSRobert Watsonand may be used to convert a
130d97fcfceSRobert Watson.Vt mac_t
131d97fcfceSRobert Watsoninto a text-form MAC label.
132d97fcfceSRobert Watson.El
1338aa884cbSRobert WatsonThe behavior of some of these calls is influenced by the configuration
1348aa884cbSRobert Watsonsettings found in
1358aa884cbSRobert Watson.Xr mac.conf 5 ,
1368aa884cbSRobert Watsonthe MAC library run-time configuration file.
1378aa884cbSRobert Watson.Sh FILES
1388aa884cbSRobert Watson.Bl -tag -width ".Pa /etc/mac.conf" -compact
1398aa884cbSRobert Watson.It Pa /etc/mac.conf
1408aa884cbSRobert WatsonMAC library configuration file, documented in
1418aa884cbSRobert Watson.Xr mac.conf 5 .
1428aa884cbSRobert WatsonProvides default behavior for applications aware of MAC labels on
1438aa884cbSRobert Watsonsystem objects, but without policy-specific knowledge.
1448aa884cbSRobert Watson.El
145d97fcfceSRobert Watson.Sh IMPLEMENTATION NOTES
146d97fcfceSRobert Watson.Fx Ns 's
147d97fcfceSRobert Watsonsupport for POSIX.1e interfaces and features
1483b296920SRuslan Ermilovis
1493b296920SRuslan Ermilov.Ud .
150d97fcfceSRobert Watson.Sh SEE ALSO
151d97fcfceSRobert Watson.Xr mac_free 3 ,
152d97fcfceSRobert Watson.Xr mac_get 3 ,
15376a829fdSChris Costello.Xr mac_prepare 3 ,
154d97fcfceSRobert Watson.Xr mac_set 3 ,
15519eab74aSRobert Watson.Xr mac_text 3 ,
1568f8690e7SChris Costello.Xr mac 4 ,
1578aa884cbSRobert Watson.Xr mac.conf 5 ,
15819eab74aSRobert Watson.Xr mac 9
159d97fcfceSRobert Watson.Sh STANDARDS
160ecf88982SRobert WatsonThese APIs are loosely based on the APIs described in POSIX.1e.
161d97fcfceSRobert WatsonPOSIX.1e is described in IEEE POSIX.1e draft 17.
162d97fcfceSRobert WatsonDiscussion of the draft
163d97fcfceSRobert Watsoncontinues on the cross-platform POSIX.1e implementation mailing list.
164d97fcfceSRobert WatsonTo join this list, see the
165d97fcfceSRobert Watson.Fx
166d97fcfceSRobert WatsonPOSIX.1e implementation page
167d97fcfceSRobert Watsonfor more information.
168ecf88982SRobert WatsonHowever, the resemblence of these APIs to the POSIX APIs is only loose,
169ecf88982SRobert Watsonas the POSIX APIs were unable to express many notions required for
170ecf88982SRobert Watsonflexible and extensible access control.
171ec05f17eSRobert Watson.Sh HISTORY
172ec05f17eSRobert WatsonSupport for Mandatory Access Control was introduced in
173ec05f17eSRobert Watson.Fx 5.0
1743b296920SRuslan Ermilovas part of the
1753b296920SRuslan Ermilov.Tn TrustedBSD
1763b296920SRuslan ErmilovProject.
177443ab2a0SRobert Watson.Sh BUGS
1783b296920SRuslan ErmilovThe
1793b296920SRuslan Ermilov.Tn TrustedBSD
1803b296920SRuslan ErmilovMAC Framework and associated policies, interfaces, and
181443ab2a0SRobert Watsonapplications are considered to be an experimental feature in
182443ab2a0SRobert Watson.Fx .
183443ab2a0SRobert WatsonSites considering production deployment should keep the experimental
184443ab2a0SRobert Watsonstatus of these services in mind during any deployment process.
185443ab2a0SRobert WatsonSee also
186443ab2a0SRobert Watson.Xr mac 9
187443ab2a0SRobert Watsonfor related considerations regarding the kernel framework.
188