1a508b2a6SChris Costello.\" Copyright (c) 2003 Networks Associates Technology, Inc. 2a508b2a6SChris Costello.\" All rights reserved. 3a508b2a6SChris Costello.\" 4a508b2a6SChris Costello.\" This software was developed for the FreeBSD Project by Chris Costello 5a508b2a6SChris Costello.\" at Safeport Network Services and Network Associates Labs, the 6a508b2a6SChris Costello.\" Security Research Division of Network Associates, Inc. under 7a508b2a6SChris Costello.\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8a508b2a6SChris Costello.\" DARPA CHATS research program. 9a508b2a6SChris Costello.\" 10a508b2a6SChris Costello.\" Redistribution and use in source and binary forms, with or without 11a508b2a6SChris Costello.\" modification, are permitted provided that the following conditions 12a508b2a6SChris Costello.\" are met: 13a508b2a6SChris Costello.\" 1. Redistributions of source code must retain the above copyright 14a508b2a6SChris Costello.\" notice, this list of conditions and the following disclaimer. 15a508b2a6SChris Costello.\" 2. Redistributions in binary form must reproduce the above copyright 16a508b2a6SChris Costello.\" notice, this list of conditions and the following disclaimer in the 17a508b2a6SChris Costello.\" documentation and/or other materials provided with the distribution. 18a508b2a6SChris Costello.\" 19a508b2a6SChris Costello.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 20a508b2a6SChris Costello.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21a508b2a6SChris Costello.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22a508b2a6SChris Costello.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 23a508b2a6SChris Costello.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24a508b2a6SChris Costello.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25a508b2a6SChris Costello.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26a508b2a6SChris Costello.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27a508b2a6SChris Costello.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28a508b2a6SChris Costello.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29a508b2a6SChris Costello.\" SUCH DAMAGE. 30a508b2a6SChris Costello.\" 31a508b2a6SChris Costello.\" $FreeBSD$ 32bc9a9cb4SRuslan Ermilov.\" 33bc9a9cb4SRuslan Ermilov.Dd March 11, 2003 34a508b2a6SChris Costello.Dt MAC_PORTACL 4 35bc9a9cb4SRuslan Ermilov.Os 36a508b2a6SChris Costello.Sh NAME 37a508b2a6SChris Costello.Nm mac_portacl 38a508b2a6SChris Costello.Nd network port access control policy 39a508b2a6SChris Costello.Sh SYNOPSIS 40a508b2a6SChris CostelloTo compile the port access control policy into your kernel, 41a508b2a6SChris Costelloplace the following lines in your kernel 42a508b2a6SChris Costelloconfiguration file: 43bc9a9cb4SRuslan Ermilov.Bd -ragged -offset indent 44a508b2a6SChris Costello.Cd "options MAC" 45a508b2a6SChris Costello.Cd "options MAC_PORTACL" 46bc9a9cb4SRuslan Ermilov.Ed 47a508b2a6SChris Costello.Pp 48a508b2a6SChris CostelloAlternately, to load the port access control policy module at boot time, 49a508b2a6SChris Costelloplace the following line in your kernel configuration file: 50bc9a9cb4SRuslan Ermilov.Bd -ragged -offset indent 51a508b2a6SChris Costello.Cd "options MAC" 52bc9a9cb4SRuslan Ermilov.Ed 53a508b2a6SChris Costello.Pp 54a508b2a6SChris Costelloand in 55a508b2a6SChris Costello.Xr loader.conf 5 : 56bc9a9cb4SRuslan Ermilov.Pp 57bc9a9cb4SRuslan Ermilov.Dl "mac_portacl_load=""YES""" 58a508b2a6SChris Costello.Sh DESCRIPTION 59a508b2a6SChris CostelloThe 60a508b2a6SChris Costello.Nm 61a508b2a6SChris Costellopolicy allows administrators to administratively limit binding to 62bc9a9cb4SRuslan Ermilovlocal 63bc9a9cb4SRuslan Ermilov.Tn UDP 64bc9a9cb4SRuslan Ermilovand 65bc9a9cb4SRuslan Ermilov.Tn TCP 66bc9a9cb4SRuslan Ermilovports via the 67a508b2a6SChris Costello.Xr sysctl 8 68a508b2a6SChris Costellointerface. 69a508b2a6SChris Costello.Pp 70a508b2a6SChris CostelloIn order to enable the 71a508b2a6SChris Costello.Nm 72a508b2a6SChris Costellopolicy, MAC policy must be enforced on sockets 73a508b2a6SChris Costello(see 74a508b2a6SChris Costello.Xr mac 4 ) , 75a508b2a6SChris Costelloand the port(s) protected by 76a508b2a6SChris Costello.Nm 77a508b2a6SChris Costellomust not be included in the range specified by 78a508b2a6SChris Costellothe 79a508b2a6SChris Costello.Va net.inet.ip.portrange.reservedlow 80a508b2a6SChris Costelloand 81a508b2a6SChris Costello.Va net.inet.ip.portrange.reservedhigh 82a508b2a6SChris Costello.Xr sysctl 8 83a508b2a6SChris CostelloMIBs. 84a508b2a6SChris Costello.Ss Runtime Configuration 85a508b2a6SChris CostelloThe port access control list is specified in the 86a508b2a6SChris Costello.Va security.mac.portacl.rules 87a508b2a6SChris Costello.Xr sysctl 8 88a508b2a6SChris CostelloMIB in the following format: 89a508b2a6SChris Costello.Pp 90a508b2a6SChris Costello.Sm off 91a508b2a6SChris Costello.Bd -literal -offset indent 92bc9a9cb4SRuslan Ermilov.Ar idtype 93a508b2a6SChris Costello.Li : 94bc9a9cb4SRuslan Ermilov.Ar id 95a508b2a6SChris Costello.Li : 96bc9a9cb4SRuslan Ermilov.Ar protocol 97a508b2a6SChris Costello.Li : 98bc9a9cb4SRuslan Ermilov.Ar port 99bc9a9cb4SRuslan Ermilov.Oo 100bc9a9cb4SRuslan Ermilov.Li , 101bc9a9cb4SRuslan Ermilov.Ar idtype 102a508b2a6SChris Costello.Li : 103bc9a9cb4SRuslan Ermilov.Ar id 104a508b2a6SChris Costello.Li : 105bc9a9cb4SRuslan Ermilov.Ar protocol 106a508b2a6SChris Costello.Li : 107bc9a9cb4SRuslan Ermilov.Ar port 108bc9a9cb4SRuslan Ermilov.Li , 109bc9a9cb4SRuslan Ermilov.Ar ... 110bc9a9cb4SRuslan Ermilov.Oc 111a508b2a6SChris Costello.Ed 112a508b2a6SChris Costello.Sm on 113a508b2a6SChris Costello.Pp 114bc9a9cb4SRuslan Ermilov.Bl -tag -width ".Ar protocol" 115bc9a9cb4SRuslan Ermilov.It Ar idtype 116a508b2a6SChris CostelloDescribes the type of subject match to be performed. 117a508b2a6SChris CostelloEither 118a508b2a6SChris Costello.Li uid 119bc9a9cb4SRuslan Ermilovfor user ID matching, or 120a508b2a6SChris Costello.Li gid 121a508b2a6SChris Costellofor group ID matching. 122bc9a9cb4SRuslan Ermilov.It Ar id 123a508b2a6SChris CostelloThe user or group ID (depending on 124bc9a9cb4SRuslan Ermilov.Ar idtype ) 125a508b2a6SChris Costelloallowed to bind to the specified port. 126a508b2a6SChris Costello.Bf -emphasis 127a508b2a6SChris CostelloNOTE: User and group names are not valid; only the actual ID numbers 128a508b2a6SChris Costellomay be used. 129a508b2a6SChris Costello.Ef 130bc9a9cb4SRuslan Ermilov.It Ar protocol 131a508b2a6SChris CostelloDescribes which protocol this entry applies to. 132a508b2a6SChris CostelloEither 133a508b2a6SChris Costello.Li tcp 134a508b2a6SChris Costelloor 135a508b2a6SChris Costello.Li udp 136a508b2a6SChris Costelloare supported. 137bc9a9cb4SRuslan Ermilov.It Ar port 138a508b2a6SChris CostelloDescribes which port this entry applies to. 139a508b2a6SChris Costello.Bf -emphasis 140a508b2a6SChris CostelloNOTE: MAC security policies may not override other security system policies 141a508b2a6SChris Costelloby allowing accesses that they may deny, such as 142a508b2a6SChris Costello.Va net.inet.ip.portrange.reservedlow / 143a508b2a6SChris Costello.Va net.inet.ip.portrange.reservedhigh . 144a508b2a6SChris Costello.Ef 145a508b2a6SChris CostelloIf the specified port falls within the range specified, the 146a508b2a6SChris Costello.Nm 147a508b2a6SChris Costelloentry will not function 148bc9a9cb4SRuslan Ermilov(i.e., even the specified user/group may not be able to bind to the specified 149a508b2a6SChris Costelloport). 150a508b2a6SChris Costello.El 151a508b2a6SChris Costello.Sh SEE ALSO 152a508b2a6SChris Costello.Xr mac 3 , 153a508b2a6SChris Costello.Xr mac_biba 4 , 154a508b2a6SChris Costello.Xr mac_bsdextended 4 , 155a508b2a6SChris Costello.Xr mac_ifoff 4 , 156a508b2a6SChris Costello.Xr mac_mls 4 , 157a508b2a6SChris Costello.Xr mac_none 4 , 158a508b2a6SChris Costello.Xr mac_partition 4 , 159a508b2a6SChris Costello.Xr mac_seeotheruids 4 , 160a508b2a6SChris Costello.Xr mac_test 4 , 161a508b2a6SChris Costello.Xr mac 9 162a508b2a6SChris Costello.Sh HISTORY 163a508b2a6SChris CostelloMAC first appeared in 164a508b2a6SChris Costello.Fx 5.0 . 165a508b2a6SChris Costello.Sh AUTHORS 166a508b2a6SChris CostelloThis software was contributed to the 167a508b2a6SChris Costello.Fx 168a508b2a6SChris CostelloProject by NAI Labs, the Security Research Division of Network Associates 169bc9a9cb4SRuslan ErmilovInc. under DARPA/SPAWAR contract N66001-01-C-8035 170bc9a9cb4SRuslan Ermilov.Pq Dq CBOSS , 171a508b2a6SChris Costelloas part of the DARPA CHATS research program. 172