Date: Wed, 26 Mar 2014 21:38:02 +0000 (UTC) From: Dru Lavigne <dru@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44360 - head/en_US.ISO8859-1/books/handbook/mac Message-ID: <201403262138.s2QLc2Mf000897@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dru Date: Wed Mar 26 21:38:02 2014 New Revision: 44360 URL: http://svnweb.freebsd.org/changeset/doc/44360 Log: White space fix only. Translators can ignore. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/mac/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/mac/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/mac/chapter.xml Wed Mar 26 20:22:00 2014 (r44359) +++ head/en_US.ISO8859-1/books/handbook/mac/chapter.xml Wed Mar 26 21:38:02 2014 (r44360) @@ -4,14 +4,15 @@ $FreeBSD$ --> <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="mac"> - <info><title>Mandatory Access Control</title> + <info> + <title>Mandatory Access Control</title> + <authorgroup> - <author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Written by </contrib></author> + <author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Written + by </contrib></author> </authorgroup> </info> - - <sect1 xml:id="mac-synopsis"> <title>Synopsis</title> @@ -21,20 +22,20 @@ <see>MAC</see> </indexterm> - <para>&os; supports security extensions - based on the &posix;.1e draft. These - security mechanisms include file system Access - Control Lists (<xref linkend="fs-acl"/>) and Mandatory Access - Control (<acronym>MAC</acronym>). <acronym>MAC</acronym> allows - access control modules to be loaded in order to implement security - policies. Some modules provide protections for a narrow subset - of the system, hardening a particular service. Others provide - comprehensive labeled security across all subjects and objects. - The mandatory part of the definition indicates that enforcement - of controls is performed by administrators and the operating - system. This is in contrast to the default security mechanism - of Discretionary Access Control (<acronym>DAC</acronym>) where - enforcement is left to the discretion of users.</para> + <para>&os; supports security extensions based on the + &posix;.1e draft. These security mechanisms include file system + Access Control Lists (<xref linkend="fs-acl"/>) and Mandatory + Access Control (<acronym>MAC</acronym>). <acronym>MAC</acronym> + allows access control modules to be loaded in order to implement + security policies. Some modules provide protections for a + narrow subset of the system, hardening a particular service. + Others provide comprehensive labeled security across all + subjects and objects. The mandatory part of the definition + indicates that enforcement of controls is performed by + administrators and the operating system. This is in contrast to + the default security mechanism of Discretionary Access Control + (<acronym>DAC</acronym>) where enforcement is left to the + discretion of users.</para> <para>This chapter focuses on the <acronym>MAC</acronym> framework and the set of pluggable security policy modules &os; provides @@ -80,13 +81,13 @@ <itemizedlist> <listitem> - <para>Understand &unix; and &os; basics - (<xref linkend="basics"/>).</para> + <para>Understand &unix; and &os; basics (<xref + linkend="basics"/>).</para> </listitem> <listitem> - <para>Have some familiarity with security and how it - pertains to &os; (<xref linkend="security"/>).</para> + <para>Have some familiarity with security and how it pertains + to &os; (<xref linkend="security"/>).</para> </listitem> </itemizedlist> @@ -108,16 +109,16 @@ understanding, proper design, and thorough testing.</para> </warning> - <para>While this chapter covers a broad range of security issues - relating to the <acronym>MAC</acronym> framework, the - development of new <acronym>MAC</acronym> security policy - modules will not be covered. A number of security policy - modules included with the <acronym>MAC</acronym> framework - have specific characteristics which are provided for both - testing and new module development. Refer to - &man.mac.test.4;, &man.mac.stub.4; and &man.mac.none.4; - for more information on these security policy modules and - the various mechanisms they provide.</para> + <para>While this chapter covers a broad range of security issues + relating to the <acronym>MAC</acronym> framework, the + development of new <acronym>MAC</acronym> security policy + modules will not be covered. A number of security policy + modules included with the <acronym>MAC</acronym> framework have + specific characteristics which are provided for both testing and + new module development. Refer to &man.mac.test.4;, + &man.mac.stub.4; and &man.mac.none.4; for more information on + these security policy modules and the various mechanisms they + provide.</para> </sect1> <sect1 xml:id="mac-inline-glossary"> @@ -188,8 +189,7 @@ files, fields, screens, keyboards, memory, magnetic storage, printers or any other data storage or moving device. An object is a data container or a system resource. Access to - an object effectively means access to - its data.</para> + an object effectively means access to its data.</para> </listitem> <listitem> @@ -202,26 +202,25 @@ <listitem> <para><emphasis>policy</emphasis>: a collection of rules - which defines how objectives are to be achieved. A - policy usually documents how certain - items are to be handled. This chapter considers a - policy to be a collection of rules which controls - the flow of data and information and defines who has access - to that data and information.</para> + which defines how objectives are to be achieved. A policy + usually documents how certain items are to be handled. This + chapter considers a policy to be a collection of rules which + controls the flow of data and information and defines who + has access to that data and information.</para> </listitem> <listitem> <para><emphasis>high-watermark</emphasis>: this type of policy permits the raising of security levels for the purpose of accessing higher level information. In most - cases, the original level is restored after the process - is complete. Currently, the &os; <acronym>MAC</acronym> + cases, the original level is restored after the process is + complete. Currently, the &os; <acronym>MAC</acronym> framework does not include this type of policy.</para> </listitem> <listitem> - <para><emphasis>low-watermark</emphasis>: this type of - policy permits lowering security levels for the purpose of + <para><emphasis>low-watermark</emphasis>: this type of policy + permits lowering security levels for the purpose of accessing information which is less secure. In most cases, the original security level of the user is restored after the process is complete. The only security policy module in @@ -243,13 +242,12 @@ <title>Understanding MAC Labels</title> <para>A <acronym>MAC</acronym> label is a security attribute - which may be applied to subjects and objects throughout - the system. When setting a label, the administrator must - understand its - implications in order to prevent unexpected or undesired - behavior of the system. The attributes available on an object - depend on the loaded policy module, as policy modules interpret - their attributes in different ways.</para> + which may be applied to subjects and objects throughout the + system. When setting a label, the administrator must + understand its implications in order to prevent unexpected or + undesired behavior of the system. The attributes available on + an object depend on the loaded policy module, as policy modules + interpret their attributes in different ways.</para> <para>The security label on an object is used as a part of a security access control decision by a policy. With some @@ -257,73 +255,71 @@ to make a decision. In other policies, the labels may be processed as part of a larger rule set.</para> - <para>There are two types of label policies: single label and multi label. - By default, the system will use - single label. The administrator should be aware of the - pros and cons of each in order to implement policies which meet the - requirements of the system's security model.</para> - - <para>A single label security policy - only permits one label - to be used for every subject or object. Since a single label policy enforces one set of - access permissions across the entire system, it provides lower - administration overhead, but decreases the flexibility of - policies which support labeling. However, in many - environments, a single label policy may be all that is required.</para> + <para>There are two types of label policies: single label and + multi label. By default, the system will use single label. The + administrator should be aware of the pros and cons of each in + order to implement policies which meet the requirements of the + system's security model.</para> + + <para>A single label security policy only permits one label to be + used for every subject or object. Since a single label policy + enforces one set of access permissions across the entire system, + it provides lower administration overhead, but decreases the + flexibility of policies which support labeling. However, in + many environments, a single label policy may be all that is + required.</para> <para>A single label policy is somewhat similar to - <acronym>DAC</acronym> as - <systemitem class="username">root</systemitem> - configures the policies so that users are placed in the - appropriate categories and access levels. A notable difference is that many policy modules - can also restrict <systemitem class="username">root</systemitem>. Basic - control over objects will then be released to the group, but - <systemitem class="username">root</systemitem> may revoke or modify the settings - at any time.</para> - - <para>When appropriate, a multi label policy can - be set on - a <acronym>UFS</acronym> file system by passing <option>multilabel</option> to - &man.tunefs.8;. A multi label policy permits each subject or object - to have its own independent <acronym>MAC</acronym> label. - The decision to use a multi label or - single label policy is only required for policies - which implement the labeling feature, such as <literal>biba</literal>, - <literal>lomac</literal>, and <literal>mls</literal>. Some policies, - such as <literal>seeotheruids</literal>, - <literal>portacl</literal> and <literal>partition</literal>, - do not use labels at all.</para> - - <para>Using a multi label policy on a partition and - establishing a multi label security model can increase - administrative overhead as everything in that file system has a - label. This includes directories, files, and even device - nodes.</para> - - <para>The following command will set <option>multilabel</option> - on the specified <acronym>UFS</acronym> file system. This may only be - done in single-user mode and is not a requirement for the swap - file system:</para> + <acronym>DAC</acronym> as <systemitem + class="username">root</systemitem> configures the policies so + that users are placed in the appropriate categories and access + levels. A notable difference is that many policy modules can + also restrict <systemitem class="username">root</systemitem>. + Basic control over objects will then be released to the group, + but <systemitem class="username">root</systemitem> may revoke or + modify the settings at any time.</para> + + <para>When appropriate, a multi label policy can be set on a + <acronym>UFS</acronym> file system by passing + <option>multilabel</option> to &man.tunefs.8;. A multi label + policy permits each subject or object to have its own + independent <acronym>MAC</acronym> label. The decision to use a + multi label or single label policy is only required for policies + which implement the labeling feature, such as + <literal>biba</literal>, <literal>lomac</literal>, and + <literal>mls</literal>. Some policies, such as + <literal>seeotheruids</literal>, <literal>portacl</literal> and + <literal>partition</literal>, do not use labels at all.</para> + + <para>Using a multi label policy on a partition and establishing a + multi label security model can increase administrative overhead + as everything in that file system has a label. This includes + directories, files, and even device nodes.</para> + + <para>The following command will set <option>multilabel</option> + on the specified <acronym>UFS</acronym> file system. This may + only be done in single-user mode and is not a requirement for + the swap file system:</para> - <screen>&prompt.root; <userinput>tunefs -l enable /</userinput></screen> + <screen>&prompt.root; <userinput>tunefs -l enable /</userinput></screen> - <note> - <para>Some users have experienced problems with setting the - <option>multilabel</option> flag on the root partition. - If this is the case, please review - <xref linkend="mac-troubleshoot"/>.</para> - </note> + <note> + <para>Some users have experienced problems with setting the + <option>multilabel</option> flag on the root partition. If + this is the case, please review <xref + linkend="mac-troubleshoot"/>.</para> + </note> - <para>Since the multi label policy is set on a per-file system basis, a multi label policy may not be - needed if the file system layout is well designed. Consider an example security - <acronym>MAC</acronym> model for a &os; web server. This machine - uses the single label, - <literal>biba/high</literal>, for everything in the default file - systems. If the web server needs to - run at <literal>biba/low</literal> - to prevent write up capabilities, it could - be installed to a separate <acronym>UFS</acronym> <filename>/usr/local</filename> file system set at - <literal>biba/low</literal>.</para> + <para>Since the multi label policy is set on a per-file system + basis, a multi label policy may not be needed if the file system + layout is well designed. Consider an example security + <acronym>MAC</acronym> model for a &os; web server. This + machine uses the single label, <literal>biba/high</literal>, for + everything in the default file systems. If the web server needs + to run at <literal>biba/low</literal> to prevent write up + capabilities, it could be installed to a separate + <acronym>UFS</acronym> <filename>/usr/local</filename> file + system set at <literal>biba/low</literal>.</para> <sect2> <title>Label Configuration</title> @@ -337,32 +333,33 @@ <para>All configuration may be done using <command>setfmac</command>, which is used to set <acronym>MAC</acronym> labels on system objects, and - <command>setpmac</command>, which is used to set the labels on system - subjects. For example, to set the <literal>biba</literal> <acronym>MAC</acronym> - label to <literal>high</literal> on <filename>test</filename>:</para> + <command>setpmac</command>, which is used to set the labels on + system subjects. For example, to set the + <literal>biba</literal> <acronym>MAC</acronym> label to + <literal>high</literal> on <filename>test</filename>:</para> <screen>&prompt.root; <userinput>setfmac biba/high test</userinput></screen> <para>If the configuration is successful, the prompt will be returned without error. A common error is <errorname>Permission denied</errorname> which usually occurs - when the label is being set or modified on a restricted object. - Other conditions may produce different - failures. For instance, the file may not be owned by the - user attempting to relabel the object, the object may not - exist, or the object may be read-only. A mandatory policy - will not allow the process to relabel the file, maybe - because of a property of the file, a property of the - process, or a property of the proposed new label value. For - example, if a user running at low integrity tries to change the - label of a high integrity file, or a user running - at low integrity tries to change the label of a low - integrity file to a high integrity label, these operations will fail.</para> - - <para>The - system administrator may use <command>setpmac</command> to override the - policy module's settings by assigning a different label to the - invoked process:</para> + when the label is being set or modified on a restricted + object. Other conditions may produce different failures. For + instance, the file may not be owned by the user attempting to + relabel the object, the object may not exist, or the object + may be read-only. A mandatory policy will not allow the + process to relabel the file, maybe because of a property of + the file, a property of the process, or a property of the + proposed new label value. For example, if a user running at + low integrity tries to change the label of a high integrity + file, or a user running at low integrity tries to change the + label of a low integrity file to a high integrity label, these + operations will fail.</para> + + <para>The system administrator may use + <command>setpmac</command> to override the policy module's + settings by assigning a different label to the invoked + process:</para> <screen>&prompt.root; <userinput>setfmac biba/high test</userinput> <errorname>Permission denied</errorname> @@ -372,116 +369,110 @@ test: biba/high</screen> <para>For currently running processes, such as <application>sendmail</application>, - <command>getpmac</command> is usually used instead. - This command takes a process ID (<acronym>PID</acronym>) in - place of a command name. If users attempt to manipulate a file not + <command>getpmac</command> is usually used instead. This + command takes a process ID (<acronym>PID</acronym>) in place + of a command name. If users attempt to manipulate a file not in their access, subject to the rules of the loaded policy modules, the <errorname>Operation not permitted</errorname> error will be displayed.</para> - </sect2> + </sect2> - <sect2> - <title>Predefined Labels</title> + <sect2> + <title>Predefined Labels</title> - <para>A few &os; policy modules which support the labeling feature - offer three predefined labels: <literal>low</literal>, <literal>equal</literal>, and <literal>high</literal>, - where:</para> - - <itemizedlist> - <listitem> - <para><literal>low</literal> is considered the - lowest label setting an object or subject may have. - Setting this on objects or subjects blocks their access - to objects or subjects marked high.</para> - </listitem> - - <listitem> - <para><literal>equal</literal> sets the subject or object - to be disabled or unaffected and should only be - placed on objects considered to be exempt from the - policy.</para> - </listitem> - - <listitem> - <para><literal>high</literal> grants an object - or subject the highest setting available in the Biba and - <acronym>MLS</acronym> policy modules.</para> - </listitem> - </itemizedlist> - - <para>Such policy modules include &man.mac.biba.4;, &man.mac.mls.4; and - &man.mac.lomac.4;. Each of the predefined - labels establishes a different information flow - directive. Refer to the manual page of the module to - determine the traits of the generic label - configurations.</para> - </sect2> + <para>A few &os; policy modules which support the labeling + feature offer three predefined labels: <literal>low</literal>, + <literal>equal</literal>, and <literal>high</literal>, + where:</para> + + <itemizedlist> + <listitem> + <para><literal>low</literal> is considered the lowest label + setting an object or subject may have. Setting this on + objects or subjects blocks their access to objects or + subjects marked high.</para> + </listitem> + + <listitem> + <para><literal>equal</literal> sets the subject or object to + be disabled or unaffected and should only be placed on + objects considered to be exempt from the policy.</para> + </listitem> + + <listitem> + <para><literal>high</literal> grants an object or subject + the highest setting available in the Biba and + <acronym>MLS</acronym> policy modules.</para> + </listitem> + </itemizedlist> + + <para>Such policy modules include &man.mac.biba.4;, + &man.mac.mls.4; and &man.mac.lomac.4;. Each of the predefined + labels establishes a different information flow directive. + Refer to the manual page of the module to determine the traits + of the generic label configurations.</para> + </sect2> - <sect2> - <title>Numeric Labels</title> - - <para>The Biba and <acronym>MLS</acronym> policy modules support a numeric - label which may be set to indicate the precise level of hierarchical - control. This numeric level is used to partition or sort - information into different groups of classification, only - permitting access to that group or a higher group level. - For example:</para> - - <programlisting>biba/10:2+3+6(5:2+3-20:2+3+4+5+6)</programlisting> - - <para>may be interpreted as <quote>Biba Policy - Label/Grade - 10:Compartments 2, 3 and 6: - (grade 5 ...</quote>)</para> - - <para>In this example, the first grade would be considered - the effective grade with - effective compartments, the second grade - is the low grade, and the last one is the high grade. - In most configurations, such fine-grained settings are not needed - as they are considered to be advanced configurations.</para> - - <para>System objects only have a current grade and compartment. - System subjects reflect the range of available rights in - the system, and network interfaces, where they are used - for access control.</para> - - <para>The grade and compartments in a subject and object - pair are used to construct a relationship known as - <firstterm>dominance</firstterm>, in which a subject dominates an - object, the object dominates the subject, neither - dominates the other, or both dominate each other. The - <quote>both dominate</quote> case occurs when the two - labels are equal. Due to the information flow nature of - Biba, a user has rights to a set of compartments that - might correspond to projects, but objects also have a set - of compartments. Users may have to subset their rights - using <command>su</command> or <command>setpmac</command> - in order to access objects in a compartment from which - they are not restricted.</para> - </sect2> + <sect2> + <title>Numeric Labels</title> - <sect2> - <title>User Labels</title> + <para>The Biba and <acronym>MLS</acronym> policy modules support + a numeric label which may be set to indicate the precise level + of hierarchical control. This numeric level is used to + partition or sort information into different groups of + classification, only permitting access to that group or a + higher group level. For example:</para> + + <programlisting>biba/10:2+3+6(5:2+3-20:2+3+4+5+6)</programlisting> + + <para>may be interpreted as <quote>Biba Policy Label/Grade + 10:Compartments 2, 3 and 6: (grade 5 ...</quote>)</para> + + <para>In this example, the first grade would be considered the + effective grade with effective compartments, the second grade + is the low grade, and the last one is the high grade. In most + configurations, such fine-grained settings are not needed as + they are considered to be advanced configurations.</para> + + <para>System objects only have a current grade and compartment. + System subjects reflect the range of available rights in the + system, and network interfaces, where they are used for access + control.</para> + + <para>The grade and compartments in a subject and object pair + are used to construct a relationship known as + <firstterm>dominance</firstterm>, in which a subject dominates + an object, the object dominates the subject, neither dominates + the other, or both dominate each other. The <quote>both + dominate</quote> case occurs when the two labels are equal. + Due to the information flow nature of Biba, a user has rights + to a set of compartments that might correspond to projects, + but objects also have a set of compartments. Users may have + to subset their rights using <command>su</command> or + <command>setpmac</command> in order to access objects in a + compartment from which they are not restricted.</para> + </sect2> - <para>Users are required to have labels so that their files - and processes properly interact with the security policy - defined on the system. This is configured in - <filename>/etc/login.conf</filename> using login classes. Every - policy module that uses labels will implement the user class - setting.</para> + <sect2> + <title>User Labels</title> - <para>To set the - user class default label which will be enforced by - <acronym>MAC</acronym>, add a <option>label</option> entry. An - example <option>label</option> entry containing every policy module - is displayed below. Note that in a real - configuration, the administrator would never enable - every policy module. It is recommended that the rest of - this chapter be reviewed before any configuration is - implemented.</para> + <para>Users are required to have labels so that their files and + processes properly interact with the security policy defined + on the system. This is configured in + <filename>/etc/login.conf</filename> using login classes. + Every policy module that uses labels will implement the user + class setting.</para> + + <para>To set the user class default label which will be enforced + by <acronym>MAC</acronym>, add a <option>label</option> entry. + An example <option>label</option> entry containing every + policy module is displayed below. Note that in a real + configuration, the administrator would never enable every + policy module. It is recommended that the rest of this + chapter be reviewed before any configuration is + implemented.</para> - <programlisting>default:\ + <programlisting>default:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ @@ -505,58 +496,56 @@ test: biba/high</screen> :ignoretime@:\ :label=partition/13,mls/5,biba/10(5-15),lomac/10[2]:</programlisting> - <para>While users - can not modify the default value, they may change their label after they login, subject - to the constraints of the policy. The example above tells - the Biba policy that a process's minimum integrity is <literal>5</literal>, - its maximum is <literal>15</literal>, and the default effective label is <literal>10</literal>. - The process will run at <literal>10</literal> until it chooses to change - label, perhaps due to the user using <command>setpmac</command>, - which will be constrained by Biba to the configured - range.</para> - - <para>After any change to - <filename>login.conf</filename>, the login class capability - database must be rebuilt using - <command>cap_mkdb</command>.</para> - - <para>Many sites have a large number of users requiring - several different user classes. In depth planning is - required as this can become difficult to - manage.</para> - </sect2> + <para>While users can not modify the default value, they may + change their label after they login, subject to the + constraints of the policy. The example above tells the Biba + policy that a process's minimum integrity is + <literal>5</literal>, its maximum is <literal>15</literal>, + and the default effective label is <literal>10</literal>. The + process will run at <literal>10</literal> until it chooses to + change label, perhaps due to the user using + <command>setpmac</command>, which will be constrained by Biba + to the configured range.</para> + + <para>After any change to <filename>login.conf</filename>, the + login class capability database must be rebuilt using + <command>cap_mkdb</command>.</para> + + <para>Many sites have a large number of users requiring + several different user classes. In depth planning is + required as this can become difficult to manage.</para> + </sect2> - <sect2> - <title>Network Interface Labels</title> + <sect2> + <title>Network Interface Labels</title> - <para>Labels may be set on network interfaces to help - control the flow of data across the network. Policies - using network interface labels function in the same way that - policies function with respect to objects. Users at high - settings in Biba, for example, will not - be permitted to access network interfaces with a label of - <literal>low</literal>.</para> - - <para>When setting the - <acronym>MAC</acronym> label on network interfaces, <option>maclabel</option> may be passed to - <command>ifconfig</command>:</para> - - <screen>&prompt.root; <userinput>ifconfig bge0 maclabel biba/equal</userinput></screen> - - <para>This example will set the <acronym>MAC</acronym> label of - <literal>biba/equal</literal> on the <literal>bge0</literal> interface. - When using a setting similar to - <literal>biba/high(low-high)</literal>, the entire label - should be quoted to prevent an error from being - returned.</para> - - <para>Each policy module which supports labeling has a tunable - which may be used to disable the <acronym>MAC</acronym> - label on network interfaces. Setting the label to - <option>equal</option> will have a similar effect. Review - the output of <command>sysctl</command>, the policy manual - pages, and the information in the rest of this chapter for more - information on those tunables.</para> + <para>Labels may be set on network interfaces to help control + the flow of data across the network. Policies using network + interface labels function in the same way that policies + function with respect to objects. Users at high settings in + Biba, for example, will not be permitted to access network + interfaces with a label of <literal>low</literal>.</para> + + <para>When setting the <acronym>MAC</acronym> label on network + interfaces, <option>maclabel</option> may be passed to + <command>ifconfig</command>:</para> + + <screen>&prompt.root; <userinput>ifconfig bge0 maclabel biba/equal</userinput></screen> + + <para>This example will set the <acronym>MAC</acronym> label of + <literal>biba/equal</literal> on the <literal>bge0</literal> + interface. When using a setting similar to + <literal>biba/high(low-high)</literal>, the entire label + should be quoted to prevent an error from being + returned.</para> + + <para>Each policy module which supports labeling has a tunable + which may be used to disable the <acronym>MAC</acronym> label + on network interfaces. Setting the label to + <option>equal</option> will have a similar effect. Review + the output of <command>sysctl</command>, the policy manual + pages, and the information in the rest of this chapter for + more information on those tunables.</para> </sect2> </sect1> @@ -677,14 +666,14 @@ test: biba/high</screen> back to a previous configuration should be considered and the implementation of <acronym>MAC</acronym> remotely should be done with extreme caution.</para> - </caution> + </caution> </sect1> <sect1 xml:id="mac-modules"> <title>Module Configuration</title> <para>Beginning with &os; 8.0, the default &os; kernel - includes <literal>options MAC</literal>. This means that + includes <literal>options MAC</literal>. This means that every module included with the <acronym>MAC</acronym> framework may be loaded as a run-time kernel module. The recommended method is to add the module name to @@ -709,757 +698,776 @@ test: biba/high</screen> <sect1 xml:id="mac-policies"> <title>Available MAC Policies</title> - <para>&os; includes a group of policies that will cover - most security requirements. Each policy is discussed - below.</para> - - <sect2 xml:id="mac-seeotheruids"> - <title>The MAC See Other UIDs Policy</title> + <para>&os; includes a group of policies that will cover most + security requirements. Each policy is discussed below.</para> - <indexterm> - <primary>MAC See Other UIDs Policy</primary> - </indexterm> - <para>Module name: <filename>mac_seeotheruids.ko</filename></para> + <sect2 xml:id="mac-seeotheruids"> + <title>The MAC See Other UIDs Policy</title> - <para>Kernel configuration line: - <literal>options MAC_SEEOTHERUIDS</literal></para> - - <para>Boot option: - <literal>mac_seeotheruids_load="YES"</literal></para> - - <para>The &man.mac.seeotheruids.4; module mimics and extends - the <varname>security.bsd.see_other_uids</varname> and - <varname>security.bsd.see_other_gids</varname> - <command>sysctl</command> tunables. This option does - not require any labels to be set before configuration and - can operate transparently with the other modules.</para> - - <para>After loading the module, the following - <command>sysctl</command> tunables may be used to control - the features:</para> + <indexterm> + <primary>MAC See Other UIDs Policy</primary> + </indexterm> + <para>Module name: + <filename>mac_seeotheruids.ko</filename></para> - <itemizedlist> - <listitem> - <para><varname>security.mac.seeotheruids.enabled</varname> - enables the module and uses the default settings which deny - users the ability to view processes and sockets owned by - other users.</para> - </listitem> + <para>Kernel configuration line: + <literal>options MAC_SEEOTHERUIDS</literal></para> - <listitem> - <para> - <varname>security.mac.seeotheruids.specificgid_enabled</varname> - allows certain groups to be exempt from this policy. To - exempt specific groups from this policy, use the - <varname>security.mac.seeotheruids.specificgid=<replaceable>XXX</replaceable></varname> - <command>sysctl</command> tunable. Replace - <replaceable>XXX</replaceable> with the numeric group ID to - be exempted.</para> - </listitem> + <para>Boot option: + <literal>mac_seeotheruids_load="YES"</literal></para> - <listitem> - <para> - <varname>security.mac.seeotheruids.primarygroup_enabled</varname> - is used to exempt specific primary groups from this policy. - When using this tunable, - <varname>security.mac.seeotheruids.specificgid_enabled</varname> - may not be set.</para> - </listitem> - </itemizedlist> - </sect2> + <para>The &man.mac.seeotheruids.4; module mimics and extends + the <varname>security.bsd.see_other_uids</varname> and + <varname>security.bsd.see_other_gids</varname> + <command>sysctl</command> tunables. This option does not + require any labels to be set before configuration and can + operate transparently with the other modules.</para> + + <para>After loading the module, the following + <command>sysctl</command> tunables may be used to control the + features:</para> + + <itemizedlist> + <listitem> + <para><varname>security.mac.seeotheruids.enabled</varname> + enables the module and uses the default settings which + deny users the ability to view processes and sockets owned + by other users.</para> + </listitem> + + <listitem> + <para> + <varname>security.mac.seeotheruids.specificgid_enabled</varname> + allows certain groups to be exempt from this policy. To + exempt specific groups from this policy, use the + <varname>security.mac.seeotheruids.specificgid=<replaceable>XXX</replaceable></varname> + <command>sysctl</command> tunable. Replace + <replaceable>XXX</replaceable> with the numeric group ID + to be exempted.</para> + </listitem> + + <listitem> + <para> + <varname>security.mac.seeotheruids.primarygroup_enabled</varname> + is used to exempt specific primary groups from this + policy. When using this tunable, + <varname>security.mac.seeotheruids.specificgid_enabled</varname> + may not be set.</para> + </listitem> + </itemizedlist> + </sect2> - <sect2 xml:id="mac-bsdextended"> - <title>The MAC BSD Extended Policy</title> + <sect2 xml:id="mac-bsdextended"> + <title>The MAC BSD Extended Policy</title> - <indexterm> - <primary>MAC</primary> - <secondary>File System Firewall Policy</secondary> - </indexterm> - <para>Module name: <filename>mac_bsdextended.ko</filename></para> + <indexterm> + <primary>MAC</primary> + <secondary>File System Firewall Policy</secondary> + </indexterm> + <para>Module name: + <filename>mac_bsdextended.ko</filename></para> - <para>Kernel configuration line: - <literal>options MAC_BSDEXTENDED</literal></para> + <para>Kernel configuration line: + <literal>options MAC_BSDEXTENDED</literal></para> - <para>Boot option: - <literal>mac_bsdextended_load="YES"</literal></para> + <para>Boot option: + <literal>mac_bsdextended_load="YES"</literal></para> - <para>The &man.mac.bsdextended.4; module enforces the file system - firewall. This module's policy provides an extension to the - standard file system permissions model, permitting an - administrator to create a firewall-like ruleset to protect - files, utilities, and directories in the file system hierarchy. - When access to a file system object is attempted, the list of - rules is iterated until either a matching rule is located or - the end is reached. This behavior may be changed by the use - of a &man.sysctl.8; parameter, - <varname>security.mac.bsdextended.firstmatch_enabled</varname>. - Similar to other firewall modules in &os;, a file containing - the access control rules can be created and read by the system - at boot time using an &man.rc.conf.5; variable.</para> - - <para>The rule list may be entered using &man.ugidfw.8; which has - a syntax similar to &man.ipfw.8;. More tools can be written by - using the functions in the &man.libugidfw.3; library.</para> - - <para>Extreme caution should be taken when working with this - module as incorrect use could block access to certain parts of - the file system.</para> - - <sect3> - <title>Examples</title> - - <para>After the &man.mac.bsdextended.4; module has been loaded, - the following command may be used to list the current rule - configuration:</para> + <para>The &man.mac.bsdextended.4; module enforces the file + system firewall. This module's policy provides an extension + to the standard file system permissions model, permitting an + administrator to create a firewall-like ruleset to protect + files, utilities, and directories in the file system + hierarchy. When access to a file system object is attempted, + the list of rules is iterated until either a matching rule is + located or the end is reached. This behavior may be changed + by the use of a &man.sysctl.8; parameter, + <varname>security.mac.bsdextended.firstmatch_enabled</varname>. + Similar to other firewall modules in &os;, a file containing + the access control rules can be created and read by the system + at boot time using an &man.rc.conf.5; variable.</para> + + <para>The rule list may be entered using &man.ugidfw.8; which + has a syntax similar to &man.ipfw.8;. More tools can be + written by using the functions in the &man.libugidfw.3; + library.</para> + + <para>Extreme caution should be taken when working with this + module as incorrect use could block access to certain parts of + the file system.</para> + + <sect3> + <title>Examples</title> + + <para>After the &man.mac.bsdextended.4; module has been + loaded, the following command may be used to list the + current rule configuration:</para> - <screen>&prompt.root; <userinput>ugidfw list</userinput> + <screen>&prompt.root; <userinput>ugidfw list</userinput> 0 slots, 0 rules</screen> - <para>By default, no rules are defined and everything is - completely accessible. To create a rule which will block all - access by users but leave <systemitem class="username">root</systemitem> - unaffected, run the following command:</para> - - <screen>&prompt.root; <userinput>ugidfw add subject not uid root new object not uid root mode n</userinput></screen> - - <para>This is a very bad idea as it will block all users from - issuing even the most simple commands, such as - <command>ls</command>. The next example will block - <systemitem class="username">user1</systemitem> any and all access, including - directory listings, to - <systemitem class="username"><replaceable>user2</replaceable></systemitem>'s home - directory:</para> + <para>By default, no rules are defined and everything is + completely accessible. To create a rule which will block + all access by users but leave <systemitem + class="username">root</systemitem> unaffected, run the + following command:</para> + + <screen>&prompt.root; <userinput>ugidfw add subject not uid root new object not uid root mode n</userinput></screen> + + <para>This is a very bad idea as it will block all users from + issuing even the most simple commands, such as + <command>ls</command>. The next example will block + <systemitem class="username">user1</systemitem> any and all + access, including directory listings, to <systemitem + class="username"><replaceable>user2</replaceable></systemitem>'s + home directory:</para> - <screen>&prompt.root; <userinput>ugidfw set 2 subject uid user1 object uid user2 mode n</userinput> + <screen>&prompt.root; <userinput>ugidfw set 2 subject uid user1 object uid user2 mode n</userinput> &prompt.root; <userinput>ugidfw set 3 subject uid user1 object gid user2 mode n</userinput></screen> - <para>Instead of <systemitem class="username">user1</systemitem>, - <option>not uid <replaceable>user2</replaceable></option> - could be used. This enforces the same access restrictions for - all users instead of just one user.</para> - - <note> - <para>The <systemitem class="username">root</systemitem> user is unaffected by - these changes.</para> - </note> - - <para>For more information, refer to &man.mac.bsdextended.4; and - &man.ugidfw.8;</para> - </sect3> - </sect2> - - <sect2 xml:id="mac-ifoff"> - <title>The MAC Interface Silencing Policy</title> - - <indexterm> - <primary>MAC Interface Silencing Policy</primary> - </indexterm> - <para>Module name: <filename>mac_ifoff.ko</filename></para> - - <para>Kernel configuration line: - <literal>options MAC_IFOFF</literal></para> - - <para>Boot option: - <literal>mac_ifoff_load="YES"</literal></para> - - <para>The &man.mac.ifoff.4; module exists solely to disable - network interfaces on the fly and keep network interfaces from - being brought up during system boot. It does not require any - labels to be set up on the system, nor does it depend on other - <acronym>MAC</acronym> modules.</para> - - <para>Most of this module's control is performed through the - <command>sysctl</command> tunables listed below.</para> - - <itemizedlist> - <listitem> - <para><varname>security.mac.ifoff.lo_enabled</varname> - enables or disables all traffic on the loopback (&man.lo.4;) - interface.</para> - </listitem> - - <listitem> - <para><varname>security.mac.ifoff.bpfrecv_enabled</varname> - enables or disables all traffic on the Berkeley Packet - Filter interface (&man.bpf.4;)</para> - </listitem> - - <listitem> - <para><varname>security.mac.ifoff.other_enabled</varname> - enables or disables traffic on all other interfaces.</para> - </listitem> - </itemizedlist> - - <para>One of the most common uses of &man.mac.ifoff.4; is network - monitoring in an environment where network traffic should not - be permitted during the boot sequence. Another suggested use - would be to write a script which uses - <package>security/aide</package> to - automatically block network traffic if it finds new or altered - files in protected directories.</para> - </sect2> - - <sect2 xml:id="mac-portacl"> - <title>The MAC Port Access Control List Policy</title> - - <indexterm> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403262138.s2QLc2Mf000897>