xref: /freebsd/share/man/man4/mac_bsdextended.4 (revision 9d81f99b127fe8533a6049df5d265ec8b176dfbb)
13ebc28efSChris Costello.\" Copyright (c) 2002 Networks Associates Technology, Inc.
23ebc28efSChris Costello.\" All rights reserved.
33ebc28efSChris Costello.\"
45792da74SChris Costello.\" This software was developed for the FreeBSD Project by Chris Costello
55792da74SChris Costello.\" at Safeport Network Services and Network Associates Laboratories, the
65792da74SChris Costello.\" Security Research Division of Network Associates, Inc. under
75792da74SChris Costello.\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
85792da74SChris Costello.\" DARPA CHATS research program.
93ebc28efSChris Costello.\"
103ebc28efSChris Costello.\" Redistribution and use in source and binary forms, with or without
113ebc28efSChris Costello.\" modification, are permitted provided that the following conditions
123ebc28efSChris Costello.\" are met:
133ebc28efSChris Costello.\" 1. Redistributions of source code must retain the above copyright
143ebc28efSChris Costello.\"    notice, this list of conditions and the following disclaimer.
153ebc28efSChris Costello.\" 2. Redistributions in binary form must reproduce the above copyright
163ebc28efSChris Costello.\"    notice, this list of conditions and the following disclaimer in the
173ebc28efSChris Costello.\"    documentation and/or other materials provided with the distribution.
183ebc28efSChris Costello.\"
193ebc28efSChris Costello.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
203ebc28efSChris Costello.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
213ebc28efSChris Costello.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
223ebc28efSChris Costello.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
233ebc28efSChris Costello.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
243ebc28efSChris Costello.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
253ebc28efSChris Costello.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
263ebc28efSChris Costello.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
273ebc28efSChris Costello.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
283ebc28efSChris Costello.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
293ebc28efSChris Costello.\" SUCH DAMAGE.
303ebc28efSChris Costello.\"
31*9d81f99bSWarner Losh.Dd October 11, 2024
323ebc28efSChris Costello.Dt MAC_BSDEXTENDED 4
33aa12cea2SUlrich Spörlein.Os
343ebc28efSChris Costello.Sh NAME
353ebc28efSChris Costello.Nm mac_bsdextended
363cc3bf52SRuslan Ermilov.Nd "file system firewall policy"
373ebc28efSChris Costello.Sh SYNOPSIS
385fa65465SChris CostelloTo compile the file system firewall policy into your kernel,
395fa65465SChris Costelloplace the following lines in your kernel configuration file:
403cc3bf52SRuslan Ermilov.Bd -ragged -offset indent
415fa65465SChris Costello.Cd "options MAC"
425fa65465SChris Costello.Cd "options MAC_BSDEXTENDED"
433cc3bf52SRuslan Ermilov.Ed
445fa65465SChris Costello.Pp
455fa65465SChris CostelloAlternately, to load the file system firewall policy module at boot time,
4617c5113aSChris Costelloplace the following line in your kernel configuration file:
473cc3bf52SRuslan Ermilov.Bd -ragged -offset indent
4817c5113aSChris Costello.Cd "options MAC"
493cc3bf52SRuslan Ermilov.Ed
5017c5113aSChris Costello.Pp
5117c5113aSChris Costelloand in
5217c5113aSChris Costello.Xr loader.conf 5 :
533cc3bf52SRuslan Ermilov.Bd -literal -offset indent
543cc3bf52SRuslan Ermilovmac_bsdextended_load="YES"
553cc3bf52SRuslan Ermilov.Ed
563ebc28efSChris Costello.Sh DESCRIPTION
573ebc28efSChris CostelloThe
583ebc28efSChris Costello.Nm
594654c8f4STom Rhodessecurity policy module provides an interface for the system administrator
603ebc28efSChris Costelloto impose mandatory rules regarding users and some system objects.
613ebc28efSChris CostelloRules are uploaded to the module
623ebc28efSChris Costello(typically using
6317c5113aSChris Costello.Xr ugidfw 8 ,
6417c5113aSChris Costelloor some other tool utilizing
653ebc28efSChris Costello.Xr libugidfw 3 )
663ebc28efSChris Costellowhere they are stored internally
673ebc28efSChris Costelloand used to determine whether to allow or deny specific accesses
683ebc28efSChris Costello(see
693ebc28efSChris Costello.Xr ugidfw 8 ) .
703ebc28efSChris Costello.Sh IMPLEMENTATION NOTES
713ebc28efSChris CostelloWhile the traditional
723ebc28efSChris Costello.Xr mac 9
733ebc28efSChris Costelloentry points are implemented,
743ebc28efSChris Costellopolicy labels are not used;
753ebc28efSChris Costelloinstead, access control decisions are made by iterating through the internal
763ebc28efSChris Costellolist of rules until a rule
773ebc28efSChris Costellowhich denies the particular access
783ebc28efSChris Costellois found,
793ebc28efSChris Costelloor the end of the list is reached.
8045fd0f24STom RhodesThe
8145fd0f24STom Rhodes.Nm
8245fd0f24STom Rhodespolicy works similar to
8345fd0f24STom Rhodes.Xr ipfw 8
8445fd0f24STom Rhodesor by using a
8545fd0f24STom Rhodes.Em first match semantic .
8645fd0f24STom RhodesThis means that not all rules are applied,
8745fd0f24STom Rhodesonly the first matched rule; thus if
8845fd0f24STom RhodesRule A allows access and Rule B blocks
8945fd0f24STom Rhodesaccess, Rule B will never be applied.
90*9d81f99bSWarner Losh.Sh SYSCTL VARIABLES
9145fd0f24STom RhodesThe following sysctls may be used to tweak the behavior of
9245fd0f24STom Rhodes.Nm :
9345fd0f24STom Rhodes.Bl -tag -width indent
9445fd0f24STom Rhodes.It Va security.mac.bsdextended.enabled
95846e187cSTom RhodesSet to zero or one to toggle the policy off or on.
9645fd0f24STom Rhodes.It Va security.mac.bsdextended.rule_count
9745fd0f24STom RhodesList the number of defined rules, the maximum rule count is
9845fd0f24STom Rhodescurrent set at 256.
9945fd0f24STom Rhodes.It Va security.mac.bsdextended.rule_slots
10045fd0f24STom RhodesList the number of rule slots currently being used.
10145fd0f24STom Rhodes.It Va security.mac.bsdextended.firstmatch_enabled
10245fd0f24STom RhodesToggle between the old all rules match functionality
10345fd0f24STom Rhodesand the new first rule matches functionality.
10488af0398STom RhodesThis is enabled by default.
10545fd0f24STom Rhodes.It Va security.mac.bsdextended.logging
10645fd0f24STom RhodesLog all access violations via the
10745fd0f24STom Rhodes.Dv AUTHPRIV
10845fd0f24STom Rhodes.Xr syslog 3
10945fd0f24STom Rhodesfacility.
11045fd0f24STom Rhodes.It Va security.mac.bsdextended.rules
11145fd0f24STom RhodesCurrently does nothing interesting.
1122393bd42SGiorgos Keramidas.El
1133ebc28efSChris Costello.Sh SEE ALSO
1143ebc28efSChris Costello.Xr libugidfw 3 ,
11545fd0f24STom Rhodes.Xr syslog 3 ,
116ccf09d7cSChris Costello.Xr mac 4 ,
11717c5113aSChris Costello.Xr mac_biba 4 ,
118287d467cSMitchell Horne.Xr mac_ddb 4 ,
119057baf37SChris Costello.Xr mac_ifoff 4 ,
1209cad8863SChris Costello.Xr mac_lomac 4 ,
12117c5113aSChris Costello.Xr mac_mls 4 ,
12217c5113aSChris Costello.Xr mac_none 4 ,
123057baf37SChris Costello.Xr mac_partition 4 ,
1240c6e926fSChris Costello.Xr mac_portacl 4 ,
12517c5113aSChris Costello.Xr mac_seeotheruids 4 ,
12617c5113aSChris Costello.Xr mac_test 4 ,
12745fd0f24STom Rhodes.Xr ipfw 8 ,
1283ebc28efSChris Costello.Xr ugidfw 8 ,
1293ebc28efSChris Costello.Xr mac 9
1303ebc28efSChris Costello.Sh HISTORY
1313ebc28efSChris CostelloThe
1323ebc28efSChris Costello.Nm
13317c5113aSChris Costellopolicy module first appeared in
13417c5113aSChris Costello.Fx 5.0
1353cc3bf52SRuslan Ermilovand was developed by the
1363cc3bf52SRuslan Ermilov.Tn TrustedBSD
1373cc3bf52SRuslan ErmilovProject.
13845fd0f24STom Rhodes.Pp
13945fd0f24STom RhodesThe "match first case" and logging capabilities were later added by
1406c899950SBaptiste Daroussin.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
1413ebc28efSChris Costello.Sh AUTHORS
1423ebc28efSChris CostelloThis software was contributed to the
1433ebc28efSChris Costello.Fx
1443ebc28efSChris CostelloProject by NAI Labs, the Security Research Division of Network Associates
1455203edcdSRuslan ErmilovInc.\& under DARPA/SPAWAR contract N66001-01-C-8035
1463cc3bf52SRuslan Ermilov.Pq Dq CBOSS ,
1473ebc28efSChris Costelloas part of the DARPA CHATS research program.
148