After you have performed all of the steps to secure your servers, additional security requirements can be set for your clients.
Client authentication is not essential to an SSL connection, but it does give extra assurance that encrypted information is being sent to the correct parties. You can use client authentication in a reverse proxy to make sure that your content server does not share information with unauthorized proxies or clients.
This section contains the following topics:
You can enable the listen sockets for your Administration Server and each server instance to require client authentication. When client authentication is enabled, the client’s certificate is required before the server sends a response to a query.
Proxy Server supports authenticating client certificates by matching the CA in the client certificate with a CA trusted for signing client certificates. You can view a list of CAs trusted for signing client certificates on the Manage Certificates page through the Security tabs.
You can configure the Proxy Server to refuse any client that does not have a client certificate from a trusted CA. To accept or reject trusted CAs, client trust must be set for the CA. For more information, see Managing Certificates.
Proxy Server logs an error, rejects the certificate, and returns a message to the client if the certificate has expired. You can also view which certificates have expired on the Manage Certificates page.
You can configure your server to gather information from the client certificate and match it with a user entry in an LDAP directory. This process ensures that the client has a valid certificate and an entry in the LDAP directory. It can also ensure that the client certificate matches the one in the LDAP directory. To learn how to do this, Mapping Client Certificates to LDAP.
You can combine client certificates with access control, so that in addition to being from a trusted CA, the user associated with the certificate must match the access control rules (ACLs). For more information, see Using Access Control Files.
Access either the Administration Server or the Server Manager and click the Preferences tab.
Click the Edit Listen Sockets link.
Click the link for the listen socket for which you are requiring client authentication.
Use the Client Authentication drop-down list to require client authentication for the listen socket, and click OK.
In a reverse proxy, you can configure client authentication according to any of the following scenarios:
Proxy-Authenticates-Client. This scenario enables you to allow access to all clients with acceptable certificates, or to allow access to only those clients that have acceptable certificates and are recognized users on the access control list for your Proxy Server.
Proxy must have the user root keys of the CA or the self-signing application which signed the user certificate. User must have loaded Proxy Server root keys of either the CA or the self-signing application which signed the Proxy Server certificate.
Content-Server-Authenticates-Proxy. This scenario enables you to make sure that your content server is actually connecting with your Proxy Server and not some other server.
Proxy must have the content server root keys of either the CA or the self-signing application which signed the Content Server certificate. Content Server must have the Proxy Server root keys of either the CA or the self-signing application which signed the Proxy Server certificate.
Proxy-Authenticates-Client and Content-Server-Authenticates-Proxy. This scenario provides the maximum security and authentication for your reverse proxy.
For information about how to configure these scenarios, see Setting Up Client Authentication in a Reverse Proxy.
Client authentication in a secure reverse proxy provides further insurance that your connections are secure. The following instructions explain how to configure client authentication according to the scenario you choose.
Each scenario assumes that you have both a secure Client-to-Proxy connection and a secure Proxy-to-Content-Server connection.
Follow the directions for configuring the secure Client-to-Proxy and secure Proxy-to-Content Server scenario in “Setting up a Reverse Proxy” in Chapter 14, Using a Reverse Proxy.
Access the Server Manager for a server instance and click the Preferences tab.
Click the Edit Listen Sockets link, and then click the link for the desired listen socket in the table that displays.
(Use the Add Listen Socket link to configure and add listen sockets.)
Specify client authentication requirements:
To permit access to all users with valid certificates:
In the Security section, use the Client Authentication setting to require client authentication on this listen socket. If a server certificate has not been installed, this setting will not be visible.
To permit access to only those users who have both valid certificates and are specified as acceptable users in access control:
In the Security section, leave the Client Authentication setting set to off. If a server certificate has not been installed, this setting will not be visible.
On the Server Manager Preferences tab for this server instance, click the Administer Access Control link.
Select an ACL, and then click the Edit button.
The Access Control Rules For page displays (authenticate first, if prompted).
Turn access control on (select the Access control Is On checkbox if not already selected).
Set your Proxy Server to authenticate as a reverse proxy.
For more information, see Setting up a Reverse Proxy.
Click the Rights link for the desired access control rule, specify access rights in the lower frame, and then click Update to update this entry.
Click the Users/Groups link. In the lower frame. Specify users and groups, select SSL as the authentication method, and click Update to update this entry.
Click Submit in the upper frame to save your entries.
For more information about setting access control, see Chapter 8, Controlling Access to Your Server.
Follow the directions for configuring the secure Client-to-Proxy and secure Proxy-to-Content-Server scenario in Setting up a Reverse Proxy.
On your content server, turn client authentication on.
You can modify this scenario so that you have an unsecure client connection to the Proxy Server, a secure connection to the content server, and the content server authenticates the Proxy Server. To do so, you must turn encryption off and require the proxy to initialize certificates only as described in the following procedure.
Follow the directions for configuring the Proxy-Authenticates-Client scenario in To Configure the Proxy-Authenticates-Client Scenario.
On your content server, turn client authentication on.
This section describes the process that the Proxy Server uses to map a client certificate to an entry in an LDAP directory. Before mapping client certificates to LDAP, you must also configure the required ACLs. For more information, see Chapter 8, Controlling Access to Your Server.
When the server receives a request from a client, the server asks for the client’s certificate before proceeding. Some clients send the client certificate to the server along with the request.
The server tries to match the CA to the list of trusted CAs in the Administration Server. If a match does not exist, Proxy Server ends the connection. If a match exists, the server continues processing the request.
After verifying that the certificate is from a trusted CA, the server maps the certificate to an LDAP entry by doing the following:
Mapping the issuer and subject DN from the client certificate to a branch point in the LDAP directory
Searching the LDAP directory for an entry that matches the information about the subject (end user) of the client certificate
(Optional) Verifying the client certificate with one in the LDAP entry that corresponds to the DN
The server uses a certificate mapping file called certmap.conf to determine how the LDAP search is performed. The mapping file tells the server what values to take from the client certificate such as the end user’s name, email address, and so on. The server uses these values to search for a user entry in the LDAP directory, but first the server must determine where in the LDAP directory to start the search. The certificate mapping file also tells the server where to start.
Once the server knows where to start the search and what to search for, it performs the search in the LDAP directory (second point). If it finds no matching entry or more than one matching entry, and the mapping is not set to verify the certificate, the search fails.
The following table lists the expected search result behavior. You can specify the expected behavior in the ACL. For example, you can specify that the Proxy Server accepts only you if the certificate match fails. For more information about how to set the ACL preferences, see Using Access Control Files.
Table 5–1 LDAP Search Results
LDAP Search Result |
Certificate Verification ON |
Certificate Verification OFF |
---|---|---|
No entry found |
Authentication fails |
Authentication fails |
Exactly one entry found |
Authentication fails |
Authentication succeeds |
More than one entry found |
Authentication fails |
Authorization fails |
After the server finds a matching entry and certificate in the LDAP directory, the server can use that information to process the transaction. For example, some servers use certificate-to-LDAP mapping to determine access to a server.
Certificate mapping determines how a server looks up a user entry in the LDAP directory. You can use the certmap.conf file to configure how a certificate, designated by name, is mapped to an LDAP entry. You edit this file and add entries to match the organization of your LDAP directory, and to list the certificates you want your users to have. Users can be authenticated based on user ID, email address, or any other value used in the subjectDN. Specifically, the mapping file defines the following information:
Where in the LDAP tree the server should begin the search
What certificate attributes the server should use as search criteria when searching for the entry in the LDAP directory
Whether the server goes through an additional verification process
The certificate mapping file is found in the following location:
server-root/userdb/certmap.conf
The file contains one or more named mappings, each applying to a different CA. A mapping has the following syntax:
certmap name issuerDNname:property [value]
The first line specifies a name for the entry and the attributes that form the distinguished name found in the CA certificate. The name is arbitrary and can be defined to whatever you prefer. However, issuerDN must exactly match the issuer DN of the CA that issued the client certificate. For example, the following two issuer DN lines differ only in the spaces separating the attributes, but the server treats these two entries as different:
certmap sun1 ou=Sun Certificate Authority,o=Sun,c=UScertmap sun2 ou=Sun Certificate Authority, o=Sun, c=US
If you are using Oracle Directory Server Enterprise Edition and experiencing problems in matching the issuer DN, check the Directory Server error logs for useful information.
The second and subsequent lines in the named mapping match properties with values. The certmap.conf file has six default properties. You can also use the certificate API to customize your own properties. The default properties are:
DNComps is a list of comma-separated attributes used to determine where in the LDAP directory the server should start searching for entries that match the user’s information, that is, the owner of the client certificate. The server gathers values for these attributes from the client certificate and uses the values to form an LDAP DN, which then determines where the server starts its search in the LDAP directory. For example, if DNComps is set to use the o and c attributes of the DN, the server starts the search from the o=org, c= country entry in the LDAP directory, where org and country are replaced with values from the DN in the certificate.
Note the following situations:
If there is no DNComps entry in the mapping, the server uses either the CmapLdapAttr setting or the entire subject DN in the client certificate, that is, the end user’s information.
If the DNComps entry is present but has no value, the server searches the entire LDAP tree for entries matching the filter.
FilterComps is a list of comma-separated attributes used to create a filter by gathering information from the user’s DN in the client certificate. The server uses the values for these attributes to form the search criteria used to match entries in the LDAP directory. If the server finds one or more entries in the LDAP directory that match the user’s information gathered from the certificate, the search is successful and the server optionally performs a verification.
For example, if FilterComps is set to use the email address and user ID attributes (FilterComps=e,uid), the server searches the directory for an entry whose values for email and user ID match the end user’s information gathered from the client certificate. Email addresses and user IDs are good filters because they are usually unique entries in the directory. The filter must be specific enough to match one and only one entry in the LDAP database.
The attribute names for the filters need to be attribute names from the certificate, not from the LDAP directory. For example, some certificates have an e attribute for the user’s email address, whereas LDAP calls that attribute mail.
The following table lists the attributes for x509v3 certificates.
Attribute |
Description |
---|---|
Country |
|
Organization |
|
Common name |
|
Location |
|
State |
|
Organizational unit |
|
UNIX/Linux userid |
|
Email address |
verifycert tells the server whether the client’s certificate should be compared with the certificate found in the LDAP directory. Property takes two values: on and off. Use this property only if your LDAP directory contains certificates. This feature is useful to ensure that end users have a valid, unrevoked certificate.
CmapLdapAttr is a name for the attribute in the LDAP directory that contains subject DNs from all certificates belonging to the user. The default for this property is certSubjectDN. This attribute is not a standard LDAP attribute, so to use this property, you must extend the LDAP schema. For more information, see Introduction to SSL.
If this property exists in the certmap.conf file, the server searches the entire LDAP directory for an entry whose attribute named with this property matches the subject’s full DN taken from the certificate. If no entries are found, the server retries the search using the DNComps and FilterComps mappings.
This approach to matching a certificate to an LDAP entry is useful when matching entries using DNComps and FilterComps is difficult.
Library is the path name to a shared library or DLL. Use this property only if you create your own properties using the certificate API.
InitFn is the name of an init function from a custom library. Use this property only if you create your own properties using the certificate API.
For more information about these properties, refer to the examples described in Sample Mappings.
The client certificate API can be used to create your own properties. Once you have a custom mapping, you reference the mapping as follows:
name:library path_to_shared_libraryname:InitFN name_of_init_function
For example:
certmap default1 o=Sun Microsystems, c=US default1:library /usr/sun/userdb/plugin.so default1:InitFn plugin_init_fn default1:DNComps ou o c default1:FilterComps l default1:verifycert on
The certmap.conf file should have at least one entry. The following examples illustrate the different ways certmap.conf can be used.
certmap default defaultdefault:DNComps ou, o, cdefault:FilterComps e, uiddefault:verifycert on
Using this example, the server starts its search at the LDAP branch point containing the entry ou=orgunit, o=org, c=country, where the italicized text is replaced with the values from the subject’s DN in the client certificate.
The server then uses the values for e-mail address and user ID from the certificate to search for a match in the LDAP directory. When an entry is found, the server verifies the certificate by comparing the one sent by the client to the one stored in the directory.
The following example file has two mappings: one for default and another for the US Postal Service.
certmap default defaultdefault:DNCompsdefault:FilterComps e, uid
certmap usps ou=United States Postal Service, o=usps, c=USusps:DNComps ou,o,cusps:FilterComps eusps:verifycert on
When the server receives a certificate from anyone other than the US Postal Service, it uses the default mapping, which starts at the top of the LDAP tree and searches for an entry matching the client’s email address and user ID. If the certificate is from the US Postal Service, the server starts its search at the LDAP branch containing the organizational unit and searches for matching email addresses. Also the server verifies the certificate. Other certificates are not verified.
The issuer DN (that is, the CA’s information) in the certificate must be identical to the issuer DN listed in the first line of the mapping. In the previous example, a certificate from an issuer DN that is o=United States Postal Service,c=US will not match because the DN has no space between the o and the c attributes.
The following example uses the CmapLdapAttr property to search the LDAP database for an attribute called certSubjectDN, whose value exactly matches the entire subject DN taken from the client certificate. This example assumes that the LDAP directory contains entries with the attribute certSubjectDN
certmap myco ou=My Company Inc, o=myco, c=USmyco:CmapLdapAttr certSubjectDNmyco:DNComps o, c myco:FilterComps mail, uid myco:verifycert on
If the client certificate subject is:
uid=Walt Whitman, o=LeavesOfGrass Inc, c=US
the server first searches for entries that contain the following information:
certSubjectDN=uid=Walt Whitman, o=LeavesOfGrass Inc, c=US
If one or more matching entries are found, the server proceeds to verify the entries. If no matching entries are found, the server uses DNComps and FilterComps to search for matching entries. In this example, the server searches for uid=Walt Whitman in all entries under o=LeavesOfGrass Inc, c=US.