10bbfd990SRobert Watson.\" Copyright (c) 2002-2004 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 73ebc28efSChris Costello.\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 83ebc28efSChris 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.\" 31208a8b95SEdward Tomasz Napierala.Dd July 25, 2015 323ebc28efSChris Costello.Dt MAC_MLS 4 33aa12cea2SUlrich Spörlein.Os 343ebc28efSChris Costello.Sh NAME 353ebc28efSChris Costello.Nm mac_mls 363cc3bf52SRuslan Ermilov.Nd "Multi-Level Security confidentiality policy" 373ebc28efSChris Costello.Sh SYNOPSIS 383ebc28efSChris CostelloTo compile MLS into your kernel, place the following lines in your kernel 393ebc28efSChris Costelloconfiguration file: 403cc3bf52SRuslan Ermilov.Bd -ragged -offset indent 413ebc28efSChris Costello.Cd "options MAC" 423ebc28efSChris Costello.Cd "options MAC_MLS" 433cc3bf52SRuslan Ermilov.Ed 443ebc28efSChris Costello.Pp 453ebc28efSChris CostelloAlternately, to load the MLS module at boot time, place the following line 463ebc28efSChris Costelloin your kernel configuration file: 473cc3bf52SRuslan Ermilov.Bd -ragged -offset indent 483ebc28efSChris Costello.Cd "options MAC" 493cc3bf52SRuslan Ermilov.Ed 503ebc28efSChris Costello.Pp 513ebc28efSChris Costelloand in 523ebc28efSChris Costello.Xr loader.conf 5 : 533cc3bf52SRuslan Ermilov.Bd -literal -offset indent 543cc3bf52SRuslan Ermilovmac_mls_load="YES" 553cc3bf52SRuslan Ermilov.Ed 563ebc28efSChris Costello.Sh DESCRIPTION 573ebc28efSChris CostelloThe 583ebc28efSChris Costello.Nm 593ebc28efSChris Costellopolicy module implements the Multi-Level Security, or MLS model, 606f489bd9SChris Costellowhich controls access between subjects and objects based on their 613ebc28efSChris Costelloconfidentiality by means of a strict information flow policy. 623ebc28efSChris CostelloEach subject and object in the system has an MLS label associated with it; 633ebc28efSChris Costelloeach subject's MLS label contains information on its clearance level, 643ebc28efSChris Costelloand each object's MLS label contains information on its classification. 653ebc28efSChris Costello.Pp 663ebc28efSChris CostelloIn MLS, all system subjects and objects are assigned confidentiality labels, 673ebc28efSChris Costellomade up of a sensitivity level and zero or more compartments. 683ebc28efSChris CostelloTogether, these label elements permit all labels to be placed in a partial 693ebc28efSChris Costelloorder, with confidentiality protections based on a dominance operator 703ebc28efSChris Costellodescribing the order. 713ebc28efSChris CostelloThe sensitivity level is expressed as a value between 0 and 723ebc28efSChris Costello65535, with higher values reflecting higher sensitivity levels. 733ebc28efSChris CostelloThe compartment field is expressed as a set of up to 256 components, 746f489bd9SChris Costellonumbered from 1 to 256. 753ebc28efSChris CostelloA complete label consists of both sensitivity and compartment 763ebc28efSChris Costelloelements. 773ebc28efSChris Costello.Pp 783ebc28efSChris CostelloWith normal labels, dominance is defined as a label having a higher 793ebc28efSChris Costelloor equal active sensitivity level, and having at least 803ebc28efSChris Costelloall of the same compartments as the label to which it is being compared. 813ebc28efSChris CostelloWith respect to label comparisons, 823cc3bf52SRuslan Ermilov.Dq Li lower 833ebc28efSChris Costellois defined as being dominated by the label to which it is being compared, 843ebc28efSChris Costelloand 853cc3bf52SRuslan Ermilov.Dq Li higher 863ebc28efSChris Costellois defined as dominating the label to which it is being compared, 873ebc28efSChris Costelloand 883cc3bf52SRuslan Ermilov.Dq Li equal 893ebc28efSChris Costellois defined as both labels being able to satisfy the dominance requirements 903ebc28efSChris Costelloover one another. 913ebc28efSChris Costello.Pp 923ebc28efSChris CostelloThree special label values exist: 933cc3bf52SRuslan Ermilov.Bl -column -offset indent ".Li mls/equal" "dominated by all other labels" 94daa1772eSChris Costello.It Sy Label Ta Sy Comparison 953cc3bf52SRuslan Ermilov.It Li mls/low Ta "dominated by all other labels" 963cc3bf52SRuslan Ermilov.It Li mls/equal Ta "equal to all other labels" 973cc3bf52SRuslan Ermilov.It Li mls/high Ta "dominates all other labels" 983ebc28efSChris Costello.El 993ebc28efSChris Costello.Pp 10083b0a95aSChris CostelloThe 1013cc3bf52SRuslan Ermilov.Dq Li mls/equal 10283b0a95aSChris Costellolabel may be applied to subjects and objects for which no enforcement of the 10383b0a95aSChris CostelloMLS security policy is desired. 10483b0a95aSChris Costello.Pp 1053ebc28efSChris CostelloThe MLS model enforces the following basic restrictions: 1063ebc28efSChris Costello.Bl -bullet 1073ebc28efSChris Costello.It 1083ebc28efSChris CostelloSubjects may not observe the processes of another subject if its 1093ebc28efSChris Costelloclearance level is lower than the clearance level of the object it is 1103ebc28efSChris Costelloattempting to observe. 1113ebc28efSChris Costello.It 1123ebc28efSChris CostelloSubjects may not read, write, or otherwise observe objects without proper 1135203edcdSRuslan Ermilovclearance (e.g.\& subjects may not observe objects whose classification label 1143ebc28efSChris Costellodominates its own clearance label) 1153ebc28efSChris Costello.It 1163ebc28efSChris CostelloSubjects may not write to objects with a lower classification level than 1173ebc28efSChris Costelloits own clearance level. 1183ebc28efSChris Costello.It 1193ebc28efSChris CostelloA subject may read and write to an object if its clearance level is equal 1203ebc28efSChris Costelloto the object's classification level as though MLS protections were not in 1213ebc28efSChris Costelloplace. 1223ebc28efSChris Costello.El 1233ebc28efSChris Costello.Pp 1243ebc28efSChris CostelloThese rules prevent subjects of lower clearance from gaining access 1253ebc28efSChris Costelloinformation classified beyond its clearance level in order to protect the 1263ebc28efSChris Costelloconfidentiality of classified information, subjects of higher clearance 1273ebc28efSChris Costellofrom writing to objects of lower classification in order to prevent the 1283ebc28efSChris Costelloaccidental or malicious leaking of information, and subjects of lower 1293ebc28efSChris Costelloclearance from observing subjects of higher clearance altogether. 1303ebc28efSChris CostelloIn traditional trusted operating systems, the MLS confidentiality model is 1313ebc28efSChris Costelloused in concert with the Biba integrity model 1323ebc28efSChris Costello.Xr ( mac_biba 4 ) 1333ebc28efSChris Costelloin order to protect the Trusted Code Base (TCB). 1343ebc28efSChris Costello.Ss Label Format 135da2fa159SRuslan ErmilovAlmost all system objects are tagged with an effective, active label element, 1363ebc28efSChris Costelloreflecting the classification of the object, or classification of the data 1373ebc28efSChris Costellocontained in the object. 1383ebc28efSChris CostelloIn general, object labels are represented in the following form: 1393ebc28efSChris Costello.Pp 1403cc3bf52SRuslan Ermilov.Sm off 1413cc3bf52SRuslan Ermilov.D1 Li mls / Ar grade : compartments 1423cc3bf52SRuslan Ermilov.Sm on 1433ebc28efSChris Costello.Pp 1443ebc28efSChris CostelloFor example: 1453ebc28efSChris Costello.Bd -literal -offset indent 14683b0a95aSChris Costellomls/10:2+3+6 1473ebc28efSChris Costellomls/low 1483ebc28efSChris Costello.Ed 1493ebc28efSChris Costello.Pp 150da2fa159SRuslan ErmilovSubject labels consist of three label elements: an effective (active) label, 1513ebc28efSChris Costelloas well as a range of available labels. 1523ebc28efSChris CostelloThis range is represented using two ordered MLS label elements, and when set 1533ebc28efSChris Costelloon a process, permits the process to change its active label to any label of 1543ebc28efSChris Costellogreater or equal integrity to the low end of the range, and lesser or equal 1553ebc28efSChris Costellointegrity to the high end of the range. 1563ebc28efSChris CostelloIn general, subject labels are represented in the following form: 1573ebc28efSChris Costello.Pp 1583cc3bf52SRuslan Ermilov.Sm off 1590bbfd990SRobert Watson.D1 Li mls / Ar effectivegrade : effectivecompartments ( lograde : locompartments No - 1603cc3bf52SRuslan Ermilov.D1 Ar higrade : hicompartments ) 1613cc3bf52SRuslan Ermilov.Sm on 1623ebc28efSChris Costello.Pp 1633ebc28efSChris CostelloFor example: 1643ebc28efSChris Costello.Bd -literal -offset indent 16583b0a95aSChris Costellomls/10:2+3+6(5:2+3-20:2+3+4+5+6) 1663ebc28efSChris Costellomls/high(low-high) 1673ebc28efSChris Costello.Ed 1683ebc28efSChris Costello.Pp 1693ebc28efSChris CostelloValid ranged labels must meet the following requirement regarding their 1703ebc28efSChris Costelloelements: 1713ebc28efSChris Costello.Pp 1720bbfd990SRobert Watson.D1 Ar rangehigh No \[>=] Ar effective No \[>=] Ar rangelow 1733ebc28efSChris Costello.Pp 1743ebc28efSChris CostelloOne class of objects with ranges currently exists, the network interface. 1750bbfd990SRobert WatsonIn the case of the network interface, the effective label element references 1763ebc28efSChris Costellothe default label for packets received over the interface, and the range 1773ebc28efSChris Costellorepresents the range of acceptable labels of packets to be transmitted over 1783ebc28efSChris Costellothe interface. 17983b0a95aSChris Costello.Ss Runtime Configuration 18083b0a95aSChris CostelloThe following 18183b0a95aSChris Costello.Xr sysctl 8 18283b0a95aSChris CostelloMIBs are available for fine-tuning the enforcement of this MAC policy. 1833cc3bf52SRuslan Ermilov.Bl -tag -width ".Va security.mac.mls.ptys_equal" 18483b0a95aSChris Costello.It Va security.mac.mls.enabled 1853cc3bf52SRuslan ErmilovEnables the enforcement of the MLS confidentiality policy. 1863cc3bf52SRuslan Ermilov(Default: 1). 18783b0a95aSChris Costello.It Va security.mac.mls.ptys_equal 18883b0a95aSChris CostelloLabel 1893cc3bf52SRuslan Ermilov.Xr pty 4 Ns s 19083b0a95aSChris Costelloas 1913cc3bf52SRuslan Ermilov.Dq Li mls/equal 1923cc3bf52SRuslan Ermilovupon creation. 1933cc3bf52SRuslan Ermilov(Default: 0). 19483b0a95aSChris Costello.It Va security.mac.mls.revocation_enabled 19583b0a95aSChris CostelloRevoke access to objects if the label is changed to a more sensitive 1963cc3bf52SRuslan Ermilovlevel than the subject. 1973cc3bf52SRuslan Ermilov(Default: 0). 19883b0a95aSChris Costello.El 1993ebc28efSChris Costello.Sh IMPLEMENTATION NOTES 2003ebc28efSChris CostelloCurrently, the 2013ebc28efSChris Costello.Nm 2023ebc28efSChris Costellopolicy relies on superuser status 2033cc3bf52SRuslan Ermilov.Pq Xr suser 9 2043ebc28efSChris Costelloin order to change network interface MLS labels. 2053ebc28efSChris CostelloThis will eventually go away, but it is currently a liability and may 2063ebc28efSChris Costelloallow the superuser to bypass MLS protections. 2073ebc28efSChris Costello.Sh SEE ALSO 208ccf09d7cSChris Costello.Xr mac 4 , 2093ebc28efSChris Costello.Xr mac_biba 4 , 21017c5113aSChris Costello.Xr mac_bsdextended 4 , 211*287d467cSMitchell Horne.Xr mac_ddb 4 , 212057baf37SChris Costello.Xr mac_ifoff 4 , 2139cad8863SChris Costello.Xr mac_lomac 4 , 21417c5113aSChris Costello.Xr mac_none 4 , 215057baf37SChris Costello.Xr mac_partition 4 , 2160c6e926fSChris Costello.Xr mac_portacl 4 , 21717c5113aSChris Costello.Xr mac_seeotheruids 4 , 218a1de21c1SRuslan Ermilov.Xr mac_test 4 , 21917c5113aSChris Costello.Xr maclabel 7 , 2203ebc28efSChris Costello.Xr mac 9 2213ebc28efSChris Costello.Sh HISTORY 2223ebc28efSChris CostelloThe 2233ebc28efSChris Costello.Nm 2243ebc28efSChris Costellopolicy module first appeared in 2253ebc28efSChris Costello.Fx 5.0 2263cc3bf52SRuslan Ermilovand was developed by the 2273cc3bf52SRuslan Ermilov.Tn TrustedBSD 2283cc3bf52SRuslan ErmilovProject. 2293ebc28efSChris Costello.Sh AUTHORS 2303ebc28efSChris CostelloThis software was contributed to the 2313ebc28efSChris Costello.Fx 2326f489bd9SChris CostelloProject by Network Associates Laboratories, 2333ebc28efSChris Costellothe Security Research Division of Network Associates 2345203edcdSRuslan ErmilovInc.\& under DARPA/SPAWAR contract N66001-01-C-8035 2353cc3bf52SRuslan Ermilov.Pq Dq CBOSS , 2363ebc28efSChris Costelloas part of the DARPA CHATS research program. 2373ebc28efSChris Costello.Sh BUGS 2383ebc28efSChris CostelloWhile the MAC Framework design is intended to support the containment of 2393ebc28efSChris Costellothe root user, not all attack channels are currently protected by entry 2403ebc28efSChris Costellopoint checks. 2413ebc28efSChris CostelloAs such, MAC Framework policies should not be relied on, in isolation, 2423ebc28efSChris Costelloto protect against a malicious privileged user. 243