<?Pub UDT _bookmark _target?><?Pub CX solbook(?><chapter id="concept-1"><?Pub Tag atict:info tracking="off" ref="0"?><?Pub Tag atict:user
user="sharonr" fullname="Sharon Veach"?><title>Managing Machine Security (Overview)</title><highlights><para>Keeping a machine's information secure is an important system administration
responsibility. This chapter provides overview information about managing
machine security.</para><para>The following is a list of the overview information in this chapter.</para><itemizedlist><listitem><para><olink targetptr="concept-50" remap="internal">Enhancements to Machine Security
in the Solaris 10 Release</olink></para>
</listitem><listitem><para><olink targetptr="concept-28" remap="internal">Controlling Access to a Computer
System</olink></para>
</listitem><listitem><para><olink targetptr="concept-42" remap="internal">Controlling Access to Devices</olink></para>
</listitem><listitem><para><olink targetptr="concept-13" remap="internal">Controlling Access to Machine
Resources</olink></para>
</listitem><listitem><para><olink targetptr="concept-36" remap="internal">Controlling Access to Files</olink></para>
</listitem><listitem><para><olink targetptr="concept-4" remap="internal">Controlling Network Access</olink></para>
</listitem><listitem><para><olink targetptr="concept-10" remap="internal">Reporting Security Problems</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="concept-50"><title>Enhancements to Machine Security in the Solaris 10 Release</title><indexterm><primary>new features</primary><secondary>system security enhancements</secondary>
</indexterm><itemizedlist><para>Since the Solaris 9 release, the following features have been introduced
to enhance system security:</para><listitem><para>Strong password encryption is available and configurable.
For more information, see <olink targetptr="concept-23" remap="internal">Password Encryption</olink>.</para>
</listitem><listitem><para>Device policy is enforced with privileges. For more information,
see <olink targetptr="devmgt-6" remap="internal">Device Policy (Overview)</olink>.</para><para>For
device allocation, the <filename class="directory">/etc/security/dev</filename> directory
might not be supported in future releases of the Solaris OS.</para>
</listitem><listitem><para>The Basic Audit Reporting Tool (BART) can monitor the authenticity
of the files on your system. For more information, see <olink targetptr="bart-1" remap="internal">Chapter&nbsp;6, Using the Basic Audit Reporting Tool (Tasks)</olink>.</para>
</listitem><listitem><para>Files can be protected with strong encryption. For more information,
see <olink targetptr="concept-19" remap="internal">Protecting Files With Encryption</olink>.</para>
</listitem><listitem><para>Privileges enforce process rights at the kernel level. For
more information, see <olink targetptr="prbac-2" remap="internal">Privileges (Overview)</olink>.</para>
</listitem><listitem><para>The Solaris Cryptographic Framework centralizes cryptographic
services for providers and for consumers. For more information, see <olink targetptr="scf-1" remap="internal">Chapter&nbsp;13, Solaris Cryptographic Framework (Overview)</olink>.</para>
</listitem><listitem><para>The PAM framework provides functionality for many programs,
such as Solaris Secure Shell. For more information, see <olink targetptr="pam-38" remap="internal">Changes
to PAM for the Solaris 10 Release</olink>.</para>
</listitem><listitem><para>Solaris zones and resource management control access to machine
resources. For more information, see <olink targetdoc="sysadrm" remap="external"><citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="concept-28"><title>Controlling Access to a Computer System</title><para><indexterm><primary>environment variables</primary><seealso>variables</seealso></indexterm><indexterm><primary>system variables</primary><seealso>variables</seealso></indexterm><indexterm><primary>name services</primary><seealso>individual name services</seealso></indexterm><indexterm><primary>user accounts</primary><seealso>users</seealso></indexterm><indexterm><primary>system security</primary><secondary>overview</secondary></indexterm><indexterm><primary>managing</primary><seealso>administering</seealso></indexterm>In the workplace, all machines
that are connected to a server can be thought of as one large multifaceted
system. You are responsible for the security of this larger system. You need
to defend the network from outsiders who are trying to gain access to the
network. You also need to ensure the integrity of the data on the machines
within the network.</para><para>At the file level, the Solaris OS provides standard security features that
you can use to protect files, directories, and devices. At the system and
network levels, the security issues are mostly the same. The first line of
security defense is to control access to your system.</para><itemizedlist><para>You can control and monitor system access by doing the following:</para><listitem><para><olink targetptr="concept-16" remap="internal">Maintaining Physical Security</olink></para>
</listitem><listitem><para><olink targetptr="concept-2" remap="internal">Maintaining Login Control</olink></para>
</listitem><listitem><para><olink targetptr="concept-42" remap="internal">Controlling Access to Devices</olink></para>
</listitem><listitem><para><olink targetptr="concept-13" remap="internal">Controlling Access to Machine
Resources</olink></para>
</listitem><listitem><para><olink targetptr="concept-36" remap="internal">Controlling Access to Files</olink></para>
</listitem><listitem><para><olink targetptr="concept-4" remap="internal">Controlling Network Access</olink></para>
</listitem><listitem><para><olink targetptr="concept-10" remap="internal">Reporting Security Problems</olink></para>
</listitem>
</itemizedlist><sect2 id="concept-16"><title>Maintaining Physical Security</title><indexterm><primary>access</primary><secondary>security</secondary><tertiary>physical security</tertiary>
</indexterm><indexterm><primary>physical security</primary><secondary>description</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>hardware protection</secondary>
</indexterm><indexterm><primary>hardware</primary><secondary>protecting</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>machine access</secondary>
</indexterm><para>To control access to your system, you must maintain the physical security
of your computing environment. For instance, a system that is logged in and
left unattended is vulnerable to unauthorized access. An intruder can gain
access to the operating system and to the network. The computer's surroundings
and the computer hardware should be physically protected from unauthorized
access.</para><para><indexterm><primary>passwords</primary><secondary>PROM security mode</secondary></indexterm><indexterm><primary><command>eeprom</command> command</primary></indexterm>You can protect a SPARC system from unauthorized access to the
hardware settings. Use the <command>eeprom</command> command to require a
password to access the PROM. For more information, see <olink targetptr="secsys-38" remap="internal">How to Require a Password for Hardware Access</olink>.</para>
</sect2><sect2 id="concept-2"><title>Maintaining Login Control</title><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary>login control</tertiary></indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>system access control</tertiary></indexterm><indexterm><primary>passwords</primary><secondary>login security</secondary></indexterm>You also must prevent unauthorized logins to a system or the network,
which you can do through password assignment and login control. All accounts
on a system should have a password. A password is a simple authentication
mechanism. An account without a password makes your entire network accessible
to an intruder who guesses a user name. A strong password algorithm protects
against brute force attacks.</para><itemizedlist><para><indexterm><primary>configuration files</primary><secondary><filename>nsswitch.conf</filename> file</secondary></indexterm><indexterm><primary><filename>nsswitch.conf</filename> file</primary><secondary>login access restrictions</secondary></indexterm>When a user logs in to a system, the <command>login</command> command
checks the appropriate name service or directory service database according
to the information that is listed in the <filename>/etc/nsswitch.conf</filename> file.
This file can include the following entries:</para><listitem><para><literal>files</literal> &ndash; Designates the <filename>/etc</filename> files
on the local system</para>
</listitem><listitem><para><literal>ldap</literal> &ndash; Designates the LDAP directory
service on the LDAP server</para>
</listitem><listitem><para><literal>nis</literal> &ndash; Designates the NIS database
on the NIS master server</para>
</listitem><listitem><para><literal>nisplus</literal> &ndash; Designates the NIS+ database
on the NIS+ root server</para>
</listitem>
</itemizedlist><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary>login access restrictions</tertiary></indexterm><indexterm><primary><filename>/etc/nsswitch.conf</filename> file</primary></indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>access restrictions</tertiary></indexterm><indexterm><primary>system security</primary><secondary>login access restrictions</secondary></indexterm>For a description of the <filename>nsswitch.conf</filename> file, see the <olink targetdoc="group-refman" targetptr="nsswitch.conf-4" remap="external"><citerefentry><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page. For information
about naming services and directory services, see the <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink> or the <olink targetdoc="sysadv7" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (NIS+)</citetitle></olink>.
 </para><para><indexterm><primary>passwords</primary><secondary>login security</secondary></indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>login access restrictions</tertiary></indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>access restrictions</tertiary></indexterm><indexterm><primary>system security</primary><secondary>login access restrictions</secondary></indexterm>The <command>login</command> command
verifies the user name and password that were supplied by the user. If the
user name is not in the password file, the <command>login</command> command
denies access to the system. If the password is not correct for the user name
that was specified, the <command>login</command> command denies access to
the system. When the user supplies a valid user name and its corresponding
password, the system grants the user access to the system.</para><para>PAM modules can streamline login to applications after a successful
system login. For more information, see <olink targetptr="pam-1" remap="internal">Chapter&nbsp;17,
Using PAM</olink>.</para><para>Sophisticated authentication and authorization mechanisms are available
on Solaris systems. For a discussion of authentication and authorization mechanisms
at the network level, see <olink targetptr="concept-31" remap="internal">Authentication and
Authorization for Remote Access</olink>.</para><sect3 id="concept-41"><title>Managing Password Information</title><para><indexterm><primary>passwords</primary><secondary>login security</secondary></indexterm><indexterm><primary>passwords</primary><secondary>system logins</secondary></indexterm><indexterm><primary>system security</primary><secondary>passwords</secondary></indexterm>When users log in to a system, they must supply both a user name
and a password. Although logins are publicly known, passwords must be kept
secret. Passwords should be known only to each user. You should ask your users
to choose their passwords carefully. Users should change their passwords often.</para><para>Passwords are initially created when you set up a user account. To maintain
security on user accounts, you can set up password aging to force users to
routinely change their passwords. You can also disable a user account by locking
the password. For detailed information about administering passwords, see <olink targetdoc="group-sa" targetptr="userconcept-97366" remap="external">Chapter 4, <citetitle remap="chapter">Managing User Accounts and Groups (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink> and
the <olink targetdoc="group-refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para><sect4 id="concept-24"><title>Local Passwords</title><para><indexterm><primary>passwords</primary><secondary>local</secondary></indexterm>If your network uses local files to authenticate users, the password
information is kept in the system's <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename> files. The user name and other information are kept
in the password file <filename>/etc/passwd</filename>. The encrypted password
itself is kept in a separate <emphasis>shadow</emphasis> file, <filename>/etc/shadow</filename>. This security measure prevents a user from gaining access to
the encrypted passwords. While the <filename>/etc/passwd</filename> file is
available to anyone who can log in to a system, only superuser or an equivalent
role can read the <filename>/etc/shadow</filename> file. You can use the <command>passwd</command> command to change a user's password on a local system.</para>
</sect4><sect4 id="concept-22"><title>NIS and NIS+ Passwords</title><indexterm><primary>passwords</primary><secondary>NIS+</secondary>
</indexterm><indexterm><primary>NIS+ name service</primary><secondary>passwords</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>changing with <command>passwd -r</command> command</secondary>
</indexterm><indexterm><primary><option>r</option> option</primary><secondary><command>passwd</command> command</secondary>
</indexterm><indexterm><primary><command>passwd</command> command</primary><secondary>and name services</secondary>
</indexterm><para><indexterm><primary>passwords</primary><secondary>NIS</secondary></indexterm><indexterm><primary>NIS name service</primary><secondary>passwords</secondary></indexterm>If your network uses NIS to authenticate users, password information
is kept in the NIS password map. NIS does not support password aging. You
can use the command <command>passwd -r nis</command> to change a user's password
that is stored in an NIS password map.</para><para>If your network uses NIS+ to authenticate users, password information
is kept in the NIS+ database. Information in the NIS+ database can be protected
by restricting access to authorized users only. You can use the <command>passwd
-r nisplus</command> command to change a user's password that is stored in
an NIS+ database.</para>
</sect4><sect4 id="concept-40"><title>LDAP Passwords</title><para><indexterm><primary>passwords</primary><secondary>LDAP</secondary></indexterm><indexterm><primary>LDAP name service</primary><secondary>passwords</secondary></indexterm>The Solaris LDAP naming service stores password information and
shadow information in the <literal>ou=people</literal> container of the LDAP
directory tree. On the Solaris LDAP naming service client, you can use the <command>passwd -r ldap</command> command to change a user's password. The LDAP naming
service stores the password in the LDAP repository.</para><para>In the Solaris 10 release, password policy is enforced on the Sun <trademark>Java</trademark> System Directory Server. Specifically, the client's <literal>pam_ldap</literal> module follows the password policy controls that are enforced on
the Sun Java System Directory Server. For more information, see <olink targetdoc="group-sa" targetptr="ldapsecure-66" remap="external"><citetitle remap="section">LDAP Naming Services Security Model</citetitle> in <citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</sect4>
</sect3><sect3 id="concept-23"><title>Password Encryption</title><para><indexterm><primary>new features</primary><secondary>strong password encryption</secondary></indexterm><indexterm><primary>security</primary><secondary>password encryption</secondary></indexterm><indexterm><primary>algorithms</primary><secondary>password encryption</secondary></indexterm><indexterm><primary>modules</primary><secondary>password encryption</secondary></indexterm><indexterm><primary>passwords</primary><secondary>encryption algorithms</secondary></indexterm><indexterm><primary>encryption</primary><secondary>password algorithm</secondary></indexterm><indexterm><primary>system security</primary><secondary>password encryption</secondary></indexterm><indexterm><primary>configuration decisions</primary><secondary>password algorithm</secondary></indexterm>Strong password encryption
provides an early barrier against attack. Solaris software provides four password
encryption algorithms. The two <olink targetptr="glossary-84" remap="internal">MD5</olink> algorithms
and the <olink targetptr="glossary-133" remap="internal">Blowfish</olink> algorithm provide
more robust password encryption than the UNIX algorithm.</para><sect4 id="concept-45"><title>Password Algorithm Identifiers</title><para><indexterm><primary>defaults</primary><secondary>system-wide in <filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary>configuration files</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary>configuration files</primary><secondary sortas="password algorithms">for password algorithms</secondary></indexterm><indexterm><primary>encryption</primary><secondary>list of password algorithms</secondary></indexterm><indexterm><primary>encryption</primary><secondary>specifying password algorithms in <filename>policy.conf</filename> file</secondary></indexterm>You specify the algorithms configuration for your site in the <filename>/etc/security/policy.conf</filename> file. In the <filename>policy.conf</filename> file,
the algorithms are named by their identifier, as shown in the following table.</para><table frame="topbot" id="concept-encralg-1"><title>Password Encryption Algorithms</title><tgroup cols="3" colsep="0" rowsep="0"><?PubTbl tgroup dispwid="4.68in"?><colspec colname="colspec0" colwidth="19.52*"/><colspec colname="colspec2" colwidth="80.37*"/><colspec colname="colspec3" colwidth="28.71*"/><thead><row rowsep="1"><entry><para>Identifier</para>
</entry><entry><para>Description</para>
</entry><entry><para>Algorithm Man Page</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>1</literal></para>
</entry><entry><para><indexterm><primary><literal>crypt_bsdmd5</literal> password algorithm</primary></indexterm>The MD5 algorithm that is compatible with MD5 algorithms on BSD
and Linux systems.</para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="crypt-bsdmd5-5" remap="external"><citerefentry><refentrytitle>crypt_bsdmd5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>2a</literal></para>
</entry><entry><para><indexterm><primary><literal>crypt_bsdbf</literal> password algorithm</primary></indexterm>The Blowfish algorithm that is compatible with the Blowfish algorithm
on BSD systems.</para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="crypt-bsdbf-5" remap="external"><citerefentry><refentrytitle>crypt_bsdbf</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>md5</literal></para>
</entry><entry><para><indexterm><primary><literal>crypt_sunmd5</literal> password algorithm</primary></indexterm>The Sun MD5 algorithm, which is considered stronger than the BSD
and Linux version of MD5.</para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="crypt-sunmd5-5" remap="external"><citerefentry><refentrytitle>crypt_sunmd5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>__unix__</literal></para>
</entry><entry><para><indexterm><primary><literal>crypt_unix</literal> password algorithm</primary></indexterm>The traditional UNIX encryption algorithm. This algorithm is the
default module in the <filename>policy.conf</filename> file.</para>
</entry><entry><para><olink targetdoc="group-refman" targetptr="crypt-unix-5" remap="external"><citerefentry><refentrytitle>crypt_unix</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect4><sect4 id="concept-63"><title>Algorithms Configuration in the <filename>policy.conf</filename> File</title><para>The following shows the default algorithms configuration in the <filename>policy.conf</filename> file:</para><screen>#
&hellip;
# crypt(3c) Algorithms Configuration
#
# CRYPT_ALGORITHMS_ALLOW specifies the algorithms that are allowed to
# be used for new passwords.  This is enforced only in crypt_gensalt(3c).
#
CRYPT_ALGORITHMS_ALLOW=1,2a,md5

# To deprecate use of the traditional unix algorithm, uncomment below
# and change CRYPT_DEFAULT= to another algorithm.  For example,
# CRYPT_DEFAULT=1 for BSD/Linux MD5.
#
#CRYPT_ALGORITHMS_DEPRECATE=__unix__

# The Solaris default is the traditional UNIX algorithm.  This is not
# listed in crypt.conf(4) since it is internal to libc.  The reserved
# name __unix__ is used to refer to it.
#
CRYPT_DEFAULT=__unix__
&hellip;</screen><para><indexterm><primary><literal>CRYPT_ALGORITHMS_ALLOW</literal> keyword</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary><literal>CRYPT_ALGORITHMS_DEPRECATE</literal> keyword</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary><literal>CRYPT_DEFAULT</literal> keyword</primary><secondary><filename>policy.conf</filename> file</secondary></indexterm><indexterm><primary><filename>policy.conf</filename> file</primary><secondary>keywords</secondary><tertiary>for password algorithms</tertiary></indexterm>When you change the value for <literal>CRYPT_DEFAULT</literal>, the passwords of new users are encrypted with the algorithm that
is associated with the new value. When current users change their passwords,
how their old password was encrypted affects which algorithm is used to encrypt
the new password.</para><para>For example, assume that <literal>CRYPT_ALGORITHMS_ALLOW=1,2a,md5</literal> and <literal>CRYPT_DEFAULT=1</literal>. The following table shows which algorithm would
be used to generate the encrypted password.</para><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="19.00*"/><colspec colname="colspec2" colwidth="19.40*"/><colspec colname="colspec1" colwidth="60.60*"/><thead><row><entry namest="colspec0" nameend="colspec2" rowsep="1"><para>Identifier = Password Algorithm</para>
</entry><entry morerows="1" rowsep="1"><para>Explanation</para>
</entry>
</row><row rowsep="1"><entry><para>Initial Password</para>
</entry><entry><para>Changed Password</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>1</literal> = <literal>crypt_bsdmd5</literal></para>
</entry><entry><para>Uses same algorithm</para>
</entry><entry><para>The <literal>1</literal> identifier is also the value of <literal>CRYPT_DEFAULT</literal>. The user's password continues to be encrypted with the <literal>crypt_bsdmd5</literal> algorithm.</para>
</entry>
</row><row><entry><para><literal>2a</literal> = <literal>crypt_bsdbf</literal></para>
</entry><entry><para>Uses same algorithm</para>
</entry><entry><para>The <literal>2a</literal> identifier is in the <literal>CRYPT_ALGORITHMS_ALLOW</literal> list. Therefore, the new password is encrypted with the <literal>crypt_bsbdf</literal> algorithm.</para>
</entry>
</row><row><entry><para><literal>md5</literal> = <literal>crypt_md5</literal></para>
</entry><entry><para>Uses same algorithm</para>
</entry><entry><para>The <literal>md5</literal> identifier is in the <literal>CRYPT_ALGORITHMS_ALLOW</literal> list. Therefore, the new password is encrypted with the <literal>crypt_md5</literal> algorithm.</para>
</entry>
</row><row><entry><para><literal>__unix__</literal> = <literal>crypt_unix</literal></para>
</entry><entry><para>Uses <literal>crypt_bsdmd5</literal> algorithm</para>
</entry><entry><para>The <literal>__unix__</literal> identifier is not in the <literal>CRYPT_ALGORITHMS_ALLOW</literal> list. Therefore, the <literal>crypt_unix</literal> algorithm cannot
be used. The new password is encrypted with the <literal>CRYPT_DEFAULT</literal> algorithm.</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>For more information on configuring the algorithm choices, see the <olink targetdoc="group-refman" targetptr="policy.conf-4" remap="external"><citerefentry><refentrytitle>policy.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.
To specify password encryption algorithms, see <olink targetptr="secsys-15" remap="internal">Changing
the Password Algorithm (Task Map)</olink>.</para>
</sect4>
</sect3><sect3 id="concept-21"><title>Special System Logins</title><para><indexterm><primary>access</primary><secondary>system logins</secondary></indexterm><indexterm><primary>logging in</primary><secondary>system logins</secondary></indexterm><indexterm><primary>system security</primary><secondary>special logins</secondary></indexterm><indexterm><primary>passwords</primary><secondary>system logins</secondary></indexterm>Two common ways to access a system are by using
a conventional user login, or by using the <literal>root</literal> login.
In addition, a number of special <emphasis>system</emphasis> logins enable
a user to run administrative commands without using the <literal>root</literal> account.
As system administrator, you assign passwords to these login accounts.</para><para><indexterm><primary>group ID numbers (GIDs)</primary><secondary>special logins and</secondary></indexterm><indexterm><primary>logging in</primary><secondary><literal>root</literal> login</secondary><tertiary>account</tertiary></indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>login account</secondary><tertiary>description</tertiary></indexterm>The
following table lists some system login accounts and their uses. The system
logins perform special functions. Each login has its own group identification
number (GID). Each login should have its own password, which should be divulged
on a need-to-know basis.</para><table frame="topbot" id="concept-53"><title>System Login Accounts and Their
Uses</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="61.46*"/><colspec colname="column2" colwidth="23.68*"/><colspec colname="column3" colwidth="276.85*"/><thead><row rowsep="1"><entry><para>Login Account</para>
</entry><entry><para>GID</para>
</entry><entry><para>Use </para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>root</literal> </para>
</entry><entry><para><literal>0</literal> </para>
</entry><entry><para>Has almost no restrictions. Overrides all other logins, protections,
and permissions. The <literal>root</literal> account has access to the entire
system. The password for the <literal>root</literal> login should be very
carefully protected. The <literal>root</literal> account, superuser, owns
most of the Solaris commands.</para>
</entry>
</row><row><entry><para><literal>daemon</literal> </para>
</entry><entry><para><literal>1</literal></para>
</entry><entry><para>Controls background processing.</para>
</entry>
</row><row><entry><para><literal>bin</literal> </para>
</entry><entry><para><literal>2</literal></para>
</entry><entry><para>Owns some Solaris commands.</para>
</entry>
</row><row><entry><para><literal>sys</literal> </para>
</entry><entry><para><literal>3</literal></para>
</entry><entry><para>Owns many system files.</para>
</entry>
</row><row><entry><para><literal>adm</literal> </para>
</entry><entry><para><literal>4</literal></para>
</entry><entry><para>Owns certain administrative files.</para>
</entry>
</row><row><entry><para><literal>lp</literal> </para>
</entry><entry><para><literal>71</literal></para>
</entry><entry><para>Owns the object data files and spooled data files for the printer.</para>
</entry>
</row><row><entry><para><literal>uucp</literal> </para>
</entry><entry><para><literal>5</literal></para>
</entry><entry><para>Owns the object data files and spooled data files for UUCP, the UNIX-to-UNIX
copy program.</para>
</entry>
</row><row><entry><para><literal>nuucp</literal> </para>
</entry><entry><para><literal>9</literal></para>
</entry><entry><para>Is used by remote systems to log in to the system and start file transfers.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect3><sect3 id="concept-18"><title>Remote Logins</title><para>Remote logins offer a tempting avenue for intruders. The Solaris OS provides
several commands to monitor, limit, and disable remote logins. For procedures,
see <olink targetptr="secsys-25" remap="internal">Securing Logins and Passwords (Task Map)</olink>.</para><para><indexterm><primary>devices</primary><secondary>login access control</secondary></indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>access control on devices</tertiary></indexterm><indexterm><primary><filename>/etc/logindevperm</filename> file</primary></indexterm>By default, remote
logins cannot gain control or read certain system devices, such as the system
mouse, keyboard, frame buffer, or audio device. For more information, see
the <olink targetdoc="group-refman" targetptr="logindevperm-4" remap="external"><citerefentry><refentrytitle>logindevperm</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="concept-12"><title>Dial-Up Logins</title><indexterm><primary>dial-up passwords</primary><secondary>security</secondary>
</indexterm><indexterm><primary>system security</primary><secondary>dial-up logins and passwords</secondary>
</indexterm><para>When a computer can be accessed through a modem or a dial-up port, you
can add an extra layer of security. You can require a <emphasis>dial-up password</emphasis> for
users who access a system through a modem or dial-up port. The dial-up password
is an additional password that a user must supply before being granted access
to the system.</para><para>Only superuser or a role of equivalent capabilities can create or change
a dial-up password. To ensure the integrity of the system, the password should
be changed about once a month. The most effective use of this feature is to
require a dial-up password to gain access to a gateway system. To set up dial-up
passwords, see <olink targetptr="secsys-33" remap="internal">How to Create a Dial-Up Password</olink>.</para><itemizedlist><para>Two files are involved in creating a dial-up password, <filename>/etc/dialups</filename> and <filename>/etc/d_passwd</filename>. The <filename>dialups</filename> file
contains a list of ports that require a dial-up password. The <filename>d_passwd</filename> file
contains a list of shell programs that require an encrypted password as the
additional dial-up password. The information in these two files is processed
as follows:</para><listitem><para><indexterm><primary><filename>d_passwd</filename> file</primary><secondary>description</secondary></indexterm><indexterm><primary><filename>/etc/d_passwd</filename> file</primary><secondary>and <filename>/etc/passwd</filename> file</secondary></indexterm><indexterm><primary><filename>passwd</filename> file</primary><secondary>and <filename>/etc/d_passwd</filename> file</secondary></indexterm><indexterm><primary>passwords</primary><secondary>dial-up passwords</secondary><tertiary><filename>/etc/d_passwd</filename> file</tertiary></indexterm>If the user's login shell
in <filename>/etc/passwd</filename> matches an entry in <filename>/etc/d_passwd</filename>,
the user must supply a dial-up password.</para>
</listitem><listitem><para>If the user's login shell in <filename>/etc/passwd</filename> is
not found in <filename>/etc/d_passwd</filename>, the user must supply the
default password. The default password is the entry for <filename>/usr/bin/sh</filename>.</para>
</listitem><listitem><para>If the login shell field in <filename>/etc/passwd</filename> is
empty, the user must supply the default password. The default password is
the entry for <filename>/usr/bin/sh</filename>.</para>
</listitem><listitem><para>If <filename>/etc/d_passwd</filename> has no entry for <filename>/usr/bin/sh</filename>, then those users whose login shell field in <filename>/etc/passwd</filename> is empty or does not match any entry in <filename>/etc/d_passwd</filename> are
not prompted for a dial-up password.</para>
</listitem><listitem><para><indexterm><primary>dial-up passwords</primary><secondary>disabling</secondary></indexterm><indexterm><primary>dial-up passwords</primary><secondary><filename>/etc/d_passwd</filename> file</secondary></indexterm><indexterm><primary>shell commands</primary><secondary><filename>/etc/d_passwd</filename> file entries</secondary></indexterm>Dial-up logins are disabled if <filename>/etc/d_passwd</filename> has the <literal>/usr/bin/sh:*:</literal> entry only.</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>
</sect1><sect1 id="concept-42"><title>Controlling Access to Devices</title><indexterm><primary>devices</primary><secondary>security</secondary>
</indexterm><indexterm><primary>security</primary><secondary>devices</secondary>
</indexterm><indexterm><primary>device policy</primary><secondary>overview</secondary>
</indexterm><indexterm><primary>access</primary><secondary>restricting for</secondary><tertiary>devices</tertiary>
</indexterm><para>Peripheral devices that are attached to a computer system pose a security
risk. Microphones can pick up conversations and transmit them to remote systems.
CD-ROMs can leave their information behind for reading by the next user of
the CD-ROM device. Printers can be accessed remotely. Devices that are integral
to the system can also present security issues. For example, network interfaces
such as <literal>hme0</literal> are considered integral devices.</para><para>Solaris software provides two methods of controlling access to devices. <emphasis>Device policy</emphasis> restricts or prevents access to devices that are
integral to the system. Device policy is enforced in the kernel. <emphasis>Device
allocation</emphasis> restricts or prevents access to peripheral devices.
Device allocation is enforced at user allocation time.</para><para><indexterm><primary>devices</primary><secondary>protecting in the kernel</secondary></indexterm>Device policy uses <olink targetptr="glossary-82" remap="internal">privilege</olink>s
to protect selected devices in the kernel. For example, the device policy
on network interfaces such as <literal>hme</literal> requires all privileges
for reading or writing.</para><para><indexterm><primary>devices</primary><secondary>protecting by device allocation</secondary></indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>peripheral devices</tertiary></indexterm>Device allocation uses authorizations to protect peripheral devices,
such as printers or microphones. By default, device allocation is not enabled.
Once enabled, device allocation can be configured to prevent the use of a
device or to require authorization for access to the device. When a device
is allocated for use, no other user can access the device until the current
user deallocates it.</para><itemizedlist><para>A Solaris system can be configured in several areas to control access
to devices:</para><listitem><para><emphasis role="strong">Set device policy &ndash;</emphasis> In
the Solaris 10 release, you can require that the process that is accessing a particular
device be running with a set of privileges. Processes without those privileges
cannot use the device. At boot time, Solaris software configures device policy.
Third-party drivers can be configured with device policy during installation.
After installation, you, as the system administrator can add device policy
to a device.</para>
</listitem><listitem><para><emphasis role="strong">Make devices allocatable &ndash;</emphasis> When
you enable device allocation, you can restrict the use of a device to one
user at a time. You can further require that the user fulfill some security
requirements. For example, you can require that the user be authorized to
use the device.</para>
</listitem><listitem><para><emphasis role="strong">Prevent devices from being used &ndash;</emphasis> You
can prevent the use of a device, such as a microphone, by any user on a computer
system. A computer kiosk might be a good candidate for making certain devices
unavailable for use.</para>
</listitem><listitem><para><indexterm><primary>devices</primary><secondary>zones and</secondary></indexterm><indexterm><primary>zones</primary><secondary>devices and</secondary></indexterm><emphasis role="strong">Confine a device to a particular zone &ndash;</emphasis> You can assign the use of a device to a non-global zone. For more
information, see <olink targetdoc="group-sa" targetptr="z.admin.ov-13" remap="external"><citetitle remap="section">Device Use in Non-Global Zones</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>. For a more general discussion of devices
and zones, see <olink targetdoc="group-sa" targetptr="z.config.ov-8" remap="external"><citetitle remap="section">Configured Devices in Zones</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</listitem>
</itemizedlist><sect2 id="devmgt-6"><title>Device Policy (Overview)</title><indexterm><primary>new features</primary><secondary>device policy</secondary>
</indexterm><indexterm><primary>device policy</primary><secondary>overview</secondary>
</indexterm><para>The device policy mechanism enables you to specify that processes that
open a device require certain privileges. Devices that are protected by device
policy can only be accessed by processes that are running with the privileges
that the device policy specifies. The Solaris OS provides default device policy.
For example, network interfaces such as <literal>hme0</literal> require that
the processes that access the interface be running with the <constant>net_rawaccess</constant> privilege. The requirement is enforced in the kernel. For more
information about privileges, see <olink targetptr="prbac-2" remap="internal">Privileges (Overview)</olink>.</para><para>In earlier Solaris OS releases, device nodes were protected by file permissions
alone. For example, devices owned by group <literal>sys</literal> could be
opened only by members of group <literal>sys</literal>. In the Solaris 10 release,
file permissions do not predict who can open a device. Instead, devices are
protected with file permissions <emphasis>and</emphasis> with device policy.
For example, the <filename>/dev/ip</filename> file has <literal>666</literal> permissions.
However, the device can only be opened by a process with the appropriate privileges.</para><para>The configuration of device policy can be audited. The <literal>AUE_MODDEVPLCY</literal> audit event records changes in device policy.</para><itemizedlist><para>For more information about device policy, see the following:</para><listitem><para><olink targetptr="devtask-10" remap="internal">Configuring Device Policy (Task
Map)</olink></para>
</listitem><listitem><para><olink targetptr="devtask-4" remap="internal">Device Policy Commands</olink></para>
</listitem><listitem><para><olink targetptr="prbac-23" remap="internal">Privileges and Devices</olink></para>
</listitem>
</itemizedlist>
</sect2><sect2 id="devmgt-2"><title>Device Allocation (Overview)</title><itemizedlist><para>The device allocation mechanism enables you to restrict access to a
peripheral device, such as a CD-ROM. You manage the mechanism locally. If
device allocation is not enabled, peripheral devices are protected only by
file permissions. For example, by default, peripheral devices are available
for the following uses:</para><listitem><para>Any user can read and write to a diskette or CD-ROM.</para>
</listitem><listitem><para>Any user can attach a microphone.</para>
</listitem><listitem><para>Any user can access an attached printer.</para>
</listitem>
</itemizedlist><para>Device allocation can restrict a device to authorized users. Device
allocation can also prevent a device from being accessed at all. A user who
allocates a device has exclusive use of that device until the user deallocates
the device. When a device is deallocated, device-clean scripts erase any leftover
data. You can write a device-clean script to purge information from devices
that do not have a script. For an example, see <olink targetptr="devtask-7" remap="internal">Writing
New Device-Clean Scripts</olink>.</para><para>Attempts to allocate a device, deallocate a device, and list allocatable
devices can be audited. The audit events are part of the <literal>ot</literal> audit
class.</para><itemizedlist><para>For more information on device allocation, see the following:</para><listitem><para><olink targetptr="devtask-3" remap="internal">Managing Device Allocation (Task
Map)</olink></para>
</listitem><listitem><para><olink targetptr="devtask-40" remap="internal">Device Allocation</olink></para>
</listitem><listitem><para><olink targetptr="devtask-44" remap="internal">Device Allocation Commands</olink></para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="concept-13"><title>Controlling Access to Machine Resources</title><indexterm><primary>access</primary><secondary>security</secondary><tertiary>controlling system usage</tertiary>
</indexterm><indexterm><primary>controlling</primary><secondary>system usage</secondary>
</indexterm><para>As system administrator, you can control and monitor system activity.
You can set limits on who can use what resources. You can log resource use,
and you can monitor who is using the resources. You can also set up your machines
to minimize improper use of resources.</para><sect2 id="concept-8"><title>Limiting and Monitoring Superuser</title><indexterm><primary>access</primary><secondary><literal>root</literal> access</secondary><tertiary>monitoring <command>su</command> command attempts</tertiary>
</indexterm><indexterm><primary>monitoring</primary><secondary><command>su</command> command attempts</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>monitoring <command>su</command> command attempts</secondary>
</indexterm><indexterm><primary>system security</primary><secondary><command>su</command> command monitoring</secondary>
</indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary><literal>root</literal> login tracking</tertiary>
</indexterm><indexterm><primary>logging in</primary><secondary><literal>root</literal> login</secondary><tertiary>tracking</tertiary>
</indexterm><indexterm><primary>logging in</primary><secondary>security</secondary><tertiary>tracking <literal>root</literal> login</tertiary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>tracking logins</secondary>
</indexterm><para>Your system requires a <literal>root</literal> password for superuser
access. In the default configuration, a user cannot remotely log in to a system
as <literal>root</literal>. When logging in remotely, a user must log in with
the user's user name and then use the <command>su</command> command to become <literal>root</literal>. You can monitor who has been using the <command>su</command> command,
especially those users who are trying to gain superuser access. For procedures
that monitor superuser and limit access to superuser, see <olink targetptr="secsys-37" remap="internal">Monitoring and Restricting Superuser (Task Map)</olink>.</para>
</sect2><sect2 id="concept-39"><title>Configuring Role-Based Access Control
to Replace Superuser</title><para><indexterm><primary>system security</primary><secondary>role-based access control (RBAC)</secondary></indexterm>Role-based access control, or RBAC,
is designed to limit the capabilities of superuser. Superuser, the <literal>root</literal> user,
has access to every resource in the system. With RBAC, you can replace <literal>root</literal> with a set of roles with discrete powers. For example, you can
set up one role to handle user account creation, and another role to handle
system file modification. When you have established a role to handle a function
or set of functions, you can remove those functions from <literal>root</literal>'s
capabilities.</para><para>Each role requires that a known user log in with their user name and
password. After logging in, the user then assumes the role with a specific
role password. As a consequence, someone who learns the <literal>root</literal> password
has limited ability to damage your system. For more on RBAC, see <olink targetptr="rbac-1" remap="internal">Role-Based Access Control (Overview)</olink>.</para>
</sect2><sect2 id="concept-6"><title>Preventing Unintentional Misuse of Machine Resources</title><itemizedlist><para>You can prevent you and your users from making unintentional errors
in the following ways:</para><listitem><para><indexterm><primary>environment variables</primary><secondary><envar>PATH</envar></secondary></indexterm>You can keep from running a Trojan horse
by correctly setting the <envar>PATH</envar> variable.</para>
</listitem><listitem><para>You can assign a restricted shell to users. A restricted shell
prevents user error by steering users to those parts of the system that the
users need for their jobs. In fact, through careful setup, you can ensure
that users access only those parts of the system that help the users work
efficiently.</para>
</listitem><listitem><para>You can set restrictive permissions on files that users do
not need to access.</para>
</listitem>
</itemizedlist><sect3 id="concept-26"><title>Setting the <envar>PATH</envar> Variable</title><para><indexterm><primary><envar>PATH</envar> environment variable</primary><secondary>and security</secondary></indexterm><indexterm><primary>security</primary><secondary>protecting against Trojan horse</secondary></indexterm><indexterm><primary>Trojan horse</primary></indexterm><indexterm><primary>viruses</primary><secondary>Trojan horse</secondary></indexterm>You should take care to correctly
set the <envar>PATH</envar> variable. Otherwise, you can accidentally run
a program that was introduced by someone else. The intruding program can corrupt
your data or harm your system. This kind of program, which creates a security
hazard, is referred to as a <emphasis>Trojan horse</emphasis>. For example,
a substitute <command>su</command> program could be placed in a public directory
where you, as system administrator, might run the substitute program. Such
a script would look just like the regular <command>su</command> command. Because
the script removes itself after execution, you would have little evidence
to show that you have actually run a Trojan horse.</para><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary><envar>PATH</envar> variable setting</tertiary></indexterm><indexterm><primary><envar>PATH</envar> environment variable</primary><secondary>setting</secondary></indexterm>The <envar>PATH</envar> variable is automatically set at login
time. The path is set through the startup files: <filename>.login</filename>, <filename>.profile</filename>, and <filename>.cshrc</filename>. When you set up the
user search path so that the current directory (<literal>.</literal>) comes
last, you are protected from running this type of Trojan horse. The <envar>PATH</envar> variable
for superuser should not include the current directory at all.</para>
</sect3><sect3 id="concept-27"><title>Assigning a Restricted Shell to Users</title><para><indexterm><primary>restricted shell (<command>rsh</command>)</primary></indexterm><indexterm><primary><command>rsh</command> command (restricted shell)</primary></indexterm><indexterm><primary>system security</primary><secondary>restricted shell</secondary></indexterm>The standard shell allows
a user to open files, execute commands, and so on. The restricted shell limits
the ability of a user to change directories and to execute commands. The restricted
shell is invoked with the <command>/usr/lib/rsh</command> command. Note that
the restricted shell is not the remote shell, which is <command>/usr/sbin/rsh</command>.</para><itemizedlist><para>The restricted shell differs from the standard shell in the following
ways:</para><listitem><para>The user is limited to the user's home directory, so the user
cannot use the <command>cd</command> command to change directories. Therefore,
the user cannot browse system files.</para>
</listitem><listitem><para>The user cannot change the <literal>PATH</literal> variable,
so the user can use only commands in the path that is set by the system administrator.
The user also cannot execute commands or scripts by using a complete path
name.</para>
</listitem><listitem><para><indexterm><primary sortas="&gt;1">&gt; (redirect output)</primary><secondary>preventing</secondary></indexterm><indexterm><primary>redirecting arrow (&gt;)</primary><secondary>preventing redirection</secondary></indexterm><indexterm><primary sortas="&gt;2">&gt;&gt; (append output)</primary><secondary>preventing</secondary></indexterm><indexterm><primary>appending arrow (&gt;&gt;)</primary><secondary>preventing appending</secondary></indexterm>The user cannot redirect output with <literal>&gt;</literal> or <literal>&gt;&gt;</literal>.</para>
</listitem>
</itemizedlist><para>The restricted shell enables you to limit a user's ability to stray
into system files. The shell creates a limited environment for a user who
needs to perform specific tasks. The restricted shell is not completely secure,
however, and is only intended to keep unskilled users from inadvertently doing
damage.</para><para><indexterm><primary>system security</primary><secondary>restricted shell</secondary></indexterm>For information about the restricted shell, use the <command>man
-s1m rsh</command> command to see the <olink targetdoc="group-refman" targetptr="rsh-1m" remap="external"><citerefentry><refentrytitle>rsh</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="concept-3"><title>Restricting Access to Data in Files</title><para><indexterm><primary>access</primary><secondary>control lists</secondary><see>ACL</see></indexterm><indexterm><primary>files</primary><secondary>security</secondary><tertiary>access restriction</tertiary></indexterm>Because the Solaris OS is
a multiuser environment, file system security is the most basic security risk
on a system. You can use traditional UNIX file protections to protect your
files. You can also use the more secure access control lists (ACLs).</para><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary>file access restriction</tertiary></indexterm><indexterm><primary>files</primary><secondary>security</secondary><tertiary>access restriction</tertiary></indexterm>You might want to allow some users to read some files, and give
other users permission to change or delete some files. You might have some
data that you do not want anyone else to see. <olink targetptr="secfile-1" remap="internal">Chapter&nbsp;7, Controlling Access to Files (Tasks)</olink> discusses how to set file permissions.</para>
</sect3>
</sect2><sect2 id="concept-7"><title>Restricting <command>setuid</command> Executable
Files</title><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary><command>setuid</command> programs</tertiary></indexterm><indexterm><primary><command>setuid</command> permissions</primary><secondary>security risks</secondary></indexterm>Executable files can be security risks. Many
executable programs have to be run as <literal>root</literal>, that is, as
superuser, to work properly. These <literal>setuid</literal> programs run
with the user ID set to <literal>0</literal>. Anyone who is running these
programs runs the programs with the <literal>root</literal> ID. A program
that runs with the <literal>root</literal> ID creates a potential security
problem if the program was not written with security in mind.</para><para>Except for the executables that Sun ships with the <literal>setuid</literal> bit
set to <literal>root</literal>, you should disallow the use of <literal>setuid</literal> programs.
If you cannot disallow the use of <command>setuid</command> programs, then
you should at least restrict their use. Secure administration requires few <command>setuid</command> programs.</para><para>For more information, see <olink targetptr="secfile-68" remap="internal">Preventing Executable
Files From Compromising Security</olink>. For procedures, see <olink targetptr="secfile-40" remap="internal">Protecting Against Programs With Security Risk (Task
Map)</olink>.</para>
</sect2><sect2 id="concept-37"><title>Using the Solaris Security Toolkit</title><indexterm><primary>JASS toolkit</primary><secondary>pointer to</secondary>
</indexterm><indexterm><primary>security</primary><secondary>pointer to JASS toolkit</secondary>
</indexterm><para>the Solaris Security Toolkit provides a flexible
and extensible mechanism to minimize, harden, and secure a Solaris system.
The Solaris Security Toolkit, informally known as the JASS toolkit, is a tool
that enables the user to perform security modifications to a system. The tool
can provide a report on the security status of a system. The tool also has
the ability to undo previous runs of the tool. The JASS toolkit can be downloaded
from the Sun web site, <ulink url="http://wwws.sun.com/security/jass" type="url">http://wwws.sun.com/security/jass</ulink>. The web site contains pointers
to online documentation.</para><para>The toolkit is described in detail in <citetitle>Securing Systems with
the Solaris Security Toolkit</citetitle>, by Alex Noordergraaf and Glenn Brunette,
ISBN 0-13-141071-7, June 2003. The book is part of the Sun BluePrints Series,
which is published by Sun Microsystems Press.</para>
</sect2><sect2 id="concept-46"><title>Using the <command>netservices limited</command> Configuration</title><indexterm><primary>security</primary><secondary><command>netservices limited</command> installation option</secondary>
</indexterm><indexterm><primary>security</primary><secondary>installation options</secondary>
</indexterm><para>By default, when the Solaris 10 release is installed, a large set of network
services are enabled. To limit a system's network connectivity, you run the <command>netservices limited</command> command. Then, the only network service that
accepts network requests is the <command>sshd</command> daemon. All other
network services are disabled or handle local requests only. To enable individual
network services, such as <command>ftp</command>, you use the Solaris Service
Management Facility (SMF). For more information, see the <olink targetdoc="group-refman" targetptr="netservices-1m" remap="external"><citerefentry><refentrytitle>netservices</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="smf-5" remap="external"><citerefentry><refentrytitle>smf</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man
pages.</para>
</sect2><sect2 id="concept-35"><title>Using Solaris Resource Management
Features</title><para><indexterm><primary>security</primary><secondary>protecting against denial of service</secondary></indexterm><indexterm><primary>viruses</primary><secondary>denial of service attack</secondary></indexterm>Solaris software
provides sophisticated resource management features. Using these features,
you can allocate, schedule, monitor, and cap resource use by applications
in a server consolidation environment. The resource controls framework enables
you to set constraints on system resources that are consumed by processes.
Such constraints help to prevent denial-of-service attacks by a script that
attempts to flood a system's resources.</para><para>With Solaris resource management features, you can designate resources
for particular projects. You can also dynamically adjust the resources that
are available. For more information, see <olink targetdoc="group-sa" targetptr="resource" remap="external">Part&nbsp;I, <citetitle remap="chapter">Resource Management,</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</sect2><sect2 id="concept-38"><title>Using Solaris Zones</title><para>Solaris zones provide an application execution environment in which
processes are isolated  from the rest of the system within a single instance
of the Solaris OS. This isolation prevents processes that are running in one
zone from monitoring or affecting processes that are running in other zones.
Even a process running with superuser capabilities cannot view or affect activity
in other zones.</para><para>Solaris zones are ideal for environments that place several applications
on a single server. For more information, see <olink targetdoc="group-sa" targetptr="zone" remap="external">Part&nbsp;II, <citetitle remap="chapter">Zones,</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</sect2><sect2 id="concept-29"><title>Monitoring Use of Machine Resources</title><itemizedlist><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary>monitoring system usage</tertiary></indexterm><indexterm><primary>monitoring</primary><secondary>system usage</secondary></indexterm>As a system administrator,
you need to monitor system activity. You need to be aware of all aspects of
your machines, including the following:</para><listitem><para>What is the normal load?</para>
</listitem><listitem><para>Who has access to the system?</para>
</listitem><listitem><para>When do individuals access the system?</para>
</listitem><listitem><para>What programs normally run on the system?</para>
</listitem>
</itemizedlist><para>With this kind of knowledge, you can use the available tools to audit
system use and monitor the activities of individual users. Monitoring is very
useful when a breach in security is suspected. For more information on the
auditing service, see <olink targetptr="auditov-1" remap="internal">Chapter&nbsp;28, Solaris
Auditing (Overview)</olink>.</para>
</sect2><sect2 id="concept-44"><title>Monitoring File Integrity</title><para><indexterm><primary>access</primary><secondary>security</secondary><tertiary>monitoring system usage</tertiary></indexterm><indexterm><primary>monitoring</primary><secondary>system usage</secondary></indexterm>As a system administrator,
you need assurance that the files that were installed on the systems that
you administer have not changed in unexpected ways. In large installations,
a comparison and reporting tool about the software stack on each of your systems
enables you to track your systems. The Basic Audit Reporting Tool (BART) enables
you to comprehensively validate systems by performing file-level checks of
one or more systems over time. Changes in a BART <emphasis>manifest</emphasis> across
systems, or for one system over time, can validate the integrity of your systems.
BART provides manifest creation, manifest comparison, and rules for scripting
reports. For more information, see <olink targetptr="bart-1" remap="internal">Chapter&nbsp;6, Using the Basic Audit Reporting Tool (Tasks)</olink>.</para>
</sect2>
</sect1><sect1 id="concept-36"><title>Controlling Access to Files</title><para>The Solaris OS is a multiuser environment. In a multiuser environment,
all the users who are logged in to a system can read files that belong to
other users. With the appropriate file permissions, users can also use files
that belong to other users. For more discussion, see <olink targetptr="secfile-1" remap="internal">Chapter&nbsp;7, Controlling Access to Files (Tasks)</olink>. For step-by-step
instructions on setting appropriate permissions on files, see <olink targetptr="secfile-10" remap="internal">Protecting Files (Task Map)</olink>.</para><sect2 id="concept-19"><title>Protecting Files With Encryption</title><para>You can keep a file secure by making the file inaccessible to other
users. For example, a file with permissions of <literal>600</literal> cannot
be read except by its owner and by superuser. A directory with permissions
of <literal>700</literal> is similarly inaccessible. However, someone who
guesses your password or who discovers the <literal>root</literal> password
can access that file. Also, the otherwise inaccessible file is preserved on
a backup tape every time that the system files are backed up to offline media.</para><para><indexterm><primary><command>crypt</command> command</primary><secondary>file security</secondary></indexterm><indexterm><primary>encrypting</primary><secondary>files</secondary></indexterm><indexterm><primary>files</primary><secondary>security</secondary><tertiary>encryption</tertiary></indexterm>The
Solaris Cryptographic Framework provides <command>digest</command>, <command>mac</command>,
and <command>encrypt</command> commands to protect files. For more information,
see <olink targetptr="scf-1" remap="internal">Chapter&nbsp;13, Solaris Cryptographic Framework
(Overview)</olink>.</para>
</sect2><sect2 id="concept-20"><title>Using Access Control Lists</title><indexterm><primary>access</primary><secondary>security</secondary><tertiary>ACLs</tertiary>
</indexterm><indexterm><primary>ACL</primary><secondary>description</secondary>
</indexterm><indexterm><primary>files</primary><secondary>security</secondary><tertiary>ACL</tertiary>
</indexterm><indexterm><primary>ownership of files</primary><secondary>ACLs and</secondary>
</indexterm><indexterm><primary>permissions</primary><secondary>ACLs and</secondary>
</indexterm><para>ACLs, pronounced &ldquo;ackkls,&rdquo; can provide greater control over
file permissions. You add ACLs when traditional UNIX file protections are
not sufficient. Traditional UNIX file protections provide read, write, and
execute permissions for the three user classes: owner, group, and other. An
ACL provides finer-grained file security.</para><itemizedlist><para>ACLs enable you to define the following file permissions:</para><listitem><para>Owner file permissions</para>
</listitem><listitem><para>File permissions for the owner's group</para>
</listitem><listitem><para>File permissions for other users who are outside the owner's
group</para>
</listitem><listitem><para>File permissions for specific users</para>
</listitem><listitem><para>File permissions for specific groups</para>
</listitem><listitem><para>Default permissions for each of the previous categories</para>
</listitem>
</itemizedlist><para>For more information about using ACLs, see <olink targetptr="secfile-37" remap="internal">Using
Access Control Lists to Protect Files</olink>.</para>
</sect2><sect2 id="concept-32"><title>Sharing Files Across Machines</title><para><indexterm><primary>access</primary><secondary>sharing files</secondary></indexterm><indexterm><primary>file systems</primary><secondary>sharing files</secondary></indexterm><indexterm><primary>sharing files</primary><secondary>and network security</secondary></indexterm>A network file server can control which files
are available for sharing. A network file server can also control which clients
have access to the files, and what type of access is permitted for those clients.
In general, the file server can grant read-write access or read-only access
either to all clients or to specific clients. Access control is specified
when resources are made available with the <command>share</command> command.</para><para><indexterm><primary><filename>dfstab</filename> file</primary><secondary>sharing files</secondary></indexterm><indexterm><primary><filename>/etc/dfs/dfstab</filename> file</primary><secondary>sharing files</secondary></indexterm>The <filename>/etc/dfs/dfstab</filename> file on the file server lists the file systems that the server
makes available to clients on the network. For more information about sharing
file systems, see <olink targetdoc="group-sa" targetptr="rfsadmin-56" remap="external"><citetitle remap="section">Automatic File-System Sharing</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para>
</sect2><sect2 id="concept-33"><title>Restricting <literal>root</literal> Access to
Shared Files</title><indexterm><primary>access</primary><secondary><literal>root</literal> access</secondary><tertiary>restricting</tertiary>
</indexterm><indexterm><primary>system security</primary><secondary><literal>root</literal> access restrictions</secondary>
</indexterm><indexterm><primary><literal>root</literal> user</primary><secondary>restricting access</secondary>
</indexterm><indexterm><primary><literal>nobody</literal> user</primary>
</indexterm><para>In general, superuser is not allowed <literal>root</literal> access
to file systems that are shared across the network. The NFS system prevents <literal>root</literal> access to mounted file systems by changing the user of the
requester to the user <literal>nobody</literal> with the user ID <literal>60001</literal>.
The access rights of user <literal>nobody</literal> are the same as those
access rights that are given to the public. The user <literal>nobody</literal> has
the access rights of a user without credentials. For example, if the public
has only execute permission for a file, then user <literal>nobody</literal> can
only execute that file.</para><para>An NFS server can grant superuser capabilities on a shared file system
on a per-host basis. To grant these privileges, use the <literal>root=</literal><replaceable>hostname</replaceable> option to the <command>share</command> command. You
should use this option with care. For a discussion of security options with
NFS, see <olink targetdoc="group-sa" targetptr="rfsrefer-1" remap="external">Chapter 6, <citetitle remap="chapter">Accessing Network File Systems (Reference),</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para>
</sect2>
</sect1><sect1 id="concept-4"><title>Controlling Network Access</title><indexterm><primary>access</primary><secondary>security</secondary><tertiary>network control</tertiary>
</indexterm><indexterm><primary>network security</primary><secondary>controlling access</secondary>
</indexterm><para>Computers are often part of a configuration of computers. This configuration
is called a <emphasis>network</emphasis>. A network allows connected computers
to exchange information. Networked computers can access data and other resources
from other computers on the network. Computer networks create a powerful and
sophisticated computing environment. However, networks also complicate computer
security.</para><para>For example, within a network of computers, individual machines allow
the sharing of information. Unauthorized access is a security risk. Because
many people have access to a network, unauthorized access is more likely,
especially through user error. A poor use of passwords can also allow unauthorized
access.</para><sect2 id="concept-15"><title>Network Security Mechanisms</title><para><indexterm><primary>network security</primary><secondary>overview</secondary></indexterm>Network security is usually based on limiting or blocking
operations from remote systems. The following figure describes the security
restrictions that you can impose on remote operations.</para><figure id="concept-fig-29"><title>Security Restrictions for Remote
Operations</title><mediaobject><imageobject><imagedata entityref="firewall.epsi" width="100"/>
</imageobject><textobject><simpara>Diagram shows three ways to restrict access to remote
systems: a firewall system, an authentication mechanism, and an authorization
mechanism.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="concept-31"><title>Authentication and Authorization for
Remote Access</title><indexterm><primary>authentication</primary><secondary>description</secondary>
</indexterm><indexterm><primary>authentication</primary><secondary>network security</secondary>
</indexterm><indexterm><primary>network security</primary><secondary>authentication</secondary>
</indexterm><indexterm><primary>network security</primary><secondary>authorizations</secondary>
</indexterm><indexterm><primary>authentication</primary><secondary>types</secondary>
</indexterm><indexterm><primary>authorizations</primary><secondary>types</secondary>
</indexterm><indexterm><primary>remote logins</primary><secondary>authentication</secondary>
</indexterm><indexterm><primary>remote logins</primary><secondary>authorization</secondary>
</indexterm><indexterm><primary>Secure RPC</primary><secondary>overview</secondary>
</indexterm><para><emphasis>Authentication</emphasis> is a way to restrict access to specific
users when these users access a remote system. Authentication can be set up
at both the system level and the network level. After a user has gained access
to a remote system, <emphasis>authorization</emphasis> is a way to restrict
operations that the user can perform. The following table lists the services
that provide authentication and authorization.</para><table frame="topbot" pgwide="1" id="concept-14"><title>Authentication and
Authorization Services for Remote Access</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="58.50*"/><colspec colname="column2" colwidth="168.93*"/><colspec colname="column3" colwidth="134.57*"/><thead><row rowsep="1"><entry><para>Service</para>
</entry><entry><para>Description</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>IPsec</para>
</entry><entry><para>IPsec provides host-based and certificate-based authentication and network
traffic encryption.</para>
</entry><entry><para><olink targetdoc="group-sa" targetptr="ipsec-ov-1" remap="external">Chapter 19, <citetitle remap="chapter">IP Security Architecture (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: IP Services</citetitle></olink></para>
</entry>
</row><row><entry><para>Kerberos</para>
</entry><entry><para>Kerberos uses encryption to authenticate and authorize a user who is
logging in to the system.</para>
</entry><entry><para>For an example, see <olink targetptr="intro-25" remap="internal">How the Kerberos Service
Works</olink>.</para>
</entry>
</row><row><entry><para>LDAP and NIS+</para>
</entry><entry><para>The LDAP directory service and the NIS+ name service can provide both
authentication and authorization at the network level.</para>
</entry><entry><para><olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink> and <olink targetdoc="sysadv7" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (NIS+)</citetitle></olink></para>
</entry>
</row><row><entry><para>Remote login commands</para>
</entry><entry><para>The remote login commands enable users to log in to a remote system
over the network and use its resources. Some of the remote login commands
are <command>rlogin</command>, <command>rcp</command>, and <command>ftp</command>.
If you are a &ldquo;trusted host,&rdquo; authentication is automatic. Otherwise,
you are asked to authenticate yourself.</para>
</entry><entry><para><olink targetdoc="group-sa" targetptr="remotehowtoaccess-99941" remap="external">Chapter 29, <citetitle remap="chapter">Accessing Remote Systems (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink></para>
</entry>
</row><row><entry><para>SASL</para>
</entry><entry><para>The Simple Authentication and Security Layer (SASL) is a framework that
provides authentication and optional security services to network protocols.
Plugins enable you to choose an appropriate authentication protocol.</para>
</entry><entry><para><olink targetptr="egytb" remap="internal">SASL (Overview)</olink></para>
</entry>
</row><row><entry><para>Secure RPC</para>
</entry><entry><para>Secure RPC improves the security of network environments by authenticating
users who make requests on remote machines. You can use either the UNIX, DES,
or Kerberos authentication system for Secure RPC.</para>
</entry><entry><para><olink targetptr="auth-2" remap="internal">Overview of Secure RPC</olink></para>
</entry>
</row><row><entry><para></para>
</entry><entry><para>Secure RPC can also be used to provide additional security in an NFS
environment. An NFS environment with secure RPC is called Secure NFS. Secure
NFS uses Diffie-Hellman authentication for public keys.</para>
</entry><entry><para><olink targetptr="auth-3" remap="internal">NFS Services and Secure RPC</olink></para>
</entry>
</row><row><entry><para>Solaris Secure Shell</para>
</entry><entry><para>Solaris Secure Shell encrypts network traffic over an unsecured network.
Solaris Secure Shell provides authentication by the use of passwords, public
keys, or both. Solaris Secure Shell uses RSA and DSA authentication for public
keys.</para>
</entry><entry><para><olink targetptr="sshuser-2" remap="internal">Solaris Secure Shell (Overview)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm><primary>Secure RPC</primary><secondary>alternative</secondary></indexterm><indexterm><primary>privileged ports</primary><secondary>alternative to Secure RPC</secondary></indexterm>A possible substitute for Secure RPC
is the Solaris <emphasis>privileged port</emphasis> mechanism. A privileged
port is assigned a port number less than <literal>1024</literal>. After a
client system has authenticated the client's credential, the client builds
a connection to the server by using the privileged port. The server then verifies
the client credential by examining the connection's port number.</para><para>Clients that are not running Solaris software might be unable to communicate
by using the privileged port. If the clients cannot communicate over the port,
you see an error message that is similar to the following:</para><screen>&ldquo;Weak Authentication
NFS request from unprivileged port&rdquo;</screen>
</sect2><sect2 id="concept-25"><title>Firewall Systems</title><indexterm><primary>gateways</primary><see>firewall systems</see>
</indexterm><indexterm><primary>system security</primary><secondary>firewall systems</secondary>
</indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>firewall setup</tertiary>
</indexterm><indexterm><primary>Internet firewall setup</primary>
</indexterm><indexterm><primary>firewall systems</primary><secondary>security</secondary>
</indexterm><para>You can set up a firewall system to protect the resources in your network
from outside access. A <emphasis>firewall system</emphasis> is a secure host
that acts as a barrier between your internal network and outside networks.
The internal network treats every other network as untrusted. You should consider
this setup as mandatory between your internal network and any external networks,
such as the Internet, with which you communicate.</para><para>A firewall acts as a gateway and as a barrier. A firewall acts as a
gateway that passes data between the networks. A firewall acts as a barrier
that blocks the free passage of data to and from the network. The firewall
requires a user on the internal network to log in to the firewall system to
access hosts on remote networks. Similarly, a user on an outside network must
first log in to the firewall system before being granted access to a host
on the internal network.</para><para><indexterm><primary>packet transfers</primary><secondary>firewall security</secondary></indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>firewall setup</tertiary></indexterm><indexterm><primary>network security</primary><secondary>firewall systems</secondary><tertiary>need for</tertiary></indexterm>A firewall can also be useful between some internal networks.
For example, you can set up a firewall or a secure gateway computer to restrict
the transfer of packets. The gateway can forbid packet exchange between two
networks, unless the gateway computer is the source address or the destination
address of the packet. A firewall should also be set up to forward packets
for particular protocols only. For example, you can allow packets for transferring
mail, but not allow packets for the <command>telnet</command> or the <command>rlogin</command> command.</para><para>In addition, all electronic mail that is sent from the internal network
is first sent to the firewall system. The firewall then transfers the mail
to a host on an external network. The firewall system also receives all incoming
electronic mail, and distributes the mail to the hosts on the internal network.</para><caution><para>A firewall prevents unauthorized users from accessing the hosts
on your network. You should maintain strict and rigidly enforced security
on the firewall, but security on other hosts on the network can be more relaxed.
However, an intruder who can break into your firewall system can then gain
access to all the other hosts on the internal network.</para>
</caution><para><indexterm><primary>firewall systems</primary><secondary>trusted hosts</secondary></indexterm><indexterm><primary>hosts</primary><secondary>trusted hosts</secondary></indexterm><indexterm><primary>network security</primary><secondary>firewall systems</secondary><tertiary>trusted hosts</tertiary></indexterm><indexterm><primary>trusted hosts</primary></indexterm>A firewall system should not have
any trusted hosts. A <emphasis>trusted host</emphasis> is a host from which
a user can log in without being required to supply a password. A firewall
system should not share any of its file systems, or mount any file systems
from other servers.</para><itemizedlist><para>The following technologies can be used to harden a system into a firewall:</para><listitem><para>The Solaris Security Toolkit, informally known as the JASS
toolkit, can harden a Solaris system into a firewall. The toolkit can be downloaded
from the Sun web site, <ulink url="http://wwws.sun.com/security/jass" type="url">http://wwws.sun.com/security/jass</ulink>.</para>
</listitem><listitem><para>IPsec and Solaris IP filter can provide firewall protection.
For more information on protecting network traffic, see <olink targetdoc="group-sa" targetptr="ipsectm-1" remap="external">Part&nbsp;III, <citetitle remap="chapter">IP Security,</citetitle> in <citetitle remap="book">System Administration Guide: IP Services</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="concept-30"><title>Encryption and Firewall Systems</title><indexterm><primary>firewall systems</primary><secondary>packet smashing</secondary>
</indexterm><indexterm><primary>network security</primary><secondary>firewall systems</secondary><tertiary>packet smashing</tertiary>
</indexterm><indexterm><primary>packet transfers</primary><secondary>packet smashing</secondary>
</indexterm><indexterm><primary>firewall systems</primary><secondary>packet transfers</secondary>
</indexterm><para>Most local area networks transmit data between computers in blocks that
are called <emphasis>packets</emphasis>. Through a procedure that is called <emphasis>packet smashing</emphasis>, unauthorized users from outside the network can
corrupt or destroy data.</para><para>Packet smashing involves capturing the packets before the packets reach
their destination. The intruder then injects arbitrary data into the contents,
and sends the packets back on their original course. On a local area network,
packet smashing is impossible because packets reach all systems, including
the server, at the same time. Packet smashing is possible on a gateway, however,
so make sure that all gateways on the network are protected.</para><para>The most dangerous attacks affect the integrity of the data. Such attacks
involve changing the contents of the packets or impersonating a user. Attacks
that involve eavesdropping do not compromise data integrity. An eavesdropper
records conversations for later replay. An eavesdropper does not impersonate
a user. Although eavesdropping attacks do not attack data integrity, the attacks
do affect privacy. You can protect the privacy of sensitive information by
encrypting data that goes over the network.</para><itemizedlist><listitem><para>To encrypt remote operations over an insecure network, see <olink targetptr="sshuser-1" remap="internal">Chapter&nbsp;19, Using Solaris Secure Shell (Tasks)</olink>.</para>
</listitem><listitem><para>To encrypt and authenticate data across a network, see <olink targetptr="intro-1" remap="internal">Chapter&nbsp;21, Introduction to the Kerberos Service</olink>.</para>
</listitem><listitem><para>To encrypt IP datagrams, see  <olink targetdoc="group-sa" targetptr="ipsec-ov-1" remap="external">Chapter 19, <citetitle remap="chapter">IP Security Architecture (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: IP Services</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="concept-10"><title>Reporting Security Problems</title><indexterm><primary>network security</primary><secondary>reporting problems</secondary>
</indexterm><indexterm><primary>access</primary><secondary>security</secondary><tertiary>reporting problems</tertiary>
</indexterm><indexterm><primary>Computer Emergency Response Team/Coordination Center (CERT/CC)</primary>
</indexterm><para>If you experience a suspected security breach, you can contact the Computer
Emergency Response Team/Coordination Center (CERT/CC). CERT/CC is a Defense
Advanced Research Projects Agency (DARPA) funded project that is located at
the Software Engineering Institute at Carnegie Mellon University. This agency
can assist you with any security problems you are having. This agency can
also direct you to other Computer Emergency Response Teams that might be more
appropriate for your particular needs. You can call CERT/CC at its 24-hour
hotline: (412) 268-7090. Or, contact the team by email at <literal>cert@cert.sei.cmu.edu</literal>.</para>
</sect1>
</chapter><?Pub *0000085366 0?>