<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><?Pub CX solbook(book(title()bookinfo()part(2)part(title()partintro()chapter()?><chapter id="privref-1"><?Pub Tag atict:info tracking="off" ref="0"
restricted="off"?><?Pub Tag atict:user user="sharonr" fullname="Sharon Veach"?><title>Privileges (Reference)</title><highlights><itemizedlist><para>The following is a list of the reference information in this chapter:</para><listitem><para><olink targetptr="privref-11" remap="internal">Administrative Commands for
Handling Privileges</olink></para>
</listitem><listitem><para><olink targetptr="privref-2" remap="internal">Files With Privilege Information</olink></para>
</listitem><listitem><para><olink targetptr="privref-18" remap="internal">Privileges and Auditing</olink></para>
</listitem><listitem><para><olink targetptr="privref-20" remap="internal">Prevention of Privilege Escalation</olink></para>
</listitem><listitem><para><olink targetptr="privref-22" remap="internal">Legacy Applications and the
Privilege Model</olink></para>
</listitem>
</itemizedlist><para>To use privileges, see <olink targetptr="privtask-1" remap="internal">Chapter&nbsp;11, Privileges (Tasks)</olink>. For overview information, see <olink targetptr="prbac-2" remap="internal">Privileges (Overview)</olink>.</para>
</highlights><sect1 id="privref-11"><title>Administrative Commands for Handling Privileges</title><para><indexterm><primary>privileges</primary><secondary>commands</secondary></indexterm><indexterm><primary>commands</primary><secondary>for administering privileges</secondary></indexterm>The following table lists the commands that are available to handle
privileges.</para><table frame="top" id="privref-tbl-1"><title>Commands for Handling Privilege</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="40.99*"/><colspec colname="colspec1" colwidth="36.62*"/><colspec colname="colspec2" colwidth="21.39*"/><thead><row rowsep="1"><entry><para>Purpose</para>
</entry><entry><para>Command</para>
</entry><entry><para>Man Page</para>
</entry>
</row>
</thead><tbody><row><entry><para>Examine process privileges</para>
</entry><entry><para><command>ppriv -v</command> <replaceable>pid</replaceable></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="ppriv-1" remap="external"><citerefentry><refentrytitle>ppriv</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Set process privileges</para>
</entry><entry><para><command>ppriv -s</command> <replaceable>spec</replaceable></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>List the privileges on the system</para>
</entry><entry><para><command>ppriv -l</command></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>List a privilege and its description</para>
</entry><entry><para><command>ppriv -lv</command> <replaceable>priv</replaceable></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Debug privilege failure</para>
</entry><entry><para><command>ppriv -eD</command> <replaceable>failed-operation</replaceable></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Assign privileges to a new local user</para>
</entry><entry><para><command>useradd</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="useradd-1m" remap="external"><citerefentry><refentrytitle>useradd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Add privileges to an existing local user</para>
</entry><entry><para><command>usermod</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="usermod-1m" remap="external"><citerefentry><refentrytitle>usermod</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Assign privileges to a user in a name service</para>
</entry><entry><para><command>smuser</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="smuser-1m" remap="external"><citerefentry><refentrytitle>smuser</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Assign privileges to a new local role</para>
</entry><entry><para><command>roleadd</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="roleadd-1m" remap="external"><citerefentry><refentrytitle>roleadd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Add privileges to an existing local role</para>
</entry><entry><para><command>rolemod</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="rolemod-1m" remap="external"><citerefentry><refentrytitle>rolemod</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Assign privileges to a role in a name service</para>
</entry><entry><para><command>smrole</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="smrole-1m" remap="external"><citerefentry><refentrytitle>smrole</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>View device policy</para>
</entry><entry><para><command>getdevpolicy</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="getdevpolicy-1m" remap="external"><citerefentry><refentrytitle>getdevpolicy</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Set device policy</para>
</entry><entry><para><command>devfsadm</command></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="devfsadm-1m" remap="external"><citerefentry><refentrytitle>devfsadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Update device policy on open devices</para>
</entry><entry><para><command>update_drv -p</command> <replaceable>policy driver</replaceable></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="update-drv-1m" remap="external"><citerefentry><refentrytitle>update_drv</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>Add device policy to a device</para>
</entry><entry><para><command>add_drv -p</command> <replaceable>policy driver</replaceable></para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="add-drv-1m" remap="external"><citerefentry><refentrytitle>add_drv</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The Solaris Management Console GUI is the preferred tool for assigning
privileges to commands, users, and roles. For more information, see <olink targetptr="rbactask-21" remap="internal">How to Assume a Role in the Solaris Management Console</olink>.</para>
</sect1><sect1 id="privref-2"><title>Files With Privilege Information</title><indexterm><primary>privileges</primary><secondary>files</secondary>
</indexterm><indexterm><primary>databases</primary><secondary>with privilege information</secondary>
</indexterm><indexterm><primary>files</primary><secondary>with privilege information</secondary>
</indexterm><indexterm><primary>configuration files</primary><secondary>with privilege information</secondary>
</indexterm><para><indexterm><primary>defaults</primary><secondary>privilege settings in <filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>keywords</secondary><tertiary>for privileges</tertiary></indexterm>The following files contain information about privileges.</para><table frame="topbot" pgwide="1" id="privref-tbl-2"><title>Files That Contain
 Privilege Information</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec3" colwidth="39.56*"/><colspec colname="colspec1" colwidth="43.07*"/><colspec colname="colspec4" colwidth="30.95*"/><thead><row rowsep="1"><entry><para>File and Man Page</para>
</entry><entry><para>Keyword</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry morerows="1" rowsep="1"><para><filename>/etc/security/policy.conf</filename></para><para><olink targetdoc="group-refman" targetptr="policy.conf-4" remap="external"><citerefentry><refentrytitle>policy.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry><entry><para><indexterm><primary><literal>PRIV_DEFAULT</literal> keyword</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><literal>PRIV_DEFAULT</literal></para>
</entry><entry><para>Inheritable set of privileges for the system</para>
</entry>
</row><row><entry rowsep="1"><para><indexterm><primary><literal>PRIV_LIMIT</literal> keyword</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><literal>PRIV_LIMIT</literal></para>
</entry><entry rowsep="1"><para>Limit set of privileges for the system</para>
</entry>
</row><row><entry morerows="1" rowsep="1"><para><filename>/etc/user_attr</filename></para><para><olink targetdoc="group-refman" targetptr="user-attr-4" remap="external"><citerefentry><refentrytitle>user_attr</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry><entry rowsep="0"><para><indexterm><primary><literal>defaultpriv</literal> keyword </primary><secondary><filename>user_attr</filename> database</secondary></indexterm><indexterm><primary><filename>user_attr</filename> database</primary><secondary><literal>defaultpriv</literal> keyword</secondary></indexterm><literal>defaultpriv</literal> keyword in user or role's entry</para><para>Value is usually set in the Solaris Management Console GUI</para>
</entry><entry rowsep="0"><para>Inheritable set of privileges for a user or role</para>
</entry>
</row><row><entry rowsep="1"><para><indexterm><primary><literal>limitpriv</literal> keyword</primary><secondary><filename>user_attr</filename> database</secondary></indexterm><indexterm><primary><filename>user_attr</filename> database</primary><secondary><literal>limitpriv</literal> keyword</secondary></indexterm><literal>limitpriv</literal> keyword in user or role's entry</para><para>Value is usually set in the Solaris Management Console GUI</para>
</entry><entry rowsep="1"><para>Limit set of privileges for a user or role</para>
</entry>
</row><row><entry rowsep="1"><para><filename>/etc/security/exec_attr</filename></para><para><olink targetdoc="group-refman" targetptr="exec-attr-4" remap="external"><citerefentry><refentrytitle>exec_attr</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry><entry rowsep="1"><para><literal>privs</literal> keyword in the profile's entry for the command</para><para>Policy for the command must be <literal>solaris</literal></para>
</entry><entry rowsep="1"><para>List of privileges that are assigned to a command in a rights profile</para>
</entry>
</row><row><entry rowsep="1"><para><filename>syslog.conf</filename></para><para><olink targetdoc="group-refman" targetptr="syslog.conf-4" remap="external"><citerefentry><refentrytitle>syslog.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry><entry rowsep="1"><para>System log file for debug messages</para><para><indexterm><primary>configuration files</primary><secondary><filename>syslog.conf</filename> file</secondary></indexterm><indexterm><primary><literal>priv.debug</literal> entry</primary><secondary><filename>syslog.conf</filename> file</secondary></indexterm><indexterm><primary><filename>syslog.conf</filename> file</primary><secondary><literal>priv.debug</literal> entry</secondary></indexterm>Path set in <literal>priv.debug</literal> entry</para>
</entry><entry rowsep="1"><para>Privilege debugging log</para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>Do not edit the <filename>exec_attr</filename> and <filename>user_attr</filename> databases directly. To administer privileges, use the Solaris
Management Console, or commands such as <command>smuser</command>. For more
information, see the <olink targetdoc="group-refman" targetptr="smc-1m" remap="external"><citerefentry><refentrytitle>smc</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and
the <olink targetdoc="group-refman" targetptr="smuser-1m" remap="external"><citerefentry><refentrytitle>smuser</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
pages. For procedures, see <olink targetptr="privtask-14" remap="internal">Managing Privileges
(Task Map)</olink>.</para>
</note>
</sect1><sect1 id="privref-18"><title>Privileges and Auditing</title><indexterm><primary>auditing</primary><secondary>privileges and</secondary>
</indexterm><indexterm><primary>privileges</primary><secondary>auditing and</secondary>
</indexterm><itemizedlist><para>Privilege use can be audited. When a process uses a privilege, the use
of privilege is recorded in the audit trail. The privileges are recorded in
their textual representation. The following audit events record use of privilege:</para><listitem><para><literal>AUE_SETPPRIV</literal> <emphasis role="strong">audit
event &ndash;</emphasis>  The event generates an audit record when a privilege
set is changed. The <literal>AUE_SETPPRIV</literal> audit event is in the <literal>pm</literal> class.</para>
</listitem><listitem><para><literal>AUE_MODALLOCPRIV</literal> <emphasis role="strong">audit
event &ndash;</emphasis> The audit event generates an audit record when a
privilege is added from outside the kernel. The <literal>AUE_MODALLOCPRIV</literal> audit
event is in the <literal>ad</literal> class.</para>
</listitem><listitem><para><literal>AUE_MODDEVPLCY</literal> <emphasis role="strong">audit
event &ndash;</emphasis>  The audit event generates an audit record when the
device policy is changed. The <literal>AUE_MODDEVPLCY</literal> audit event
is in the <literal>ad</literal> class.</para>
</listitem><listitem><para><literal>AUE_prof_cmd</literal> <emphasis role="strong">audit
event &ndash;</emphasis>  The audit event generates an audit record when a
command is executed in a profile shell. The <literal>AUE_prof_cmd</literal> audit
event is in the <literal>as</literal> and <literal>ua</literal> audit classes.</para>
</listitem>
</itemizedlist><para>The successful use of privileges that are in the basic set is not audited.
The attempt to use a basic privilege that has been removed from a user's basic
set is audited.</para>
</sect1><sect1 id="privref-20"><title>Prevention of Privilege Escalation</title><para><indexterm><primary>privileges</primary><secondary>escalation</secondary></indexterm>The Solaris kernel prevents <firstterm>privilege escalation</firstterm>.
Privilege escalation is when a privilege enables a process to do more than
the process should be able to do. To prevent a process from gaining more privileges
than the process should have, certain system modifications require the full
set of privileges. For example, a file or process that is owned by <literal>root</literal> (<literal>UID=0</literal>) can only be changed by a process with the full set of privileges.
The <literal>root</literal> user does not require privileges to change a file
that <literal>root</literal> owns. However, a non-root user must have all
privileges in order to change a file that is owned by <literal>root</literal>.</para><para>Similarly, operations that provide access to devices require all privileges
in the effective set.</para><para>The <constant>file_chown_self</constant> and <constant>proc_owner</constant> privileges
are subject to privilege escalation. The <constant>file_chown_self</constant> privilege
allows a process to give away its files. The <constant>proc_owner</constant> privilege
allows a process to inspect processes that the process does not own.</para><para>The <constant>file_chown_self</constant> privilege is limited by the <constant>rstchown</constant> system variable. When the <constant>rstchown</constant> variable
is set to zero, the <constant>file_chown_self</constant> privilege is removed
from the initial inheritable set of the system and of all users. For more
information on the <constant>rstchown</constant> system variable, see the <olink targetdoc="group-refman" targetptr="chown-1" remap="external"><citerefentry><refentrytitle>chown</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page.</para><para>The <constant>file_chown_self</constant> privilege is most safely assigned
to a particular command, placed in a profile, and assigned to a role for use
in a profile shell.</para><para>The <constant>proc_owner</constant> privilege is not sufficient to switch
a process UID to <literal>0</literal>. To switch a process from any UID to <literal>UID=0</literal> requires all privileges. Because the <constant>proc_owner</constant> privilege
gives unrestricted read access to all files on the system, the privilege is
most safely assigned to a particular command, placed in a profile, and assigned
to a role for use in a profile shell.</para><caution><para>A user's account can be modified to include the <constant>file_chown_self</constant> privilege or the <constant>proc_owner</constant> privilege in
the user's initial inheritable set. You should have overriding security reasons
for placing such powerful privileges in the inheritable set of privileges
for any user, role, or system.</para>
</caution><para>For details of how privilege escalation is prevented for devices, see <olink targetptr="prbac-23" remap="internal">Privileges and Devices</olink>.</para>
</sect1><sect1 id="privref-22"><title>Legacy Applications and the Privilege Model</title><para>To accommodate legacy applications, the implementation of privileges
works with both the superuser and the privilege models. The kernel automatically
tracks the <literal>PRIV_AWARE</literal> flag, which indicates that a program
has been designed to work with privileges. Consider a child process that is
not aware of privileges. Any privileges that were inherited from the parent
process are available in the child's permitted and effective sets. If the
child process sets a UID to 0, the child process might not have full superuser
capabilities. The process's effective and permitted sets are restricted to
those privileges in the child's limit set. Thus, the limit set of a privilege-aware
process restricts the root privileges of child processes that are not aware
of privileges.</para>
</sect1>
</chapter><?Pub *0000018400 0?>