1 .\" Copyright (c) 2003 Networks Associates Technology, Inc.
2 .\" All rights reserved.
4 .\" This software was developed for the FreeBSD Project by Chris Costello
5 .\" at Safeport Network Services and Network Associates Labs, the
6 .\" Security Research Division of Network Associates, Inc. under
7 .\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
8 .\" DARPA CHATS research program.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 .Nd "network port access control policy"
40 To compile the port access control policy into your kernel,
41 place the following lines in your kernel
43 .Bd -ragged -offset indent
45 .Cd "options MAC_PORTACL"
48 Alternately, to load the port access control policy module at boot time,
49 place the following line in your kernel configuration file:
50 .Bd -ragged -offset indent
57 .Dl "mac_portacl_load=""YES"""
61 policy allows administrators to administratively limit binding to
70 In order to enable the
72 policy, MAC policy must be enforced on sockets
75 and the port(s) protected by
77 must not be included in the range specified by
79 .Va net.inet.ip.portrange.reservedlow
81 .Va net.inet.ip.portrange.reservedhigh
87 policy only affects ports explicitly bound by a user process (either
90 socket, or a send/receive
93 This policy will not limit ports bound implicitly for outgoing
94 connections where the process has not explicitly selected a port:
95 these are automatically selected by the IP stack.
99 is enabled, it will control binding access to ports up to the port
101 .Va security.mac.portacl.port_high
104 By default, all attempts to bind to
106 controlled ports will fail if not explicitly allowed by the port
107 access control list, though binding by the superuser will be allowed,
111 .Va security.mac.portacl.suser_exempt
112 is set to a non-zero value.
113 .Ss Runtime Configuration
116 MIBs are available for fine-tuning the enforcement of this MAC policy.
120 .Va security.mac.portacl.rules ,
125 .Bl -tag -width indent
126 .It Va security.mac.portacl.enabled
131 .It Va security.mac.portacl.port_high
132 The highest port number
134 will enforce rules for.
136 .It Va security.mac.portacl.rules
137 The port access control list is specified in the following format:
140 .D1 Ar idtype : id : protocol : port Op , Ar idtype : id : protocol : port , ...
143 .Bl -tag -width ".Ar protocol"
145 Describes the type of subject match to be performed.
148 for user ID matching, or
150 for group ID matching.
152 The user or group ID (depending on
154 allowed to bind to the specified port.
156 NOTE: User and group names are not valid; only the actual ID numbers
160 Describes which protocol this entry applies to.
167 Describes which port this entry applies to.
169 NOTE: MAC security policies may not override other security system policies
170 by allowing accesses that they may deny, such as
171 .Va net.inet.ip.portrange.reservedlow /
172 .Va net.inet.ip.portrange.reservedhigh .
174 If the specified port falls within the range specified, the
176 entry will not function
177 (i.e., even the specified user/group may not be able to bind to the specified
180 .It Va security.mac.portacl.suser_exempt
181 Allow superuser (i.e., root) to bind to all
183 protected ports, even if the port access control list does not
184 explicitly allow this.
186 .It Va security.mac.portacl.autoport_exempt
187 Allow applications to use automatic binding to port 0.
188 Applications use port 0 as a request for automatic port allocation when
189 binding an IP address to a socket.
190 This tunable will exempt port 0 allocation from rule checking.
197 .Xr mac_bsdextended 4 ,
201 .Xr mac_partition 4 ,
202 .Xr mac_seeotheruids 4 ,
206 MAC first appeared in
213 This software was contributed to the
215 Project by NAI Labs, the Security Research Division of Network Associates
216 Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035
218 as part of the DARPA CHATS research program.