From: Noirin Plunkett The solution of this problem is trivial
+ The solution to this problem is trivial
and is left as an exercise for the reader. -- Standard textbook cookie How to solve particular security constraints for an SSL-aware
-webserver is not always obvious because of the coherences between SSL,
+ How to solve particular security problems for an SSL-aware
+webserver is not always obvious because of the interactions between SSL,
HTTP and Apache's way of processing requests. This chapter gives
-instructions on how to solve such typical situations. Treat it as a first
+instructions on how to solve some typical situations. Treat it as a first
step to find out the final solution, but always try to understand the
stuff before you use it. Nothing is worse than using a security solution
-without knowing its restrictions and coherences.
-
-
This facility is called Server Gated Cryptography (SGC) and details
- you can find in the README.GlobalID
document in the
- mod_ssl distribution. In short: The server has a Global ID server
- certificate, signed by a special CA certificate from Verisign which
- enables strong encryption in export browsers. This works as following:
- The browser connects with an export cipher, the server sends its Global
- ID certificate, the browser verifies it and subsequently upgrades the
- cipher suite before any HTTP communication takes place. The question
- now is: How can we allow this upgrade, but enforce strong encryption.
- Or in other words: Browser either have to initially connect with
- strong encryption or have to upgrade to strong encryption, but are
- not allowed to keep the export ciphers. The following does the trick:
This facility is called Server Gated Cryptography (SGC) and requires + a Global ID server certificate, signed by a special CA certificate + from Verisign. This enables strong encryption in 'export' versions of + browsers, which traditionally could not support it (because of US export + restrictions).
+When a browser connects with an export cipher, the server sends its Global + ID certificate. The browser verifies this, and can then upgrade its + cipher suite before any HTTP communication takes place. The problem + lies in allowing browsers to upgrade in this fashion, but still requiring + strong encryption. In other words, we want browsers to either start a + connection with strong encryption, or to start with export ciphers but + upgrade to strong encryption before beginning HTTP communication.
+This can be done as follows:
Obviously you cannot just use a server-wide
Obviously, a server-wide Location
+ blocks, to give a per-directory solution, and can automatically force
a renegotiation of the SSL parameters to meet the new configuration.
- So, the solution is:
When you know your user community (i.e. a closed user group
- situation), as it's the case for instance in an Intranet, you can
- use plain certificate authentication. All you have to do is to
- create client certificates signed by your own CA certificate
- ca.crt
and then verify the clients against this
+
When you know all of your users (eg, as is often the case on a corporate
+ Intranet), you can require plain certificate authentication. All you
+ need to do is to create client certificates signed by your own CA
+ certificate (ca.crt
) and then verify the clients against this
certificate.
For this we again use the per-directory reconfiguration feature
- of
To force clients to authenticate using certificates for a particular URL,
+ you can use the per-directory reconfiguration features of
The key is to check for various ingredients of the client certificate.
- Usually this means to check the whole or part of the Distinguished
- Name (DN) of the Subject. For this two methods exists: The
The first method:
+The key to doing this is checking that part of the client certificate
+ matches what you expect. Usually this means checking all or part of the
+ Distinguished Name (DN), to see if it contains some known string.
+ There are two ways to do this, using either
The
SSLVerifyClient none <Directory /usr/local/apache2/htdocs/secure/area> @@ -209,7 +215,10 @@ require valid-user /C=US/L=L.A./O=Snake Oil, Ltd./OU=Dev/CN=Quux:xxj31ZMTZzkVA
The second method:
+When your clients are all part of a common hierarchy, which is encoded
+ into the DN, you can match them more easily using
SSLVerifyClient none @@ -228,14 +237,16 @@ SSLVerifyClient none
Let us assume the Intranet can be distinguished through the IP
- network 192.160.1.0/24 and the subarea on the Intranet website has
- the URL /subarea
. Then configure the following outside
- your HTTPS virtual host (so it applies to both HTTPS and HTTP):
These examples presume that clients on the Intranet have IPs in the range
+ 192.160.1.0/24, and that the part of the Intranet website you want to allow
+ internet access to is /usr/local/apache2/htdocs/subarea
.
+ This configuration should remain outside of your HTTPS virtual host, so
+ that it applies to both HTTPS and HTTP.
SSLCACertificateFile conf/ssl.crt/company-ca.crt @@ -287,5 +298,3 @@ Require valid-user - -