Passport-based authentication in an IIS environment is explained in greater detail in Chapter 7.
Certificate-based authentication is based on the SSL and TLS protocols. SSL stands for the Secure Sockets Layer protocol. It is a security protocol operating at the transport layer of the OSI networking stack. SSL was initially developed by Netscape. The latest SSL specification (3.0) can be down- loaded from http://wp.netscape.com/eng/ssl3. In 1999 SSL was standardized by the IETF in RFC2246 under the
SSL/TLS can provide the following security services:
Server authentication: SSL/TLS uses X.509 server certificates to authenticate the Web server.
Data confidentiality and integrity services: SSL/TLS always provides channel encryption services.
Optional client authentication:
SSL/TLS uses X.509 client certificates to authenticate the
The last one is the most interesting one in the context of this chapter on IIS authentication methods. Contrary to the
The SSL/TLS protocols are built on symmetric and asymmetric cryptographic protocols (also known as public key crypto) and X.509 certificates. For more information on X.509 certificates, see Chapter 13 on public key
When users connect to Web pages that are secured using SSL/TLS, they must use a secure URL that begins with https://. The use of
Figure 6.16:
Internet Explorer SSL/TLS lock symbol.
In short, this is how an SSL/TLS connection is set up between a browser and a Web server:
The browser connects to the Web server using a secure URL (https://).
The Web server sends the browser the server certificate (containing its public key).
The browser and Web server negotiate the encryption level to be used.
The browser encrypts a session key (to be used for SSL channel encryption) with the Web server’s public key and sends the encrypted blob to the Web server.
The Web server decrypts the encrypted blob using its private key.
The browser and Web server exchange data—the data are secured using the session key.
The use of SSL/TLS requires X.509 certificates. You always need a server certificate, and if you also want client certificate-based authentication, you will also need client certificates. Setting up SSL in IIS 6.0 typically includes the following steps:
Generate a server certificate request file.
Submit the request file.
Generate the server certificate.
Install the server certificate on the Web site.
Configure SSL on the Web site.
Install the issuing CA’s certificate in the browser’s trusted root certificate store.
In this chapter, only SSL-specific topics are discussed; for general information about certificates, public key infrastructures (PKIs), and the Windows Server 2003 PKI software, see Chapters 13, 14, and 15.
The
Figure 6.17:
SSL Web server certificate wizard.
Figure 6.18:
Starting the Web server certificate wizard.
In the wizard you have the option to send the request immediately to an online CA or generate the request offline. The first option will not only generate and send the certificate request file; it will also automatically install the certificate. This option will only work if you have an operational Windows enterprise CA. When you choose to generate the request offline, you will have to submit the request to the CA and install the certificate on the Web server all by yourself.
A very important step in the certificate request file generation wizard is the specification of the Web site’s common name. You must make sure that the common name you enter in the wizard matches the name that the browser uses in the URL to securely connect to your Web site. This is because the common name appears in the server certificate, and if the name in the certificate does not match with the name in the URL, the browser will generate an SSL error. Microsoft supports the use of wildcards in the certificate’s common name.
Using Wildcards in the Common Name of SSL Server Certificates
Microsoft supports the use of wildcards in the common name of SSL server certificates. Using wildcards you can reuse the same certificate for different physical Web sites. This may be an interesting option for Web farms where only the machine is different between the different Web farm
members .The IIS SSL/TLS provider supports the following wildcards (the examples are all matching www.hp.com):
*.hp.com
w*.hp.com
*w.hp.com
www.h*.com
www.hp.*
Microsoft’s support for wildcards is in line with RFC 2595 and is documented in the Microsoft Knowledge Base article at http://support.microsoft.com/default.aspx?scid=kb;enus;258858.
Once you have generated the certificate request file, you must use it to generate the actual certificate. SSL/TLS server certificates can be generated in different ways:
They can be generated by an internal Certification Authority (CA), which is for example using the Windows Server 2003 PKI software.
They can be generated by an external commercial CA (e.g., Verisign).
You can generate self-signed certificates using the IIS 6.0 Resource
Kit utility SelfSSL.
SelfSSL is a command-line tool allowing you to generate self-signed SSL/TLS certificates—in other words, you do not need a CA or PKI infrastructure. When you run SelfSSL, it will not only generate a self-signed certificate, but it will also install it on the Web server. If you use it with the /T switch, it will also add the self-signed certificate to the list of trusted certificates in the local machine’s certificate store.
If you did not submit the request file to an online Windows enterprise CA or if you did not use the SelfSSL tool, you will have to manually submit the request to the CA that will issue the server certificate. If the CA you are using is an internal Windows CA, the easiest way to do this is to use the CA’s Web interface. To do so, connect to the CA’s Web site using the /certsrv">http://<
Once you get the server certificate back from the CA (again, this step is not needed if you used an operational Windows enterprise CA or SelfSSL), you can install it on your Web server. To do so, you can use once more the Web Server Certificate Wizard or the IIScertdeploy.vbs script that comes with the IIS 6.0 Resource Kit. If you use the wizard, this time select the “Process the pending request and install the certificate” option.
SSL/TLS can be configured from the Directory Security tab, using the Edit… button in the Secure Communications section (see also Figure6.11). This button is only enabled if you successfully installed a server certificate. The configuration screen is shown in Figure 6.19. In the configuration screen you can:
Enable/disable SSL for a Web site.
Require 128-bit encryption, which provides extra protection for Web sites that deal with sensitive personal and financial information.
Set client certificate-based authentication options. Both the “Accept client certificates” and “Require client certificates” options require the deployment of certificates to your browser clients. As with server certificates, SSL/TLS client certificates can be
Enable certificate mapping (explained in the next section).
Enable certificate trust lists (CTLs) (explained later in this chapter).
If you want to configure the port that is used for SSL communications, this can be done from the Web site tab in a Web site’s properties (the default port is 443). The Advanced button also allows you to add multiple SSL identities for the site using different ports.
Client SSL/TLS certificates can also be
Figure 6.19:
Configuring SSL/TLS.
Use the IE Deployment Kit to create an install kit with CA’s certificate added to the trusted root domains.
Put the CA’s certificate on a
Distribute the CA’s certificate using a GPO setting.
An interesting property of the SSL implementation in Internet Explorer (IE) 6.0 and later is that users can manually clear the SSL cache from the IE GUI. This means that the client-side SSL authentication certificates can be removed from the browser cache. Normally certificates
In order to facilitate Web server access control enforcement, SSL client authentication certificates can be mapped to Windows security identities. This feature is called certificate mapping. It allows you to apply authorization settings that are defined for Windows security identities to users who have authenticated to IIS using a certificate.
Certificate mapping can be defined in the IIS metabase or in the Active Directory (AD). In the latter case we’re using a service that is known as the “Windows directory service mapper.” AD-based mapping is an interesting option if you have multiple Web servers that all need to have certificate mappings defined. Instead of defining the mappings on every individual Web server, you can define them once in the central AD repository.
IIS metabase-based mapping can be defined from the ISM secure communications dialog box (illustrated in Figure 6.19) and is only available if you have checked the “enable client certificate mapping” checkbox.
Certificate mapping defined in the metabase can be set up in one of two modes: one-to-one mapping and
When using one-to-one mapping, IIS looks at the complete content of the client certificate to map it to a Windows security identity.
Many-to-one certificate mapping is based on rules (as illustrated in Figure 6.20). In this case IIS looks at particular attributes of the client certificate (as defined in the rules) to map it to a Windows security identity.
Figure 6.20:
Setting up a many- to-one certificate mapping rule in the ISM.
AD-based mapping can be defined from the Users and Computers MMC snap-in: Use the Name mappings… option in an account object’s context menu—this option is only available if the snap-in is in Advanced Features viewing mode. AD-based mapping only allows for one-to-one mapping. AD-based mapping or the Windows directory service mapper is enabled from the properties of the Web Sites container in the ISM (as illustrated in Figure 6.21).
Figure 6.21:
Enabling the Windows directory service mapper.
During the SSL/TLS protocol exchanges, both the browser and the Web server must validate each other’s certificates (for the server side this is only true if also client-side certificate authentication has been enabled). SSL/ TLS certificate validation includes the following checks (illustrated in Figure 6.22): an X.509 digital signature check, a trust check, a time check, a revocation check, and a formatting check. The certificate validation process is explained in greater detail in Chapter 15.
Figure 6.22:
Certificate validation process.
Every X.509 certificate includes a digital signature that is
An integrity check: A check that the certificate has not been tampered with
An authentication check: A cryptographic check to determine that the
Web site owns the private key that is associated with the public key stored in the certificate
The trust check
Figure 6.23:
(a) Browser-side certificate trust error, and (b) browser-side certificate time and name error.
The time check validates whether the certificate has expired. EveryX.509 certificate has a limited lifetime. If the certificate has expired, IIS will generate a 403.17 HTTP error. On the browser side a security alert will be generated stating that “The security certificate has
The revocation check validates whether the certificate has been revoked. By default, this check is not performed by Internet Explorer, but rather it is performed by IIS. In IIS revocation checking can be controlled using the certcheckmode metabase parameter (value 1 means revocation checking is disabled/value 0 means revocation checking is enabled). If the certificate has been
Figure 6.24:
Browser-side SSL/TLS revocation check error.
Figure 6.25:
Browser-side SSL/TLS certificate revocation checking option.
The formatting check validates whether the content of an X.509 certificate conforms to the X.509 certificate format specification. The check also validates whether the common name in the certificate matches the name of the Web site—as entered in the URL. If the certificate is ill-
In most enterprise environments you must consider the following deployment issues when setting up SSL/TLS for securing Web resources:
SSL/TLS cannot be used in combination with HTTP host headers.
SSL/TLS can have a performance impact on the Web server side.
The combination of SSL/TLS and HTTP load balancing.
SSL/TLS and HTTP proxy and/or firewall combined operation. This issue is discussed in greater detail in the next section.
When using https, you cannot use HTTP host headers to differentiate between different Web sites on the same Web server. This is because the SSL connection is set up before the HTTP connection and the HTTP information is sent in an encrypted format over the wire.
The asymmetric cryptographic operations behind the certificate-based authentication in SSL/TLS can impact the Web server performance. To deal with this performance issue, you can do three things:
Use hardware crypto accelerators devices. These devices offload the main system processor by using a dedicated processor for the cryptographic operations. Table 6.1 gives some example devices (this is a nonexhaustive list).
|
Vendor |
Device |
More Information At: |
|
|
|
http://www.broadcom.com |
|
F5 |
|
http://www.f5.com/f5products/bigip/SSL400800 |
|
HP (Compaq) |
|
http://h18000.www1.hp.com/products/servers/security/axl300 |
|
Intel |
|
http://www.intel.com/support/netstructure/index.htm |
|
nCipher |
|
http://www.ncipher.com/nfast/index.html |
|
Rainbow |
|
http://www.rainbow.com/products/cryptoswift/PCI.asp |
Limit the Web page size. Limiting the Web page
Reuse cached SSL sessions to limit the number of SSL negotiations. You can fine-tune the SSL caching behavior by using the registry parameters in Table 6.2. They are located in the HKEY_LOCAL_MACHINE\system\currentcontrolset\control\ securityproviders\schannel registry key. [8]
|
Registry Parameter |
Data Type |
Default Value |
Meaning |
|---|---|---|---|
|
MaximumCacheSize |
REG_DWORD |
10,000 |
Maximum number of SSL sessions to maintain the cache |
|
ClientCacheTime |
REG_DWORD |
10 hours |
Time in
|
|
ServerCacheTime |
REG_DWORD |
10 hours |
Time in milliseconds to expire a server-side cache element |
When using SSL in a Web load balancing environment (e.g., in a Web farm setup), you must make sure that your load balancing solution supports sticky sessions (also known as server affinity). Sticky sessions assure that the HTTP connection always returns to the same Web server in a server farm during a user Web connection sequence. This is key when the Web server maintains user session data.
SSL can be configured in different ways when dealing with HTTP proxies: The different approaches can be categorized as either SSL tunneling or SSL bridging. HTTP proxies are used in almost every perimeter security solution that includes application proxy-based firewalls and/or HTTP proxies.
An SSL tunneling setup provides true end-to-end SSL: The SSL tunnel starts on the browser and ends on the Web server. It is illustrated in Figure 6.26. It requires an SSL authentication certificate on the Web server and optionally an SSL client certificate on the client side. The problem with SSL bridging is that it breaks the role of an HTTP proxy. An HTTP proxy typically inspects the content of an HTTP request before it lets the request through. When using SSL the HTTP request cannot be inspected because the HTTP content is encrypted by the SSL tunnel. This is because an SSL tunnel is always set up before the HTTP application-level traffic
Figure 6.26:
SSL and HTTP proxy approaches: SSL tunneling.
Does this mean that it is
The alternative to SSL tunneling is SSL bridging. Using SSL bridging takes away the security concern
Using a single SSL tunnel that starts on the client side and terminates on the HTTP proxy. This approach is illustrated in Figure 6.27. It requires an SSL certificate for the HTTP proxy and optionally an SSL certificate for the client side (if strong client-side authentication is required).
Figure 6.27:
SSL and HTTP proxy approaches: SSL bridging (single tunnel terminated on proxy).
Using a single SSL tunnel that starts on the HTTP proxy and terminates on the Web server. This approach is illustrated in Figure 6.28. It requires an SSL certificate for the Web server and optionally an SSL certificate for the HTTP proxy (if strong client-side authentication is required).
Figure 6.28:
SSL and HTTP proxy approaches: SSL bridging (single tunnel terminated on Web server).
Figure 6.29:
SSL and HTTP proxy approaches: SSL bridging (two tunnels).
Setting up SSL Bridging and Tunneling in an MS ISA Server Environment
ISA Server is Microsoft’s follow-up product to Proxy Server 2.0. Unlike its predecessor, which was primarily a Web caching solution, ISA Server can serve as a full-blown firewall. In addition, ISA Server provides advanced packet filtering and application proxy firewall functions.
To set up SSL bridging on ISA Server, you must create an ISA Server destination set and Web publishing rule. To facilitate the configuration of SSL bridging in an OWA environment, Microsoft provides an OWA Publishing Wizard in Feature Pack 1 for ISA Server (illustrated in Figure 6.30). ISA Server Feature Pack 1 can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=2f92b02c-ac49-44df-af6c- 5be084b345f9&DisplayLang=en.
Figure 6.30:
Setting up SSL bridging using the OWA Publishing Wizard.
To configure ISA Server for SSL tunneling you need to use ISA Server’s Server Publishing feature. Compared to setting up SSL bridging, setting up SSL tunneling is relatively easy,
mainly because no SSL certificate must be set up for the ISA Server.
Using two SSL tunnels: one starting on the client and terminating on the HTTP proxy and another one starting on the HTTP proxy and terminating on the Web server. This approach is illustrated in Figure 6.29. It requires an SSL certificate on the HTTP proxy and Web server and optionally an SSL certificate on the client side (if strong client-side authentication is required).
Table 6.3 shows the different SSL approaches and their advantages and disadvantages.
|
SSL Approach |
Pros |
Cons |
|---|---|---|
|
SSL Tunneling |
|
|
|
SSL Bridging—Option 1: Single SSL tunnel, started on client and terminated on proxy |
|
|
|
SSL Bridging—Option 2: Single SSL tunnel, started on proxy and terminated on Web server |
|
|
|
SSL Bridging—Option 3: Two SSL tunnels |
|
|
[8] These registry settings were available for IIS 4.0 and 5.0 and documented in the following KB article: http://support.microsoft.com/default.aspx?scid=kb;en-us;247658. At the time of writing, no update to the KB article was available for IIS 6.0.