<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><chapter id="ldapsecure-1"><?Pub Tag atict:info tracking="off" ref="0"?><title>LDAP Basic Components and Concepts (Overview)</title><highlights><para>This chapter covers the following topics.</para><itemizedlist><listitem><para><olink targetptr="ldapsecure-104" remap="internal">LDAP Data Interchange Format
(LDIF)</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-2" remap="internal">Using Fully Qualified Domain
Names With LDAP</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-89" remap="internal">Default Directory Information
Tree (DIT)</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-88" remap="internal">Default LDAP Schema</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-65" remap="internal">Service Search Descriptors
(SSDs) and Schema Mapping</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-103" remap="internal">LDAP Client Profiles</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-99" remap="internal">ldap_cachemgr Daemon</olink></para>
</listitem><listitem><para><olink targetptr="ldapsecure-66" remap="internal">LDAP Naming Services Security
Model</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="ldapsecure-104"><title>LDAP Data Interchange Format (LDIF)</title><para><indexterm><primary>LDIF</primary></indexterm>LDIF is a text-based format
for describing directory service entities and their attributes. Using LDIF
format you can move information from one directory to another with commands
such as <command>ldapadd</command> and <command>ldapmodify</command>. The
following are examples of LDIF format for each service. Use <olink targetdoc="group-refman" targetptr="ldaplist-1" remap="external"><citerefentry><refentrytitle>ldaplist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> with the<option>l</option> option to display the following information.</para><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>hosts myhost</userinput></para><screen>hosts

dn: cn=myhost+ipHostNumber=7.7.7.115,ou=Hosts,dc=mydc,dc=mycom,dc=com
cn: myhost
iphostnumber: 7.7.7.115
objectclass: top
objectclass: device
objectclass: ipHost
description: host 1 - floor 1 - Lab a - building b</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>passwd user1</userinput></para><screen>passwd

dn: uid=user1,ou=People,dc=mydc,dc=mycom,dc=com
uid: user1
cn: user1
userpassword: {crypt}duTx91g7PoNzE
uidnumber: 199995
gidnumber: 20
gecos: Joe Smith [New York]
homedirectory: /home/user1
loginshell: /bin/csh
objectclass: top
objectclass: shadowAccount
objectclass: account
objectclass: posixAccount</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>services name</userinput></para><screen>services

dn: cn=name+ipServiceProtocol=udp,ou=Services,dc=mydc,dc=mycom,dc=com
cn: name
cn: nameserver
ipserviceprotocol: udp
ipserviceport: 42
objectclass: top
objectclass: ipService</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>group mygroup</userinput></para><screen>group

dn: cn=mygroup,ou=Group,dc=mydc,dc=mycom,dc=com
cn: mygroup
gidnumber: 4441
memberuid: user1
memberuid: user2
memberuid: user3
userpassword: {crypt}duTx91g7PoNzE
objectclass: top
objectclass: posixGroup</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option><userinput>netgroup mynetgroup</userinput></para><screen>netgroup

cn=mynetgroup,ou=netgroup,dc=central,dc=sun,dc=com objectclass=nisNetgroup
-objectclass: -top
-cn: -mynetgroup
-nisnetgrouptriple: -(user1..mydc.mycom.com,-,) nisnetgrouptriple=(user1.,-,)
-membernisnetgroup: -mylab</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>networks 200.20.20.0</userinput></para><screen>networks

dn: ipNetworkNumber=200.20.20.0,ou=Networks,dc=mydc,dc=mycom,dc=com
cn: mynet-200-20-20
ipnetworknumber: 200.20.20.0
objectclass: top
objectclass: ipNetwork
description: my Lab Network
ipnetmasknumber: 255.255.255.0</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>netmasks 201.20.20.0</userinput></para><screen>netmasks

dn: ipNetworkNumber=201.20.20.0,ou=Networks,dc=mydc,dc=mycom,dc=com
cn: net-201
ipnetworknumber: 201.20.20.0
objectclass: top
objectclass: ipNetwork
description: my net 201
ipnetmasknumber: 255.255.255.0</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>rpc ypserv</userinput></para><screen>rpc

dn: cn=ypserv,ou=Rpc,dc=mydc,dc=mycom,dc=com
cn: ypserv
cn: ypprog
oncrpcnumber: 100004
objectclass: top
objectclass: oncRpc</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>protocols tcp</userinput></para><screen>protocols

dn: cn=tcp,ou=Protocols,dc=mydc,dc=mycom,dc=com
cn: tcp
ipprotocolnumber: 6
description: transmission control protocol
objectclass: top
objectclass: ipProtocol</screen><para>% <userinput>ldaplist</userinput> <option>l</option> <userinput>bootparams
myhost</userinput></para><screen>bootparams

dn: cn=myhost,ou=Ethers,dc=mydc,dc=mycom,dc=com
bootparameter: root=boothost:/export/a/b/c/d/e
objectclass: top
objectclass: device
objectclass: bootableDevice
cn: myhost</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>ethers myhost</userinput></para><screen>ethers

dn: cn=myhost,ou=Ethers,dc=mydc,dc=mycom,dc=com
macaddress: 8:1:21:71:31:c1
objectclass: top
objectclass: device
objectclass: ieee802Device
cn: myhost</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>publickey myhost</userinput></para><screen>publickey

dn: cn=myhost+ipHostNumber=200.20.20.99,ou=Hosts,dc=mydc,dc=mycom,dc=com
cn: myhost
iphostnumber: 200.20.20.99
description: Joe Smith
nispublickey: 9cc01614d929848849add28d090acdaa1c78270aeec969c9
nissecretkey: 9999999998769c999c39e7a6ed4e7afd687d4b99908b4de99
objectclass: top
objectclass: NisKeyObject
objectclass: device
objectclass: ipHost</screen><para><literal>%</literal> <userinput>ldaplist</userinput> <option>l</option> <userinput>aliases myname</userinput></para><screen>aliases

dn: mail=myname,ou=aliases,dc=mydc,dc=mycom,dc=com
cn: myname
mail: myname
objectclass: top
objectclass: mailgroup
mgrprfc822mailmember: my.name</screen>
</sect1><sect1 id="ldapsecure-2"><title>Using Fully Qualified Domain Names With LDAP</title><para><indexterm><primary>FQDN</primary></indexterm>Unlike  NIS or NIS+ clients,
an LDAP client always returns a fully qualified domain name (FQDN) for a host
name. The LDAP FQDN is similar to the FQDN returned by DNS. For example, suppose
your domain name is the following:</para><screen>west.example.net</screen><para>Both <function>gethostbyname</function> and <function>getnameinfo</function> return
the FQDN version when looking up the host name <replaceable>server</replaceable>:</para><screen>server.west.example.net</screen><para>Also, if you use interface-specific aliases such as <literal>server</literal><option>#</option><literal></literal>, a long list of fully qualified host names are
returned.  If you are using host names to share file systems or have other
such checks, you must account for the checks. For example, if you assume non-FQDNs
for local hosts and FQDNs only for remote DNS-resolved hosts, you must account
for the difference. If you set up LDAP with a different domain name from DNS,
the same host might end up with two different FQDNs, depending on the lookup
source.</para>
</sect1><sect1 id="ldapsecure-89"><title>Default Directory Information Tree (DIT)</title><indexterm><primary>Directory Information Tree</primary>
</indexterm><para>By default, Solaris LDAP clients access the information assuming that
the DIT has a given structure. For each domain supported by the LDAP server,
there is a subtree with an assumed structure. This default structure, however,
can be overridden by specifying Service Search Descriptors (SSDs). For a given
domain, the default DIT will have a base container that holds a number of
well known containers that hold entries for a specific information type. See
the following table for the names of these subtrees. (This information can
be found in RFC 2307 and others.)</para><table frame="topbot" id="ldapsecure-tbl-85"><title>DIT Default Locations</title><tgroup cols="2" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="30.66*"/><colspec colname="colspec1" colwidth="69.34*"/><thead><row><?PubTbl row rht="0.32in"?><entry colsep="1" rowsep="1"><para>Default Container</para>
</entry><entry colsep="1" rowsep="1"><para>Information Type</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para><literal>ou=Ethers</literal></para>
</entry><entry colsep="1" rowsep="1"><para>bootparams(4), ethers(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Group</literal></para>
</entry><entry colsep="1" rowsep="1"><para>group(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Hosts</literal> </para>
</entry><entry colsep="1" rowsep="1"><para>hosts(4),  ipnodes(4), publickey for hosts</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Aliases</literal></para>
</entry><entry colsep="1" rowsep="1"><para>aliases(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Netgroup</literal> </para>
</entry><entry colsep="1" rowsep="1"><para>netgroup(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Networks</literal></para>
</entry><entry colsep="1" rowsep="1"><para>networks(4), netmasks(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=People</literal> </para>
</entry><entry colsep="1" rowsep="1"><para>passwd(1),  shadow(4), user_attr(4), audit_user(4), publickey for users</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=printers</literal></para>
</entry><entry colsep="1" rowsep="1"><para>printers(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Protocols</literal></para>
</entry><entry colsep="1" rowsep="1"><para>protocols(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Rpc</literal></para>
</entry><entry colsep="1" rowsep="1"><para>rpc(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=Services</literal></para>
</entry><entry colsep="1" rowsep="1"><para>services(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=SolarisAuthAttr</literal></para>
</entry><entry colsep="1" rowsep="1"><para>auth_attr(4)</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>ou=SolarisProfAttr</literal></para>
</entry><entry colsep="1" rowsep="1"><para>prof_attr(4), exec_attr(4)</para>
</entry>
</row><row><entry colname="colspec0" colsep="1" rowsep="1"><para><literal>ou=projects</literal></para>
</entry><entry colname="colspec1" colsep="1" rowsep="1"><para>project</para>
</entry>
</row><row><entry colname="colspec0" colsep="1" rowsep="1"><para><literal>automountMap=auto_</literal>*</para>
</entry><entry colname="colspec1" colsep="1" rowsep="1"><para>auto_*</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="ldapsecure-88"><title>Default LDAP Schema</title><para>Schemas are definitions describing what types of information can be
stored as entries in an LDAP directory. To support LDAP naming clients, the
directory server's schema might need to be extended. Detailed information
about IETF and Solaris specific schemas is included in <olink targetptr="schemas-1" remap="internal">Chapter&nbsp;14, LDAP General Reference (Reference)</olink>.
The various RFCs can also be accessed on the IETF Web site <literal>http://www.ietf.org</literal>.</para>
</sect1><sect1 id="ldapsecure-65"><title>Service Search Descriptors (SSDs) and Schema
Mapping</title><note><para>If you use schema mapping, you must do so in a very careful and
consistent manner. Make sure the syntax of the mapped attribute is consistent
with the attribute it is mapped to. In other words, make sure that single-valued
attributes map to single-valued attributes, that the attribute syntaxes are
in agreement, and that mapped object classes have the correct mandatory (possibly
mapped) attributes.</para>
</note><para><indexterm><primary>schema mapping</primary></indexterm>As previously
discussed, LDAP naming services expect, by default, the DIT to be structured
in a certain way. If you want, you can instruct the Solaris LDAP naming service
to search in other locations than the default locations in the DIT. Additionally,
you can specify that different attributes and object classes be used in place
of those specified by the default schema. For a list of default filters, see <olink targetptr="schemas-122" remap="internal">Default Filters Used by LDAP Naming Services</olink>.</para><sect2 id="ldapsecure-69"><title>Description of SSDs</title><para><indexterm><primary>SSDs</primary></indexterm><indexterm><primary>Service Search Descriptors</primary></indexterm>The <literal>serviceSearchDescriptor</literal> attribute
defines how and where an LDAP naming service client should search for information
for a particular service. The <literal>serviceSearchDescriptor</literal> contains
a service name, followed by one or more semicolon-separated base-scope-filter
triples.  These base-scope-filter triples are used to define searches only
for the specific service and are searched in order.  If multiple base-scope-filters
are specified for a given service, then when that service looks for a particular
entry, it will search in each base with the specified scope and filter.</para><note><para>The default location is not searched for a service (database)
with an SSD unless it is included in the SSD.  Unpredictable behavior will
result if multiple SSDs are given for a service.</para>
</note><para>In the following example, the Solaris LDAP naming service client performs
a one-level search in <literal>ou=west,dc=example,dc=com</literal> followed
by a one-level search in <literal>ou=east,dc=example,dc=com</literal> for
the <literal>passwd</literal> service. To look up the <literal>passwd</literal> data
for a user's <literal>username</literal>, the default LDAP filter <literal>(&amp;(objectClass=posixAccount)(uid=username))</literal> is used for each <literal>BaseDN</literal>.</para><screen>serviceSearchDescriptor: passwd:ou=west,dc=example,dc=com;ou=east,
dc=example,dc=com </screen><para>In the following example, the Solaris LDAP naming service client would
perform a subtree search in <literal>ou=west,dc=example,dc=com</literal> 
for the <literal>passwd</literal> service. To look up the <literal>passwd</literal> data
for user <literal>username</literal>, the subtree <literal>ou=west,dc=example,dc=com</literal> would be searched with the LDAP filter <literal>(&amp;(fulltimeEmployee=TRUE)(uid=username))</literal>.</para><screen>serviceSearchDescriptor: passwd:ou=west,dc=example,
dc=com?sub?fulltimeEmployee=TRUE</screen><para>It is also possible to associate multiple containers with a particular
service type. In the following example, the service search descriptor specifies
searching for the password entries in three containers.</para><simplelist><member><literal>ou=myuser,dc=example,dc=com</literal></member><member><literal>ou=newuser,dc=example,dc=com</literal></member><member><literal>ou=extuser,dc=example,dc=com</literal></member>
</simplelist><para>Note that a trailing ',' in the example implies that the <literal>defaultSearchBase</literal> is appended to the relative base in the SSD.</para><screen>defaultSearchBase: dc=example,dc=com
serviceSearchDescriptor: \
passwd:ou=myuser,;ou=newuser,;ou=extuser,dc=example,dc=com</screen><sect3 id="ldapsecure-100"><title>Attribute Map</title><para><indexterm><primary>Attribute map</primary></indexterm>The Solaris LDAP
naming service allows one or more attribute names to be remapped for any of
its services. (The Solaris LDAP client uses the well-known attributes documented
in <olink targetptr="schemas-1" remap="internal">Chapter&nbsp;14, LDAP General Reference (Reference)</olink>.)  If you map an attribute, you must be sure that the attribute has
the same meaning and syntax as the original attribute. Note that mapping the <literal>userPassword</literal> attribute might cause problems.</para><para>There are a couple of reasons you might want to use schema mappings.</para><itemizedlist><listitem><para>You want to map attributes in an existing directory server</para>
</listitem><listitem><para>If you have user names that differ only in case, you must
map the <literal>uid</literal> attribute, which ignores case, to an attribute
that does not ignore case</para>
</listitem>
</itemizedlist><para>The format for this attribute is <literal>service:attribute-name=mapped-attribute-name</literal>.</para><para>If you want to map more than one attribute for a given service, you
can define multiple <literal>attributeMap</literal> attributes.</para><para>In the following example, the <literal>employeeName</literal> and <literal>home</literal> attributes would be used whenever the <literal>uid</literal> and <literal>homeDirectory</literal> attributes would be used for the <literal>passwd</literal> service.</para><screen>attributeMap: passwd:uid=employeeName
attributeMap: passwd:homeDirectory=home</screen><para>There exists one special case where you can map the <literal>passwd</literal> service's <literal>gecos</literal> attribute to several attributes. The following is an example.</para><screen>attributemap: gecos=cn sn title</screen><para>This maps the <literal>gecos</literal> values to a space separated list
of the <literal>cn</literal>, <literal>sn</literal>, and <literal>title</literal> attribute
values.</para>
</sect3><sect3 id="ldapsecure-101"><title><literal>objectClass</literal> Map</title><para><indexterm><primary>objectClass Map</primary></indexterm>The Solaris
LDAP naming service allows object classes to be remapped for any of its services.
If you want to map more than one object class for a given service, you can
define multiple <literal>objectclassMap</literal> attributes. In the following
example, the <literal>myUnixAccount</literal> object class is used whenever
the <literal>posixAccount</literal> object class is used.</para><screen>objectclassMap: passwd:posixAccount=myUnixAccount</screen>
</sect3>
</sect2>
</sect1><sect1 id="ldapsecure-103"><title>LDAP Client Profiles</title><para><indexterm><primary>Profiles</primary><secondary>LDAP client</secondary></indexterm>To simplify Solaris client setup, and avoid having to reenter
the same information for each and every client, create a single client profile
on the directory server. This way, a single profile defines the configuration
for all clients configured to use it. Any subsequent change to the profile
attributes is propagated to the clients at a rate defined by the refresh interval.</para><para>These client profiles should be stored in a well-known location on the
LDAP server. The root DN for the given domain must have an object class of <literal>nisDomainObject</literal> and a <literal>nisDomain</literal> attribute containing
the client's domain.  All profiles are located in the <literal>ou=profile</literal> container
relative to this container. These profiles should be readable anonymously.</para><sect2 id="ldapsecure-70"><title>Client Profile Attributes</title><para>The following table shows the Solaris LDAP client's profile attributes,
which can be set automatically when you run <command>idsconfig</command>.
See <olink targetptr="clientsetup-51" remap="internal">Initializing a Client Manually</olink> and
the <olink targetdoc="group-refman" targetptr="idsconfig-1m" remap="external"><citerefentry><refentrytitle>idsconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page for information on how to set a client profile manually.</para><table frame="topbot" id="ldapsecure-tbl-86"><title>Client Profile Attributes</title><tgroup cols="2" colsep="1" rowsep="1"><?PubTbl tgroup dispwid="5.64in"?><colspec colname="colspec2" colwidth="32.55*"/><colspec colname="colspec3" colwidth="67.45*"/><thead><row><entry colsep="1" rowsep="1"><para>Attribute</para>
</entry><entry colsep="0" rowsep="1"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para><literal>cn</literal></para>
</entry><entry colsep="1" rowsep="1"><para>The profile name. The attribute has no default value. The value must
be specified.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>preferredServerList</literal></para>
</entry><entry colsep="1" rowsep="1"><para>The host addresses of the preferred servers is a space separated list
of server addresses. (Do not use host names.)  The servers in this list are
tried in order <emphasis>before</emphasis> those in <literal>defaultServerList</literal> until
a successful connection is made. This has no default value. At least one server
must be specified in either <literal>preferredServerList</literal> or <literal>defaultServerList</literal>.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>defaultServerList</literal></para>
</entry><entry colsep="1" rowsep="1"><para>The host addresses of the default servers is a space separated list
of server addresses. (Do not use host names.) After the servers in <literal>preferredServerlist</literal> are tried, those default servers on the client's subnet are tried,
followed by the remaining default servers, until a connection is made. At
least one server must be specified in either <literal>preferredServerList</literal> or <literal>defaultServerList</literal>. The servers in this list are tried only after
those on the preferred server list. This attribute has no default value.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>defaultSearchBase</literal></para>
</entry><entry colsep="1" rowsep="1"><para>The DN relative to which to locate the well-known containers. There
is no default for this value. However, this can be overridden for a given
service by the <literal>serviceSearchDescriptor</literal> attribute.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>defaultSearchScope</literal></para>
</entry><entry colsep="0" rowsep="1"><para>Defines the scope of a database search by a client. It can be overridden
by the <literal>serviceSearchDescriptor</literal> attribute. The possible
values are <literal>one</literal> or <literal>sub</literal>. The default value
is a <literal>one</literal> level search.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>authenticationMethod</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Identifies the method of authentication used by the client. The default
is none (anonymous). See <olink targetptr="ldapsecure-75" remap="internal">Choosing Authentication
Methods</olink> for more information.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>credentialLevel</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Identifies the type of credentials a client should use to authenticate.
The choices are <literal>anonymous</literal>, <literal>proxy</literal>, or <literal>self</literal> (also known as per user). The default is <literal>anonymous</literal>. </para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>serviceSearchDescriptor</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Defines how and where a client should search for a naming database,
for example, if the client should look in one or more points in the DIT. By
default no SSDs are defined.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>serviceAuthenticationMethod</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Authentication method used by a client for the specified service. By
default, no service authentication methods are defined. If a service does
not have <literal>serviceAuthenticationMethod</literal> defined, it will default
to the value of <literal>authenticationMethod</literal>. </para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>attributeMap</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Attribute mappings used by client. By default no <literal>attributeMap</literal> is
defined. </para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>objectclassMap</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Object class mappings used by client. By default no <literal>objectclassMap</literal> is defined.</para>
</entry>
</row><row><?PubTbl row rht="0.33in"?><entry colsep="1" rowsep="1"><para><literal>searchTimeLimit</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Maximum time [in seconds] a client should allow for a search to complete
before timing out. This does not affect the time the LDAP server will allow
for a search to complete. The default value is <literal>30</literal> seconds.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>bindTimeLimit</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Maximum time in seconds a client should allow to bind with a server
before timing out. Default value is <literal>30</literal> seconds.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>followReferrals</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Specifies whether a client should follow an LDAP referral. Possible
values <literal>TRUE</literal> or <literal>FALSE</literal>. The default value
is <literal>TRUE</literal>.</para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><literal>profileTTL</literal></para>
</entry><entry colsep="1" rowsep="1"><para>Time between refreshes of the client profile from the LDAP server by
the <olink targetdoc="group-refman" targetptr="ldap-cachemgr-1m" remap="external"><citerefentry><refentrytitle>ldap_cachemgr</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>. Default is <literal>43200</literal> seconds or 12
hours. If given a value of 0, the profile will never be refreshed.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="ldapsecure-92"><title>Local Client Attributes</title><para>The following table lists the client attributes that can be set locally
using <command>ldapclient</command>. See the <olink targetdoc="group-refman" targetptr="ldapclient-1m" remap="external"><citerefentry><refentrytitle>ldapclient</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for more information.</para><table frame="topbot" id="ldapsecure-tbl-98"><title>Local Client Attributes</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="28.25*"/><colspec colname="colspec1" colwidth="71.75*"/><thead><row rowsep="1"><entry colsep="0" rowsep="1"><para>Attribute</para>
</entry><entry colsep="1" rowsep="1"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry colname="colspec0" colsep="0" rowsep="0"><para><literal>domainName</literal></para>
</entry><entry colname="colspec1" colsep="0" rowsep="0"><para>Specifies the client's domain name (which becomes the default domain
for the client machine). This attribute has no default value and must be specified.</para>
</entry>
</row><row><entry colname="colspec0" colsep="0" rowsep="0"><para><literal>proxyDN</literal> </para>
</entry><entry colname="colspec1" colsep="0" rowsep="0"><para>The proxy's distinguished name. If the client machine is configured
with <literal>credentialLevel</literal> of <literal>proxy</literal>, the <literal>proxyDN</literal> must be specified.</para>
</entry>
</row><row><entry colname="colspec0" colsep="0" rowsep="0"><para><literal>proxyPassword</literal></para>
</entry><entry colname="colspec1" colsep="0" rowsep="0"><para>The proxy's password. If the client machine is configured with  <literal>credentialLevel</literal> of proxy, <literal>proxyPassword</literal> must be defined. </para>
</entry>
</row><row><entry colname="colspec0" colsep="0" rowsep="0"><para><literal>certificatePath</literal></para>
</entry><entry colname="colspec1" colsep="0" rowsep="0"><para>The directory on the local file system containing the certificate databases.
If a client machine is configured with <literal>authenticationMethod</literal> or <literal>serviceAuthenticationMethod</literal> using TLS, then this attribute is used.
The default value is <filename>/var/ldap</filename>.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>If the <literal>BaseDN</literal> in an SSD <emphasis>contains
a trailing comma</emphasis>, it is treated as a relative value of the <literal>defaultSearchBase</literal>. The values of the <literal>defaultSearchBase</literal> are appended
to the <literal>BaseDN</literal> before a search is performed.</para>
</note>
</sect2>
</sect1><sect1 id="ldapsecure-99"><title><literal>ldap_cachemgr</literal> Daemon</title><para><command>ldap_cachemgr</command> is a daemon that runs on LDAP client
machines. When you start the LDAP client, the <command>ldap_cachemgr</command> daemon
is invoked. The daemon performs the following key functions.</para><itemizedlist><listitem><para><indexterm><primary><literal>ldap_cachemgr</literal> daemon</primary></indexterm>Gains access to  the configuration files, running as root</para>
</listitem><listitem><para>Refreshes the client configuration information stored in the
profiles on the server and pulls this data from the clients</para>
</listitem><listitem><para>Maintains a sorted list of active LDAP servers to use</para>
</listitem><listitem><para>Improves lookup efficiency by caching some common lookup requests
submitted by various clients</para>
</listitem><listitem><para>Improves the efficiency of host lookups</para>
</listitem>
</itemizedlist><note><para><literal>ldap_cachemgr</literal> must be running at all times
for LDAP naming services to work.</para>
</note><para>Refer to the <olink targetdoc="group-refman" targetptr="ldap-cachemgr-1m" remap="external"><citerefentry><refentrytitle>ldap_cachemgr</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for detailed information.</para>
</sect1><sect1 id="ldapsecure-66"><title>LDAP Naming Services Security Model</title><sect2 id="ldapsecure-72"><title>Introduction</title><para>Solaris LDAP naming services can use the LDAP repository in two different
ways. One is as a source of both a naming service and an authentication service.
The other is strictly as the source of naming data, using Kerberos as the
enterprise-wide authentication system. This section discusses the concepts
of client identity, authentication methods, <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> and <command>pam_unix</command> modules,
and account management when the LDAP repository is used as both a naming service
and authentication service.  This section also discusses the use of LDAP naming
services in conjunction with the Kerberos environment (<olink targetdoc="sysadv6" targetptr="seamtm-1" remap="external">Part&nbsp;VI, <citetitle remap="chapter">Kerberos Service,</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>)
and <olink targetdoc="group-refman" targetptr="pam-krb5-5" remap="external"><citerefentry><refentrytitle>pam_krb5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> modules.</para>&pamldapnote;<note><para>If you use Kerberos as your authentication system and integrate
it with the LDAP naming system, you will be able to support a single sign
on (SSO) environment in your enterprise through Kerberos. You will also be
able to use that same identity system when querying LDAP naming data on a
per-user or per-host basis.</para>
</note><para><indexterm><primary>access control information</primary></indexterm>To
access the information in the LDAP repository, clients can first establish
identity with the directory server. This identity can be either anonymous
or as an object recognized by the LDAP server. Based on the client's identity
and the server's access control information (ACI), the LDAP server will allow
the client to read or write directory information. For more information on
ACIs, consult the <citetitle>Administration Guide</citetitle> for the version
of Sun Java System Directory Server that you are using.</para><para>If the client is connecting as anything other than anonymous for any
given request, the client must prove its identity to the server using an authentication
method supported by both the client and the server. Once the client has established
its identity, it can then make the various LDAP requests.</para><para>When you use <literal>pam_ldap</literal> there is a distinction between
how the naming service and the authentication service (<literal>pam_ldap</literal>)
access the directory. The naming service reads various entries and their attributes
from the directory based on predefined identity. The authentication service
establishes whether the user has entered the correct password by using that
user's name and password to authenticate to the LDAP server.  See the <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page for
more information about the authentication service.</para><para>When Kerberos is used to perform authentication, and when authentication
in LDAP naming services is also enabled (as is required for per-user mode),
Kerberos can provide dual functions. Kerberos authenticates to the server
and the Kerberos identity for the principal (user or host) is used to authenticate
to the directory.  In this way, the same user identity used to authenticate
to the system is also used to authenticate to the directory for lookups. Administrators
can use access control information (ACI) in the directory to limit the results
out of the naming service if desired.</para>
</sect2><sect2 id="ldapsecure-73"><title>Transport Layer Security (TLS)</title><note><para>In order to use TLS for Solaris LDAP naming services, the directory
server must use the default ports, 389 and 636, for LDAP and SSL, respectively.
If your directory server does not use these ports, you cannot use TLS at this
time.</para>
</note><para><indexterm><primary>Transport Layer Security</primary></indexterm><indexterm><primary>SSL protocol</primary></indexterm>TLS can be used to secure communication
between an LDAP client and the directory server, providing both privacy and
data integrity. The TLS protocol is a superset of the Secure Sockets Layer
(SSL) protocol. Solaris LDAP naming services support TLS connections. Be aware
that using SSL adds load to the directory server and the client.</para><para>You will need to set up your directory server for SSL. For more information
about setting up Sun Java System Directory Server for SSL, see the Administration Guide for the
version of Sun Java System Directory Server that you are using. You will also need to set up your
LDAP client for SSL.</para><para>If using TLS, the necessary security databases must be installed. In
particular, the certificate and key database files are needed. For example,
if you adopt an older database format from Netscape Communicator, two files, <filename>cert7.db</filename> and <filename>key3.db</filename>, are required. Or if
you use a new database format from Mozilla, three files, <filename>cert8.db</filename>, <filename>key3.db</filename>, and <filename>secmod.db</filename> are needed. The <filename>cert7.db</filename> or <filename>cert8.db</filename>file contains trusted
certificates. The <filename>key3.db</filename>file contains the client's keys.
Even if the LDAP naming service client does not use client keys, this file
must be present. The <filename>secmod.db</filename> file contains the security
modules such as the <literal>PKCS#11</literal> module. This file is not required
if the older format is used.</para><para>See <olink targetptr="clientsetup-57" remap="internal">Setting Up TLS Security</olink> for
more information.</para>
</sect2><sect2 id="ldapsecure-74"><title>Assigning Client Credential Levels</title><para><indexterm><primary>Credential Levels</primary><secondary>LDAP client</secondary></indexterm>LDAP naming services  clients authenticate to the LDAP server
according to a client's credential level. LDAP clients can be assigned four
possible credential levels with which to authenticate to a directory server.</para><itemizedlist><listitem><para><literal>anonymous</literal></para>
</listitem><listitem><para><indexterm><primary>proxy credential level</primary></indexterm><literal>proxy</literal></para>
</listitem><listitem><para><indexterm><primary>proxy anonymous credential level</primary></indexterm><literal>proxy anonymous</literal></para>
</listitem><listitem><para><indexterm><primary>per-user index level</primary></indexterm><indexterm><primary>self credential level</primary></indexterm><literal>self</literal> (called
per user in this document)</para>
</listitem>
</itemizedlist><para><emphasis>Anonymous</emphasis></para><para>If you use <literal>anonymous</literal> access, you can access only
the data that is available to everyone. In anonymous mode, an LDAP BIND operation
does not take place. Also, you should consider the security implications.
Allowing <literal>anonymous</literal> access for certain parts of the directory
implies that anyone with access to the directory has read access. If you use
an <literal>anonymous</literal> credential level, you need to allow read access
to all the LDAP naming entries and attributes.</para><caution><para>Allowing <literal>anonymous</literal> write to a directory
should never be done, as anyone could change information in the DIT to which
they have write access, including another user's password, or their own identity. </para>
</caution><note><para>Sun Java System Directory Server allows you to restrict access based on IP addresses,
DNS name, authentication method, and time-of-day. You might want to limit
access with further restrictions. For more information, see &ldquo;Managing
Access Control&rdquo; in the <citetitle>Administration Guide</citetitle> for
the version of Sun Java System Directory Server that you are using.</para>
</note><para><emphasis>Proxy</emphasis></para><para><indexterm><primary>proxy credentials</primary></indexterm>The client
authenticates or binds to the directory using a single proxy account. This
proxy account can be any entry that is allowed to bind to the directory. This
proxy account needs sufficient access to perform the naming service functions
on the LDAP server.  The proxy account is a shared-per-machine resource. 
That is, each user logged into a machine using proxy access, including the
root user, sees the same results as all other users on that machine. You need
to configure the <literal>proxyDN</literal> and <literal>proxyPassword</literal> on
every client using the <literal>proxy</literal> credential level. The encrypted
 <literal>proxyPassword</literal> is stored locally on the client. You can
set up different proxies for different groups of clients. For example, you
can configure a proxy for all the sales clients  to access both the company-wide-accessible
and sales directories, while preventing sales clients from accessing human
resource directories with payroll information. Or, in the most extreme cases,
you can either assign different proxies to each client or assign just one
proxy to all clients. A typical LDAP deployment would probably lie between
the two extremes. Consider the choices carefully. Too few proxy agents might
limit your ability to control user access to resources. However, having too
many proxies complicates the setup and maintenance of the system.  You need
to grant the appropriate rights to the proxy user, depending on your environment.
 See <olink targetptr="ldapsecure-93" remap="internal">Credential Storage</olink> for information
on how to determine which authentication method makes the most sense for your
configuration.</para><para>If the password changes for a proxy user, you need to update it on every
client that uses that proxy user. If you use password aging on LDAP accounts,
be sure to turn it off for proxy users.</para><note><para>Be aware that the proxy credential level applies to all users
and processes on any given machine. If two users need to use different naming
policies, they must use different machines, or they must use the per-user
authentication model.</para>
</note><para>In addition, if clients are using a <literal>proxy</literal> credential
to authenticate, the <literal>proxyDN</literal> must have the same <literal>proxyPassword</literal> on all of the servers.</para><para><indexterm><primary>proxy anonymous credentials</primary></indexterm><emphasis>Proxy anonymous</emphasis></para><para><literal>Proxy anonymous</literal> is a multi-valued entry, in that
more than one credential level is defined. A client assigned the <literal>proxy
anonymous</literal> level will first attempt to authenticate with its proxy
identity. If the client is unable to authenticate as the proxy user for whatever
reason (user lockout, password expired, for example), then the client will
use anonymous access. This might lead to a different level of service, depending
on how the directory is configured.</para><para><indexterm><primary>per-user credentials</primary></indexterm><emphasis>Per
User</emphasis></para><para>Per-user (self) authentication uses the Kerberos identity (principal)
to perform a lookup for each user or each system when authenticating to the
directory server. With per-user authentication, the system administrator can
use access control instructions (ACI's), access control lists (ACL's), roles,
groups or other directory access control mechanisms to grant or deny access
to specific naming service data for specific users or systems.  </para><note><para>When configuring per-user mode, the configuration value to enable
this mode is &ldquo;self,&rdquo; which denotes per-user mode.</para>
</note><para>To use the per-user authentication model, the Kerberos single sign-on
service must be deployed. In addition, the one or more directory servers used
in the deployment must support SASL and the SASL/GSSAPI authentication mechanism.
 Because Kerberos expects to use files and DNS for host name lookups, instead
of LDAP, DNS should be deployed in this environment.  Also, to use per-user
authentication, nscd must be enabled. Nscd is not an optional component in
this configuration.</para><sect3 id="ldapsecure-93"><title>Credential Storage</title><para><indexterm><primary>Credential Storage</primary><secondary>LDAP client</secondary></indexterm>If you configure a client to use a proxy identity, the client
saves its <literal>proxyDN</literal> and <literal>proxyPassword</literal> in <filename>/var/ldap/ldap_client_cred</filename>. For the sake of increased security,
this file is restricted to root access only, and the value of <literal>proxyPassword</literal> is encrypted. While past LDAP implementations have stored proxy
credentials in a client's profile, Solaris 9 LDAP naming services do not.
Any proxy credentials set using <command>ldapclient</command> during initialization
are stored locally. This results in improved security surrounding a proxy's
DN and password information. See <olink targetptr="clientsetup-1" remap="internal">Chapter&nbsp;12,
Setting Up LDAP Clients (Tasks)</olink> for more information on setting up
client profiles.</para><para>If you configure a client to use per-user authentication, the Kerberos
identity and Kerberos ticket information for each principal (each user or
host) are used during authentication.  In this environment the directory server
maps the Kerberos principal to a DN and the Kerberos credentials are used
to authenticate to that DN. The directory server can then use its access control
instruction (ACI) mechanisms to allow or deny access to naming service data
as necessary. In this situation, Kerberos ticket information is used to authenticate
to the directory server and the system does not store authentication DNs or
passwords on the system.</para>
</sect3>
</sect2><sect2 id="ldapsecure-75"><title>Choosing Authentication Methods</title><para>When you assign the <literal>proxy</literal> or <literal>proxy-anonymous</literal> credential
level to a client, you also need to select a method by which the proxy authenticates
to the directory server. By default, the authentication method is <literal>none</literal>,
which implies anonymous access. The authentication method may also have a
transport security option associated with it.</para><para><indexterm><primary>authentication methods</primary><secondary>none</secondary></indexterm>The authentication method, like the credential level, may be multivalued.
For example, in the client profile you could specify that the client first
tries to bind using the <literal>simple</literal> method secured by TLS. If
unsuccessful, the client would try to bind with the <literal>sasl/digest-MD5</literal> method.
The <literal>authenticationMethod</literal> would then be <literal>tls:simple;sasl/digest-MD5</literal>.</para><para>LDAP naming services support some Simple Authentication and Security
Layer (SASL) mechanisms. These mechanisms allow for a secure password exchange
without requiring TLS. However, these mechanisms do not provide data integrity
or privacy. See RFC 2222 for information on SASL.</para><para>The following authentication mechanisms are supported.</para><itemizedlist><listitem><para><literal>none</literal></para><para>The client does not authenticate
to the directory. This is equivalent to the <literal>anonymous</literal> credential
level.</para>
</listitem><listitem><para><indexterm><primary>authentication</primary><secondary>simple</secondary></indexterm><literal>simple</literal></para><para><indexterm><primary>ipsec(7)</primary></indexterm>If the client machine uses the <literal>simple</literal> authentication
method, it binds to the server by sending the user's password in the clear.
The password is thus subject to snooping unless the session is protected by <command>ipsec</command>(7). The primary advantages of using the <literal>simple</literal> authentication
method are that all directory servers support it and that it is easy to set
up.</para>
</listitem><listitem><para><indexterm><primary>authentication</primary><secondary>digest-MD5</secondary></indexterm><literal>sasl/digest-MD5</literal></para><para>The
client's password is protected during authentication, but the session is not
encrypted. Some directory servers, including Sun Java System Directory Server, also support the <literal>sasl/digest-MD5</literal> authentication method. The primary advantage of <literal>digest-MD5</literal> is that the password does not go over the wire in the
clear during authentication and therefore is more secure than the <literal>simple</literal> authentication method. See RFC 2831 for information on  <literal>digest-MD5</literal>. <literal>digest-MD5</literal> is considered an improvement over <literal>cram-MD5</literal> for its improved security.</para><para>When using <literal>sasl/digest-MD5</literal>, the authentication is secure, but the session is not protected.</para><note><para>If you are using Sun Java System Directory Server, the password <emphasis>must be stored
in the clear</emphasis> in the directory.</para>
</note>
</listitem><listitem><para><literal>sasl/cram-MD5</literal></para><para>In this case,
the LDAP session is not encrypted, but the client's password is protected
during authentication, as authentication is performed by using <literal>sasl/cram-MD5</literal>.</para><para>See RFC 2195 for information on the <literal>cram-MD5</literal> authentication
method. <literal>cram-MD5</literal> is only supported by some directory servers.
For instance, Sun Java System Directory Server does not support <literal>cram-MD5</literal>.</para>
</listitem><listitem><para><literal>sasl/GSSAPI</literal></para><para>This authentication
method is used in conjunction with the self credential mode to enable per-user
lookups. A per-user nscd assigned to use the client's credentials binds to
the directory server using the sasl/GSSAPI method and the client's Kerberos
credentials. Access can be controlled in the directory server on a per-user
basis.</para>
</listitem><listitem><para><literal>tls:simple</literal></para><para>The client binds
using the <literal>simple</literal> method and the session is encrypted. The
password is protected.</para>
</listitem><listitem><para><literal>tls:sasl/cram-MD5</literal></para><para>The LDAP
session is encrypted and the client authenticates to the directory server
using <literal>sasl/cram-MD5</literal>.</para>
</listitem><listitem><para><literal>tls:sasl/digest-MD5</literal></para><para>The LDAP
session is encrypted and the client authenticates to the directory server
using <literal>sasl/digest-MD5</literal>.</para>
</listitem>
</itemizedlist><caution><para>Sun Java System Directory Server requires passwords to be stored in the clear in
order to use <literal>digest-MD5</literal>. If the authentication method is
set to <literal>sasl/digest-MD5</literal> or <literal>tls:sasl/digest-MD5</literal>,
then the passwords for the proxy user will need to be stored in the clear.
Be especially careful that the <literal>userPassword</literal> attribute has
the proper ACIs if it is stored in the clear, so that it is not readable.</para>
</caution><para>The following table summarizes the various authentication methods and
their respective characteristics.</para><table frame="topbot" id="ldapsecure-tbl-5"><title>Authentication Methods</title><tgroup cols="5" colsep="0" rowsep="0"><?PubTbl tgroup dispwid="6.89in"?><colspec colname="colspec0" colwidth="23.67*"/><colspec colname="colspec1" colwidth="10.53*"/><colspec colname="colspec3" colwidth="13.41*"/><colspec colname="colspec4" colwidth="12.99*"/><colspec colname="colspec5" colwidth="19.93*"/><thead><row rowsep="1"><entry><para></para>
</entry><entry><para>Bind</para>
</entry><entry colname="colspec3"><para>Password on wire</para>
</entry><entry><para>Password on Sun Java System Directory Server</para>
</entry><entry><para>Session</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>none</literal></para>
</entry><entry><para>No</para>
</entry><entry colname="colspec3"><para>N/A</para>
</entry><entry><para>N/A</para>
</entry><entry><para>No encryption</para>
</entry>
</row><row><entry><para><literal>simple</literal></para>
</entry><entry><para>Yes</para>
</entry><entry colname="colspec3"><para>Clear</para>
</entry><entry><para>Any</para>
</entry><entry><para>No encryption</para>
</entry>
</row><row><entry><para><literal>sasl/digest-MD5</literal></para>
</entry><entry><para>Yes</para>
</entry><entry colname="colspec3"><para>Encryption</para>
</entry><entry><para>Clear</para>
</entry><entry><para>No encryption</para>
</entry>
</row><row><entry><para><literal>sasl/cram-MD5</literal></para>
</entry><entry><para>Yes</para>
</entry><entry colname="colspec3"><para>Encryption</para>
</entry><entry><para>N/A</para>
</entry><entry><para>No encryption</para>
</entry>
</row><row><entry><para><literal>sasl/GSSAPI</literal></para>
</entry><entry><para>Yes</para>
</entry><entry><para>Kerberos</para>
</entry><entry><para>Kerberos</para>
</entry><entry><para>Encryption</para>
</entry>
</row><row><entry><para><literal>tls:simple</literal></para>
</entry><entry><para>Yes</para>
</entry><entry colname="colspec3"><para>Encryption</para>
</entry><entry><para>Any</para>
</entry><entry><para>Encryption</para>
</entry>
</row><row><entry colname="colspec0"><para><literal>tls:sasl/cram-MD5</literal></para>
</entry><entry colname="colspec1"><para>Yes</para>
</entry><entry colname="colspec3"><para>Encryption</para>
</entry><entry colname="colspec4"><para>N/A</para>
</entry><entry colname="colspec5"><para>Encryption</para>
</entry>
</row><row><entry colname="colspec0"><para><literal>tls:sasl/digest-MD5</literal></para>
</entry><entry colname="colspec1"><para>Yes</para>
</entry><entry colname="colspec3"><para>Encryption</para>
</entry><entry colname="colspec4"><para>Clear</para>
</entry><entry colname="colspec5"><para>Encryption</para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect3 id="ldapsecure-95"><title>Authentication and Services</title><para>The authentication method can be specified for a given service in the <literal>serviceAuthenticationMethod</literal> attribute. The following services currently
support this.</para><itemizedlist><listitem><para><literal>passwd-cmd</literal></para><para>This service is
used by <olink targetdoc="group-refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> to
change the login password and password attributes.</para>
</listitem><listitem><para><literal>keyserv</literal></para><para>This service is used
by the <olink targetdoc="group-refman" targetptr="chkey-1" remap="external"><citerefentry><refentrytitle>chkey</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="newkey-1m" remap="external"><citerefentry><refentrytitle>newkey</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> utilities
to create and change a user's Diffie-Hellman key pair.</para>
</listitem><listitem><para><literal>pam_ldap</literal></para><para>This service is used
for authenticating users with <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>.</para><para><filename>pam_ldap</filename> supports
account management.</para>
</listitem>
</itemizedlist><note><para>If the service does not have a <literal>serviceAuthenticationMethod</literal> set,
it will default to the value of the <literal>authenticationMethod</literal> attribute. </para>
</note><note><para>In per-user mode, <olink targetptr="geeix" remap="internal">pam_krb5</olink> (pam
Kerberos) is used as the authentication service. <literal>ServiceAuthenticationMethod</literal> is not needed in this mode of operation.</para>
</note><para>The following example shows a section of a client profile in which the
users will use <literal>sasl/digest-MD5</literal> to authenticate to the directory
server, but will use an SSL session to change their password.</para><screen>serviceAuthenticationMethod=pam_ldap:sasl/digest-MD5
serviceAuthenticationMethod=passwd-cmd:tls:simple</screen>
</sect3>
</sect2><sect2 id="ldapsecure-83"><title>Pluggable Authentication Methods</title><indexterm><primary>PAM</primary>
</indexterm><indexterm><primary>Pluggable Authentication Methods</primary>
</indexterm><para>By using the PAM framework, you can choose among several authentication
services, including <command>pam_unix</command>, <command>pam_krb5</command>,
and <command>pam_ldap</command>.</para><para>If the per-user authentication method is used, <literal>pam_krb5</literal>,
the strongest authentication service of the three methods listed above, must
be enabled.  See <olink targetdoc="group-refman" targetptr="pam-krb5-5" remap="external"><citerefentry><refentrytitle>pam_krb5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> and
the <olink targetdoc="sysadv6" remap="external"><citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para><para>The pam_krb5 authentication system may be used even if per-user authentication
is not enabled.  If proxy or anonymous credential levels are used to access
directory server data then restricting access to directory data on a per-user
basis is not possible.</para><para>Because of its increased flexibility, support of stronger authentication
methods, and ability to use account management, the use of <command>pam_ldap</command> is
recommended over the use of <command>pam_unix</command> when anonymous or
proxy authentication methods are used.</para><sect3 id="ldapsecure-108"><title><command>pam_unix</command></title><para>If you have not changed the <olink targetdoc="group-refman" targetptr="pam.conf-4" remap="external"><citerefentry><refentrytitle>pam.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> file, <command>pam_unix</command> functionality
is enabled by default.</para><note><para>The <command>pam_unix</command> module has been removed and is
no longer supported with Solaris. A set of other service modules provides
equivalent or greater functionality. Therefore, in this guide, <command>pam_unix</command> refers
to the equivalent functionality, not to the <command>pam_unix</command> module
itself.</para>
</note><para>Following is a list of the modules that provide the equivalent <command>pam_unix</command> functionality.</para><simplelist><member><olink targetdoc="group-refman" targetptr="pam-authtok-check-5" remap="external"><citerefentry><refentrytitle>pam_authtok_check</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-authtok-get-5" remap="external"><citerefentry><refentrytitle>pam_authtok_get</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-authtok-store-5" remap="external"><citerefentry><refentrytitle>pam_authtok_store</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-dhkeys-5" remap="external"><citerefentry><refentrytitle>pam_dhkeys</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-passwd-auth-5" remap="external"><citerefentry><refentrytitle>pam_passwd_auth</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-unix-account-5" remap="external"><citerefentry><refentrytitle>pam_unix_account</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-unix-auth-5" remap="external"><citerefentry><refentrytitle>pam_unix_auth</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-unix-cred-5" remap="external"><citerefentry><refentrytitle>pam_unix_cred</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member><member><olink targetdoc="group-refman" targetptr="pam-unix-session-5" remap="external"><citerefentry><refentrytitle>pam_unix_session</refentrytitle><manvolnum>5</manvolnum>
</citerefentry></olink></member>
</simplelist><para><command>pam_unix</command> follows the traditional model of UNIX authentication,
as described in the following list.</para><orderedlist><listitem><para>The client retrieves the user's encrypted password from the
name service.</para>
</listitem><listitem><para>The user is prompted for his password.</para>
</listitem><listitem><para>The user's password is encrypted.</para>
</listitem><listitem><para>The client compares the two encrypted passwords to determine
whether the user should be authenticated.</para>
</listitem>
</orderedlist><para>Additionally, there are two restrictions when using <command>pam_unix</command>.</para><itemizedlist><listitem><para>The password must be stored in UNIX <literal>crypt</literal> format
and not in any other encryption methods, including clear.</para>
</listitem><listitem><para>The <literal>userPassword</literal> attribute must be readable
by the name service.</para><para>For example, if you set the credential level
to <literal>anonymous</literal>, then anyone must be able to read the <literal>userPassword</literal> attribute. Similarly, If you set the credential level to <literal>proxy</literal>, then the proxy user must be able to read the <literal>userPassword</literal> attribute.</para>
</listitem>
</itemizedlist><note><para><command>pam_unix</command> is not compatible with the <literal>sasl</literal> authentication
method <literal>digest-MD5</literal>, since Sun Java System Directory Server requires passwords
to be stored in the clear in order to use <literal>digest-MD5. pam_unix</literal> requires
the password be stored in <literal>crypt</literal> format.</para>
</note>
</sect3><sect3 id="geeix"><title><command>pam_krb5</command></title><para>Refer to <olink targetdoc="group-refman" targetptr="pam-krb5-5" remap="external"><citerefentry><refentrytitle>pam_krb5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> and
the <olink targetdoc="sysadv6" remap="external"><citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</sect3><sect3 id="ldapsecure-107"><title><command>pam_ldap</command></title><para>When implementing <literal>pam_ldap</literal>, the user binds to the
LDAP server by using the authentication method defined in <literal>pam_ldap</literal>'s <literal>serviceAuthenticationMethod</literal> parameter, if one exists. Otherwise, <literal>authenticationMethod</literal> is used.</para><para>If <command>pam_ldap</command> is able to bind to the server with the
user's identity and supplied password, it authenticates the user.</para>&pamldapnote;<para><command>pam_ldap</command> does not read the <literal>userPassword</literal> attribute.
Therefore, there is no need to grant access to read the <literal>userPassword</literal> attribute
unless there are other clients using <command>pam_unix</command>. Also, <command>pam_ldap</command> does not support the <literal>none</literal> authentication
method. Thus, you must define the <literal>serviceAuthenticationMethod</literal> or
the <literal>authenticationMethod</literal> attributes so clients can use <command>pam_ldap</command>. See the <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page for more information.</para><caution><para>If the <literal>simple</literal> authentication method is used,
the <literal>userPassword</literal> attribute can be read on the wire by third
parties.</para>
</caution><para>See <olink targetptr="schemas-111" remap="internal">Example pam.conf File for pam_ldap</olink>.</para><para>The following table summarizes the main differences between <literal>pam_unix</literal>, <literal>pam_ldap</literal>, and <literal>pam_krb5</literal>.</para><table frame="topbot" id="ldapsecure-tbl-4"><title><literal>pam_unix</literal> versus <literal>pam_ldap</literal> versus <literal>pam_krb5</literal></title><tgroup cols="4" colsep="0" rowsep="0"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colname="colspec0" colwidth="33.00*"/><thead><row rowsep="1"><entry><para></para>
</entry><entry><para><literal>pam_unix</literal></para>
</entry><entry><para><literal>pam_ldap</literal></para>
</entry><entry><para><literal>pam_krb5</literal></para>
</entry>
</row>
</thead><tbody><row><entry><para>Password Sent </para>
</entry><entry><para>Uses <literal>passwd</literal> service authentication method </para>
</entry><entry><para>Uses <literal>passwd</literal> service authentication method</para>
</entry><entry><para>Uses Kerberos single sign on technology, not passwords</para>
</entry>
</row><row><entry><para>New Password Sent</para>
</entry><entry><para>Encrypted</para>
</entry><entry><para>No encryption (unless TLS is used)</para>
</entry><entry><para>Uses Kerberos, no passwords are sent over the wire</para>
</entry>
</row><row><entry><para>New Password Stored</para>
</entry><entry><para><literal>crypt</literal> format</para>
</entry><entry><para>Password storage scheme defined on Sun Java System Directory Server</para>
</entry><entry><para>Passwords are managed via Kerberos</para>
</entry>
</row><row><entry><para>Requires password read?</para>
</entry><entry><para>Yes</para>
</entry><entry><para>No</para>
</entry><entry><para>No</para>
</entry>
</row><row><entry><para><literal>sasl/digest-MD5</literal> compatibility after changing password</para>
</entry><entry><para>No. Password is not stored in <literal>clear</literal>. User cannot
authenticate. </para>
</entry><entry><para>Yes. As long as default storage scheme is set to <literal>clear</literal>,
user can authenticate. </para>
</entry><entry><para>No. sasl/GSSAPI is used. There are no passwords over the wire and there
are no passwords to be stored in the directory server, except when using a
Kerberos kdc that manages its password database in the LDAP directory server.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect3><sect3 id="ldapsecure-96"><title>PAM and Changing Passwords</title><para>Use <olink targetdoc="group-refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> to
change a password. In order to change the password, the <literal>userPassword</literal> attribute
must be writable by the user. Remember that the <literal>serviceAuthenticationMethod</literal> for <literal>passwd-cmd</literal> overrides the <literal>authenticationMethod</literal> for this operation. Depending on the authentication used, the current
password might be unencrypted on the wire.</para><para>In the case of <literal>pam_unix</literal>, the new <literal>userPassword</literal> attribute
is encrypted using UNIX <literal>crypt</literal> format and tagged before
being written to LDAP. Therefore, the new password is encrypted on the wire,
regardless of the authentication method used to bind to the server. See the <olink targetdoc="group-refman" targetptr="pam-authtok-store-5" remap="external"><citerefentry><refentrytitle>pam_authtok_store</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page for more information.</para><para>As of the Solaris 10 software release, <command>pam_ldap</command> no
longer supports password update. The previously recommended use of <command>pam_authtok_store</command> with the <literal>server_policy</literal> option now replaces the <command>pam_ldap</command> password update capability. When you use <command>pam_authtok_store</command>, the new password is sent to the LDAP server in the clear. Therefore,
to ensure privacy, use TLS. If TLS is not used, the new <literal>userPassword</literal> is
subject to snooping.  If you set an untagged password with Sun Java System Directory Server, the
software encrypts the password by using the <literal>passwordStorageScheme</literal> attribute.
For more information about the <literal>passwordStorageScheme</literal>, see
the section on user account management in the <citetitle>Administration Guide</citetitle> for
the version of Sun Java System Directory Server that you are using.</para><note><para>You need to consider the following configuration issues when setting
the <literal>passwordStorageScheme</literal> attribute. If a NIS, NIS+, or
another client using <literal>pam_unix</literal> is using LDAP as a repository,
then <literal>passwordStorageScheme</literal> needs to be <literal>crypt</literal>.
Also, if using <literal>pam_ldap</literal> with <literal>sasl/digest-MD5</literal> with Sun Java System Directory Server, <literal>passwordStorageScheme</literal> must be set to clear.</para>
</note>
</sect3>
</sect2><sect2 id="ldapsecure-76"><title>Account Management</title><para>If you select <literal>pam_krb5</literal> as your account and password
management system, the Kerberos environment will manage all your account,
password, account lockout, and other account management details. Refer to <olink targetdoc="group-refman" targetptr="pam-krb5-5" remap="external"><citerefentry><refentrytitle>pam_krb5</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> and the <olink targetdoc="sysadv6" remap="external"><citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para><para>If you do not use <literal>pam_krb5</literal>, then LDAP naming services
can be configured to take advantage of the password and account lockout policy
support in Sun Java System Directory Server. You can configure <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> to support user account management. <olink targetdoc="group-refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> enforces password
syntax rules set by the Sun Java System Directory Server password policy, when used with the proper
PAM configuration.</para><para><indexterm><primary>Password Management</primary><see>Account Management</see></indexterm><indexterm><primary>LDAP</primary><secondary>account management</secondary></indexterm><indexterm><primary>Account Management</primary></indexterm>The
following account management features are supported through <olink targetdoc="group-refman" targetptr="pam-ldap-5" remap="external"><citerefentry><refentrytitle>pam_ldap</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>. These features
depend on Sun Java System Directory Server's password and account lockout policy configuration.
You can enable as many or as few of the features as you want.</para><itemizedlist><listitem><para>Password aging and expiration notification</para><para>Users
must change their passwords according to a schedule. A password expires if
it is not changed within the time configured. An expired password causes user
authentication to fail.</para><para>Users see a warning message whenever they
log in within the expiration warning period. The message specifies the number
of hours or days until the password expires.</para>
</listitem><listitem><para>Password syntax checking</para><para>New passwords must meet
the minimum password length requirements. In addition, a password cannot match
the value of the <literal>uid</literal>, <literal>cn</literal>, <literal>sn</literal>,
or <literal>mail</literal> attributes in the user's directory entry.</para>
</listitem><listitem><para>Password in history checking</para><para>Users cannot reuse
passwords. If a user attempts to change the password to one that was previously
used, <olink targetdoc="group-refman" targetptr="passwd-1" remap="external"><citerefentry><refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> fails.
LDAP administrators can configure the number of passwords kept in the server's
history list.</para>
</listitem><listitem><para>User account lockout</para><para>A user account can be locked
out after a given number of repeated authentication failures. A user can also
be locked out if his account is inactivated by an administrator. Authentication
will continue to fail until the account lockout time is passed or the administrator
reactivates the account.</para>
</listitem>
</itemizedlist><note><para>The preceding account management features only work with the Sun Java System Directory Server.
  For information about configuring the password and account lockout policy
on the server, see the &ldquo;User Account Management&rdquo; chapter in the
Administration Guide for the version of Sun Java System Directory Server that you are using.  
Also see <olink targetptr="schemas-250" remap="internal">Example pam_conf file for pam_ldap
Configured for Account Management</olink>. Do not enable account management
for <literal>proxy</literal> accounts.</para>
</note><para>Before configuring the password and account lockout policy on Sun Java System Directory Server,
make sure all hosts use the &ldquo;newest&rdquo; LDAP client with <literal>pam_ldap</literal> account management.</para><para>In addition, make sure the clients have a properly configured <olink targetdoc="group-refman" targetptr="pam.conf-4" remap="external"><citerefentry><refentrytitle>pam.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> file. Otherwise,
LDAP naming services will not work when <literal>proxy</literal> or user passwords
expire.</para>&pamldapnote;
</sect2>
</sect1>
</chapter><?Pub *0000072567 0?>