Securing Web Applications Through a Secure Reverse
Transkript
Securing Web Applications Through a Secure Reverse
Securing Web Applications Through a Secure Reverse Proxy Anh-Duy Nguyen, Sun ONE Product Technical Support Sun BluePrints™ OnLine—November 2003 Sun Microsystems, Inc. 4150 Network circle Santa Clara, CA 95045 USA 650 960-1300 Part No.: 817-4402-10 Revision A Edition: November 2003 Copyright 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. This document and the product to which it pertains are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of the product or of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and in other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, docs.sun.com, Sun BluePrints, iPlanet, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and in other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and in other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements. U.S. Government Rights—Commercial use. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California Etats-Unis. Tous droits réservés. Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l’utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l’autorisation préalable et écrite de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Des parties de ce produit pourront être dérivées des systèmes Berkeley BSD licenciés par l’Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, Sun BluePrints, iPlanet, et Solaris sont des marques de fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d’autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d’autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. L’interface d’utilisation graphique OPEN LOOK et Sun™ a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d’utilisation visuelle ou graphique pour l’industrie de l’informatique. Sun détient une license non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant également les licenciées de Sun qui mettent en place l’interface d ’utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun. LA DOCUMENTATION EST FOURNIE "EN L’ÉTAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L’APTITUDE A UNE UTILISATION PARTICULIERE OU A L’ABSENCE DE CONTREFAÇON. Please Recycle Securing Web Applications Through a Secure Reverse Proxy In today’s complicated, heterogeneous back-end environments, organizations search for ways to manage their diverse corporate infrastructure. One way to accomplish this task is to centralize all Web resource requests to multiple back-end systems. With the large volume of different web servers available, all with multiple versions, updates, and platforms, it is very easy to become vunerable to attacks. For example, different versions of web servers used by companies today have security alerts issue to the public that describe these problems and how to exploit them Placing the web servers behind the firewall and denying access to them greatly reduces their vulnerability to attacks. The actual web server is accessed using reverse proxy servers. The reverse proxy server retrieves the Web resources through the firewall from the actual web server. In addition, the data returned from the actual web server can be cached locally at the reverse proxy level to improve the access time of the web site. Having a firewall working in tandem with a reverse proxy server greatly reduces the vulnerabilities. This article covers the following topics: ■ “Understanding the Reverse Proxy Server” on page 2 ■ “Setting Up the Proxy Server” on page 4 ■ “Understanding the Secure Reverse Proxy” on page 7 ■ “Configuring the Proxy Server to Handle Client Authentication with Digital Certificates” on page 16 This article is intended for use by intermediate-level system administrators. It assumes that you are familiar with installing and configuring the Sun™ ONE Proxy Server software. It also assumes that you understand network filtering and can properly configure your firewall. This article describes basic capabilities that are found in many common proxy implementations. As such, this approach is not limited to the Sun™ ONE implementation although the examples in this article are. 1 This article describes recommended practices for installing and configuring the Sun ONE Proxy Server software for the purpose of constructing a secure-content gateway that prevents direct, unrestricted, and unmonitored access to your company’s internal systems and data from outside clients. The article also provides recommended practices to secure your web applications behind a firewall and leverage access and authentication with the Sun ONE platform products. In this article, security is accomplished two ways: ■ Secure reverse proxy, which acts as a stand-in for your content server to provide an additional barrier between back-end environments and the possibility of malicious attack. ■ Authentication based on Secure Socket Layers (SSL) certificates is used to guarantee the identity of the clients requesting data from the back-end systems. This article assumes that the reader has taken the necessary measures to ensure that the suggested recommended practices are built on a secure platform. Understanding the Reverse Proxy Server A reverse proxy server is a server that acts as a broker between two entities, validating and processing a transaction in such a way that the actual parties to the transaction do not directly communicate with one another. This means that the proxy acts on behalf of the content web server. A reverse proxy server can represent one or several content servers. Random servers cannot be accessed through a reverse proxy server. Only the predetermined set of files that are available from the content server can be accessed. A reverse proxy server is a designated proxy server for those servers, and it is used by all clients for access to the specific site that it is servicing. Having a firewall working in tandem with a reverse proxy server can greatly reduce the possibility of exposing your back-end data resources. The firewall must be configured to only allow specific types of access (HTTP/HTTPS) from the reverse proxy server to the back-end web servers. This configuration ensures that requests coming from the proxy are valid requests and all other requests are seen as potential hackers. A properly configured firewall will accept requests from the proxy server and route it appropriately to your back-end resources. One of the biggest benefits of having a reverse proxy configuration is that your clients have a single point of access to your content web servers. This obviously adds a second layer of security that allows you to track and contain an attack against your content servers. The second benefit is that you, as a system administrator, have a single point of control over who can access the servers and what content you allow the users to access. Another great benefit is that outsiders are not aware of the names of the content servers you are proxying. This allows you to easily replace content servers or make host name changes since the rules or “mappings” are handled by 2 Understanding the Reverse Proxy Server • November 2003 the reverse proxy. This does not affect outside clients. The idea of setting up an architecture with a single point of access helps in the load balancing and failover. For companies concerned with hardware costs, leveraging a reverse proxy can significantly lower hardware cost because it eliminates the need to have separate hardware and software for internal and external users. Internal and external users can access the same servers using the same HTTP requests. This method also eliminates the need to have different hardware to store data for internal and external users. The reverse proxy is capable of securing the back-end data that is required to service an HTTP application without exposing any information to outside world. So, what exactly does a reverse proxy do? When a client makes a request to your web site, the request goes to the proxy server. The proxy server then sends the client’s request through a specific path in the firewall back to the content web server. The content web server passes the result through the path back to the proxy. The proxy sends the retrieved information to the client, as if the proxy were the actual content server (see Figure 1). A client sends a request to the proxy server. The proxy server appears to be the content server. Firewall The proxy server uses a regular mapping to forward client requests to internal content servers. FIGURE 1 Server within a firewall Reverse Proxy Deployed at Firewall If the content web server returns an error message, the proxy server can intercept the message and change any URLs listed in the headers before sending the message to the client. This prevents external clients from getting redirection URLs to the internal content server. Since a reverse proxy server potentially allows access to internal hosts, disabling generic (forward) proxying on the proxy server, or applying appropriate access controls if they are enabled, is important. The firewall should be configured so that it allows connections from the reverse proxy to the content web servers exclusively, and not to any other internal resources. The proxy server's configuration should not allow generic proxy requests. It should only allow reverse proxy requests and remap them appropriately to the content web servers. Understanding the Reverse Proxy Server 3 In addition, the reverse proxy can be configured to secure data utilizing Secure Socket Layers (SSL). This type of configuration is known as a secure reverse proxy. A secure reverse proxy can provide an encrypted connection from a proxy server outside a firewall to a secure content server inside the firewall. It also allows clients to connect securely to the proxy server, facilitating the secure transmission of information (such as credit card numbers). A reverse proxy configuration has specific components. These components and their functions are: ■ Request URL remapping. The reverse proxy server must map the request URLs to URLs that point to the back-end web server. The reverse proxy server only sends the path portion of the URL to the back-end web server. If the URL being accessed is: http://myproxy.sun.com/dir/file.html The back-end web server only receives the portion: /dir/file.html ■ Request header remapping. Certain request headers may contain information that was constructed with the assumption that the reverse proxy server is the content server. One such header is the ’’Host:“ header which carries the hostname that was in the URL that is being requested. Obviously, these headers need to be remapped correctly so that the true content server will receive the proper “Host:” value. ■ Response header remapping. The response headers may contain information that explicitly points to the content web server. One example is the “Location:” header that is used with redirections. The reverse proxy servers remap the “Location:” field, replacing the reference to the content web server with its own address. Setting Up the Proxy Server In this example, the installation parameters for the Sun ONE Proxy Server are: Server root : /opt/SunONE/proxy Machine name: myproxy.sun.com SuiteSpot user: proxyadmin SuiteSpot group: sunone Are you using an LDAP-based directory server? N Administration port: 81 Run administration server as: proxyadmin Server administrator ID: proxyadmin Password: sun1ProxySvr 4 Setting Up the Proxy Server • November 2003 Note – The server must have restricted access to your system resources. Therefore, you should set up and run the proxy with a non-privileged system user account. The server will run with the UNIX® user account you specify during installation. Any child processes of the proxy and all files created by the proxy are created with this account as the owner. ▼ To Set up the Secure Proxy Server 1. Open a browser and go to http://myproxy.sun.com:81. You will be prompted for a user ID and password. Enter the user ID proxyadmin and the password selected during the installation (for example, sun1ProxySvr). Note – Refer to the administration guide to start up your Administration Server. 2. Click the Create New iPlanet Web Proxy Server 3.6 link. The web proxy server starts the installation wizard. Do the following: a. Create a new proxy instance: Server Name: myproxy.sun.com Bind Address: <ip_address_of_server> Server Port: 80 Server Identifier: myproxy Server User: proxyadmin Processes: 32 Select: Attempt to resolve IP addresses only for access control. Select: Extended log format (includes all byte counts, transfer time). Enable Proxying of: HTTP and HTTPS Enable SSL Tunneling for: HTTPS Uncheck: Cache FTP Uncheck: Cache Gopher Leave all other options set to the default values. Leave all other options set to the default values. b. Click OK. The wizard now creates the new proxy instance. c. Click Return to Server. Setting Up the Proxy Server 5 3. Select the newly created proxy instance. 4. Select the URLs button from the server menu. 5. Remove the default Client autoconfig mappings. a. Click Remove in the Administration Interface. The proxy will request verification that you want to remove that entry. b. Click OK to complete the process. c. Click Save and Apply. This will ensure that the changes are recognized by the proxy server and restart the proxy instance to ensure that the changes take effect immediately 6. Click Create Mappings in the Administration Interface to create Regular URL mappings. To illustrate the configuration in FIGURE 1, the reverse proxy server at http://myproxy.sun.com will be configured to proxy the content web server at http://www.sun.com. Note that the reverse proxy server address is the advertised address, and users can access it without any knowledge of the main server. Note – Since the proxy server software can support both forward and reverse proxy modes at the same time, the forward proxy may be used when performing requests intended for the reverse proxy server to keep the request from making an unnecessary loop from the forward to reverse proxy. a. Select Regular for Mapping type. b. Enter the following for Map Source Prefix: http://myproxy.sun.com c. Enter the following for Map Destination: http://www.sun.com d. Click OK. e. Click Save and Apply. This will ensure that the changes are recognized by the proxy server and restart the proxy instance to ensure that the changes take effect immediately. 7. Create Reverse URL mappings. 6 Setting Up the Proxy Server • November 2003 a. Click Create Mappings in the Administration Interface. b. Select Reverse for Mapping type. c. Enter the following for Map Source Prefix: http://www.sun.com d. Enter the following for Map Destination: http://myproxy.sun.com e. Click OK. f. Click Save and Apply. This will ensure that the changes are recognized by the proxy server and restart the proxy instance to ensure that the changes take effect immediately. 8. Verify Reverse Proxy configuration by opening a browser and accessing the proxy server. In this example, enter: http://myproxy.sun.com Understanding the Secure Reverse Proxy Secure reverse proxying occurs when one or more of the connections between the proxy server and another machine uses the Secure Sockets Layer protocol to encrypt data. Secure reverse proxying has many uses, for example: ■ Provides an encrypted connection from a proxy server outside a firewall to a secure content server inside the firewall ■ Allows clients to connect securely to the proxy server, facilitating the secure transmission of information (such as credit card numbers) Secure reverse proxying causes each secure connection to be slower due to the overhead involved in encrypting your data. However, because SSL provides a caching mechanism, two connecting parties can reuse previously negotiated security parameters, dramatically reducing the overhead on subsequent connections. Understanding the Secure Reverse Proxy 7 This scenario is effective if there is little or no chance that the information being exchanged between your proxy and content server can be accessed by unauthorized users (FIGURE 2). If your company requires a higher level of security, the proxy server can communicate securely with the back-end Web Server over SSL. Another alternative is to choose technologies such as IP Security Protocol (IPSec). Encrypted, secure HTTP, unsecure Client Server Cache Proxy FIGURE 2 ▼ Secure Reverse Proxy To Set Up a Secure Reverse Proxy Server Instance 1. Open a browser and go to http://myproxy.sun.com:81. You will be prompted for a user ID and password. Enter the user ID proxyadmin and the password selected during the installation (for example, sun1ProxySvr). 2. Click the Create New iPlanet Web Proxy Server 3.6 link. The web proxy server starts the installation wizard. Do the following: 8 Understanding the Secure Reverse Proxy • November 2003 a. Create a new Proxy instance: Server Name: myproxy.sun.com Bind Address: ip_address_of_server Server Port: 443 Server Identifier: secure-myproxy Server User: proxyadmin Processes: 32 Select: Attempt to resolve IP addresses only for access control. Select: Extended log format (includes all byte counts, transfer time). Enable Proxying of: HTTP and HTTPS Enable SSL Tunneling for: HTTPS Uncheck: Cache FTP Uncheck: Cache Gopher Leave all other options set to the default values. b. Click OK. The wizard creates the new proxy instance. c. Click Return to server selector. 3. Generate your server’s key pair (public and private keys). To generate a key-pair file, you need to run the key-pair file generator program from the command line. a. Log in as the proxy user. b. Run the key-pair file generation program by typing $PROXY_HOME/bin/admin/admin/bin/sec-key. c. When prompted, type an alias for the new key-pair file. Multiple instances can use different key pairs so you mightwant to choose an alias that matches your server (for example, myproxy). This way, you can easily identify the appropriate key pair to use for each specific instance. The alias cannot contain spaces, but it can use symbols that your operating system allows in file names (such as underscores). By default, the key-pair file is stored in server_root/alias/alias-key.db, where alias is the alias you typed. If you used the alias myproxy, your key-pair file would be server_root/alias/myproxykey.db. d. A screen with a progress meter appears. Type random keys at different speeds until the progress meter is full. The time between each of your keystrokes is used to generate a random number for the unique key-pair file. Understanding the Secure Reverse Proxy 9 e. When prompted, type a password of eight characters or more for your key-pair file. The password must have at least one non-alphabetical character (a number or punctuation mark). Make sure you memorize this password. The security of your server is only as good as the security of the key-pair file and its password. In this example, password is set to sun1ProxySvr. You must know the password for the key-pair file referenced by the alias—this is the password you must enter before starting or stopping a server that uses SSL encryption. The server uses the password to get your private key from the key pair. 4. Request a certificate from a certificate authority (CA). a. Click the Keys & Certificates button from the Administration Interface. b. Click Request Certificate from the left menu options. c. Supply the appropriate information: Select: New Certificate Select: CA Email Address: <your_email_address> Alias: select_your_alias (that is, myproxy) Key Pair File Password: your_password (that is, sun1ProxySvr) Requestor Name: Your_Full_Name Telephone Number: Your_Telephone_Number Common Name: Fully qualified host name (that is, myproxy.sun.com) Email Address: your_email_address Organization: official name of your company Organizational Unit: optional organization within company Locality: optional entry describing your city State or Province: full name of state (that is, California) Country: two-character abbreviation (that is, US) Note – We suggest that you specify your email in the “CA Email Address” field so that you can review the certificate request prior to submitting it to the Certificate Authority. 10 Understanding the Secure Reverse Proxy • November 2003 d. Click OK. The wizard creates the certificate request. ----BEGIN NEW CERTIFICATE REQUEST----MIIB1TCCAT4CAQAwgZQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh MRQwEgYDVQQHEwtTYW50YSBDbGFyYTEeMBwGA1UEChMVU3VuIE1pY3Jvc3lzdGVt cyBJbmMuMRQwEgYDVQQLEwtTdW4gT05FIFBUUzEkMCIGA1UEAxMbZ3Jhc3Nob3Bw ZXIucmVkLmlwbGFuZXQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI +/4yIe1mJBHDQLy8sTtbAAaP6yy300pYj3t/i8diOsj/YCtYIJatWzkuoFgOQ+1K hiD+diS+HlYTh0ki/q8hCIFm/e08BnhXQ+zhMdwtazDWGeNqqKR9P1A6+WZIVtxa QWkdsXrYUkAkpKh+O8BsIpgBTelQQMbCetvhuI2oWwIDAQABoAAwDQYJKoZIhvcN AQEEBQADgYEAoAo/iQlu7CByZpWauXjDCfy9/W6jSKxXvxWQf+A22DNZ/LszgCf9 uwPAyr8E9RS2HUGCUtoBgWhzynCM3kS4qZnaGKM4EuIY7tGq5xkj7epVA0PI7O5G Pc5b2qs5NJOGVcvewZCOYtDQ1eaH4W5gZlHfu7PtG/CgH1Li5thKLTU= -----END NEW CERTIFICATE REQUEST----- e. Submit the generated certificate request to your CA. Remember that this capability can be provided internally by your organization, or this request can be fulfilled by organizations such as Verisign or Thawte. 5. Install the certificate the CA sends to you. a. Click the Keys & Certificates button in the Administration Interface. b. Click Install Certificate from the left menu options. c. Supply the appropriate information: Certificate for: This server Select: Message Text (with headers): <PASTE THE CERTIFICATE> Select: alias from the drop-down list (that is, myproxy) Encryption: On Port Number: (default SSL port is 443) d. Click OK. 6. Install the Trusted CA’s certificate. a. Click the Keys & Certificates button in the Administration Interface. b. Click Install Certificate from the left menu options. c. Supply the appropriate information: Certificate for: Trusted Certificate Authority (CA) Certificate Name: My Trusted CA Select: Message Text (with headers): Select: alias from the drop-down list (that is, myproxy) Understanding the Secure Reverse Proxy 11 d. Click OK. 7. Activate SSL for your server. Note – For instructions on how to select and disable “weak” ciphers, refer to the “Increase Server Security” section in the Sun ONE Web Proxy Server 3.6 SP3 Administrator's Guide. a. Click the secure proxy instance that was created. b. Click Encryption On/Off in the menu. c. Supply the appropriate information: Certificate for: This server Select: Message Text (with headers): <PASTE THE CERTIFICATE> Select: alias from the drop-down list (that is, myproxy) d. Click OK. e. Click Save and Apply. The server will apply the changes and try to restart itself. Since the server is not in SSL mode, it will need to read the key-pair password. Since you have not supplied it, the server will not start. f. Select On/Off from the menu. g. Click On to start your secure reverse proxy. h. When prompted, enter your key-pair password., that is, sun1ProxySvr. ▼ To Set Up URL Mappings 1. Select the URLs button in the server menu. 2. Remove the default Client autoconfig mappings: a. Click Remove in the Administration Interface. The proxy will request verification that you want to remove that entry. b. Click OK. c. Click Save and Apply. This will ensure that the changes are recognized by the proxy server and restart the proxy instance to ensure that the changes take effect immediately. 12 Understanding the Secure Reverse Proxy • November 2003 3. Create Regular URL mappings. To illustrate the configuration with the example in FIGURE 2, the reverse proxy server at: https://myproxy.sun.com will be configured to proxy the content web server at: http://www.sun.com Note that the reverse proxy server address is the advertised address, and users may access it without any knowledge of the main server. a. Click Create Mappings in the Administration Interface. b. Select Regular for Mapping type. c. Enter the following for Map Source Prefix: https://myproxy.sun.com d. Enter the following for Map Destination: http://www.sun.com e. Click OK. f. Click Save and Apply. This will ensure that the changes are recognized by the proxy server and restart the proxy instance to ensure that the changes take effect immediately. 4. Verify Reverse Proxy configuration. Open a browser and access the proxy server. In this example, enter: http://myproxy.sun.com Controlling Access with Client Certificates Since you have enabled SSL on your server, you can use client certificates in conjunction with access control. The server gathers information from the client certificate and matches it with a user entry in a Lightweight Directory Access Protocol (LDAP) directory. This match ensures that the client has a certificate and an entry in the LDAP directory. It can also ensure that the client certificate matches the one in the LDAP directory. Servers can use client certificates to ensure authenticity when communicating with a client. They can also use the certificate to determine if a user has access to the server. For a server to do this, you must specify that a resource Understanding the Secure Reverse Proxy 13 requires a client certificate to access it. When users attempt to access a restricted resource, their client sends the server the client certificate, which the server checks against its list of mappings. If the certificate belongs to a user to whom you have granted access to the resource, the resource is served. To leverage this function, you must first configure your directory services. The directory services tell the proxy server where to look for user and group data that you want to use to secure access to the proxy. The following example uses the Sun ONE™ Directory Server to facilitate this function. This article assumes that you can configure and administer the Sun ONE Directory Server to have access through the firewall. Note – The system administrator should be familiar with installing and configuring a Directory Server. To facilitate the SSL Client Certificate authentication, this configuration is required. Note – Currently, the proxy server does not support secured directory server access (LDAP over SSL). ▼ To Set Up the Directory Services This example leverages the Sun ONE Directory Server. 1. Open a browser and go to http://myproxy.sun.com:81. You will be prompted for a user ID and password. Enter the user ID proxyadmin and the password selected during the installation (for example, sun1ProxySvr). 2. Click the Global Settings link in the menu. 3. In the left panel, click the Configure Directory Service link. 4. Select the LDAP Directory Server by supplying the appropriate information: Host Name: myldap.sun.com Port: 389 Use SSL for secure connections?: Base DN: o=sun.com Bind DN: cn=directory manager Bind Password: sun1ProxySvr 14 Understanding the Secure Reverse Proxy • November 2003 no Note – This bind DN is used only to initially search for the user name you entered in the administration server authentication dialog box. Once the entry corresponding to this user name is located, the administration server rebinds to the directory server using the retrieved entry. Therefore, if the user name you supplied when you first logged in to the administration server does not have access to the directory server, you will not have any access to the directory server, regardless of the bind DN information provided in this field. 5. Click Save Changes. ▼ To Set Up Users in the Directory Server 1. Open a browser and go to http://myproxy.sun.com:81. You will be prompted for a user ID and password. Enter the user ID proxyadmin and the password selected during the installation (for example, sun1ProxySvr). 2. Click the Users and Groups link in the menu. 3. From the left panel, click the New User link. 4. Supply the appropriate information: Given Name (First Name): Proxyadmin Surname (Last Name): Administrator Full Name: Proxy Administrator User id: proxyadmin Password: sun1ProxySvr Password (Again): sun1ProxySvr Email Address: [email protected] Add New User to: o=sun.com g. Click Save Changes. Understanding the Secure Reverse Proxy 15 Configuring the Proxy Server to Handle Client Authentication with Digital Certificates The certificate mapping file determines how a server should look up a user entry in the LDAP directory. 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. This is achieved with the certmap.conf file. This file, located at server_root/userdb, can be edited and entries added to match the organization of your LDAP directory and to list the certificates you want your users to have . Specifically, the mapping file defines: ■ Where in the LDAP tree the server should begin its search ■ Which 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 following example configures the certmap.conf file so the Proxy Server can begin its search in the LDAP tree. 1. Modify the cert.map.conf file. Refer to the notes in the file for references to the proper configuration. 2. To enable the feature, modify the magnus.conf file. 3. The magnus.conf file is located in server/root/proxy-<\instance/config. A variable with two possible values (ON/OFF) has been added. This feature is disabled (OFF) by default. Use the following syntax: CertificateChecking ON ▼ To Restrict Access 1. Open a browser and go to http://myproxy.sun.com:81. You will be prompted for a user ID and password. Enter the user ID proxyadmin and the password selected during the installation (for example, sun1ProxySvr). 2. Select the Secure-Reverse Proxy instance. 16 Configuring the Proxy Server to Handle Client Authentication with Digital Certificates • November 2003 3. Click the Restrict Access link in the menu. 4. Select Entire Server from the drop-down box. 5. Turn access control off or on for the entire server by clicking either Turn off access control or Turn on access control. Turning on access control causes more access control settings to appear on your screen. For both Read and Write access, set the default access to Allow or Deny. Note – Read access allows a user only to view the file. Write access allows the user to change or delete the file, assuming the user also has access to the file through your server computer's operating system. (Technically, Read includes these HTTP methods: GET, HEAD, POST, and INDEX. Write includes PUT, DELETE, MKDIR, RMDIR, and MOVE.) 6. Specify which users are the exceptions to the default access for each access type by clicking the appropriate Permissions button. For this example, the permissions are set to Deny for both Read and Write access. 7. Click the Permissions button for Read access. a. Supply the appropriate information: Users: proxyadmin Authentication Method: Client certificate (SSL) Leave all other options set to the default values. b. Click Done. c. Click OK in the main restrict access window. d. Click Save and Apply. This will ensure that the changes are recognized by the Proxy Server and restart the proxy instance to ensure that the changes take effect immediately. 8. Verify Reverse Proxy configuration via SSL authentication using client certificates. a. Open a browser and access the proxy server. In this example, enter: https://myproxy.sun.com The proxy will request a client certificate from the browser. Provide the certificate that you requested from the certificate server that contains the UID used in the example and the proxy will allow access to the resource. Configuring the Proxy Server to Handle Client Authentication with Digital Certificates 17 For other aspects of security tuning for the Sun ONE Proxy Server such as setting banners, caching size/configuration, denial of service (DoS) considerations and so forth, refer to “Increase Server Security” section in the Sun ONE Web Proxy Server 3.6 SP3 Administrator's Guide. About the Author Anh-Duy Nguyen is a member of the Sun ONE Product Technical Support (PTS) organization in Santa Clara, California. He is a member of the team responsible for providing back-line technical support for the Sun ONE products. Currently, he focuses on the Sun™ ONE Web Server and Sun ONE Proxy Server products. Prior to joining Sun, Anh-Duy was consulting with Netscape and focusing on ecommerce deployments. References ■ Sun ONE Proxy Server documentation (docs.sun.com) ■ Noordergraaf, Alex and Watson, Keith “Solaris Operating Environment Security Updated for Solaris 8 Operating Environment,” Sun BluePrints OnLine, April 2001 ■ Noordergraaf, Alex and Watson, Keith, “Solaris Operating Environment Network Settings for Security: Updated for Solaris 8 Operating Environment” (Sun BluePrints OnLine, December 2000 ■ Luotonen, Ari, Web Proxy Servers, ISBN: 0-13-680612-0, Prentice Hall PTR, 1998. Ordering Sun Documents The SunDocsSM program provides more than 250 manuals from Sun Microsystems, Inc. If you live in the United States, Canada, Europe, or Japan, you can purchase documentation sets or individual manuals through this program. 18 About the Author • November 2003 Accessing Sun Documentation Online The docs.sun.com web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://docs.sun.com/. To reference Sun BluePrints™ OnLine articles, visit the Sun BluePrints OnLine Web site at: http://www.sun.com/blueprints/online.html. Accessing Sun Documentation Online 19 20 Accessing Sun Documentation Online • November 2003