[Top] [Prev] [Next] [Last]
|
|
Chapter 3Tutorial: Access Control
- a configuration that defines who is allowed to access a given object and who is forbidden to access it
- a means of authenticating users or hosts to determine whether they fall within the set of allowed entities
- host-based access control
- access control with basic authentication
- access control with SSL/TLS-compliant client certificates
Host-Based Access Control
- to publish marketing information to the World Wide Web
- to provide shipping and routing data to employees
- allows any employee to access the tracking data and
- prevents external users from reaching it.
To set up host-based access control
- Create a new subdirectory within the DocumentRoot directory.
# cd ServerRoot/htdocs
# mkdir staff
NOTE: Alternatively, you could create a special virtual host, such as staff.host.com. However, virtual host support varies from platform to platform, and establishing a new host is beyond the scope of this tutorial.
- Open the server configuration file in your favorite text editor:
# vi ServerRoot/conf/httpd.conf
- Move to the end of the file.
- Insert a new directory container, leaving space for configuration directives:
<Directory ServerRoot/htdocs/staff>
. . .
</Directory>
- Insert the order directive between the container tags, like this:
order deny,allow
- Insert the deny directive, like this:
deny from all
- Insert the allow directive, like this:
allow from yourhost.com
allow from 204.17
NOTE: Domain name-to-IP number mapping is not straightforward, so be sure you know how your address space is mapped before you use a partial IP address with allow or deny.
- Save the modified configuration file.
- Restart Stronghold:
# ServerRoot/bin/reload-server
Stronghold re-reads the configuration file when it restarts.
- Test the new configuration:
- Access http://www.yourhost.com/staff from an internal host.
- Try to access the same URL from an external host, either by asking an external user to do so or by telnetting to an external host and using a text-based browser to test the URL.
- make sure the URL uses the correct directory name,
- check httpd.conf to make sure that deny is set to "all," and
- make sure that allow is set to your base domain name preceded by a wildcard.
To add hosts to the configuration
- Make a list of the home hostnames or IP numbers of the telecommuters:
207.33.129.36
jabberwock.wonderland.com
- Open the server configuration file using a text editor:
# vi ServerRoot/conf/httpd.conf
- Locate the <Directory ServerRoot/htdocs/staff> container.
- Append the list of hostnames and IP numbers to the value for the allow directive, separating them with spaces:
allow from *.yourhost.com 207.33.129.36 jabberwock.wonderland.com
- Append the same list to the allow directive in the identical directory configuration within the <VirtualHost *:443> container.
- Save the modified configuration file.
- Restart Stronghold:
# ServerRoot/bin/reload-server
Stronghold re-reads the configuration file when it restarts.
- Enter your pass phrase.
Access Control with Basic Authentication
Imagine that your widget company decides to make its confidential client information available to managers through your Stronghold server, using a subdirectory within the staff directory you created in "Host-Based Access Control" on page 3-2. The new subdirectory is already protected by your host-based access control configuration, but now you need to make sure that the confidential client information is accessible to managers and protected from everyone else-including family members and other employees. In this case, authenticating the host alone is not enough. You also need to authenticate the user.
To set up access control with basic authentication
- Create the new directory for the confidential client information:
# mkdir ServerRoot/htdocs/staff/clients
This new directory inherits the host-based access controls you configured in "Host-Based Access Control" on page 3-2.
- Create a new directory for password files:
# mkdir ServerRoot/pw
- Use the ServerRoot/bin/htpasswd utility to create a new password file and add yourself, the administrator, as its first user:
# htpasswd -c ServerRoot/pw/passwd1 admin
- Enter a new password.
- Re-enter your password for confirmation.
- Open the server configuration file in your favorite text editor:
# vi ServerRoot/conf/httpd.conf
- Move to the end of the file.
- Insert a new directory container:
<Directory ServerRoot/htdocs/staff/clients>
. . .
</Directory>
- Insert the following directives inside the directory container:
RequireSSL on
AuthType Basic
AuthName "Client Information"
AuthUserFile pw/passwd1
Require valid-user
- the SSL/TLS requirement, which blocks HTTP access and permits HTTPS access
This prevents users from sending their usernames and passwords unencrypted.
- the type of authentication-in this case, basic authentication
- the name of the authentication realm, so that users with access to more than one realm know which username and password they must enter
- the name of the password file for this authentication realm
- the access control requirement, which is that the user must be a valid user from the password file
- Save the configuration file.
- Restart Stronghold:
# ServerRoot/bin/reload-server
Stronghold re-reads the configuration file when it restarts.
- Test the new configuration:
- Access https://www.yourhost.com/staff/clients. Your browser should present a dialog box where you can enter your username and password. After you enter these, Stronghold should return an empty directory index.
- To make sure passwords cannot be transmitted in the clear, try accessing the same URL with HTTP instead of HTTPS. Stronghold should return a status code of 403 (Forbidden).
- Add more users to the password file using the htpasswd utility:
# htpasswd ServerRoot/pw/passwd1 user1
Access Control with SSL/TLS Certificates
- the mathematical algorithm used to generate its signature
- the issuer of the certificate, including its country, state or province, locality, organizational name, organizational unit, and common name
- the validity period
- the subject or bearer of the certificate, including the subject's country, state or province, locality, organization, organizational unit, and public key
To set up access control with client certificates
- Create a new directory to hold the dynamic Web pages that would generate account information:
# mkdir ServerRoot/htdocs/account-data
- Open the server configuration file in your favorite text editor:
# vi ServerRoot/conf/httpd.conf
- Insert the following in the global server configuration:
SSLVerifyClient 2
- Move to the end of the file.
- Insert a new directory container:
<Directory ServerRoot/htdocs/account-data>
. . .
</Directory>
- Enter the following directives inside the directory container:
RequireSSL on
SSL_Require size GTE 1024
- the SSL/TLS requirement, which blocks HTTP access and permits HTTPS access
- the certificate parameter required for access: The certificate's public key algorithm must implement a key size greater than or equal to 1024 bits.
This means that only you can access the directory, and only with your client certificate. You cannot access it from another host without obtaining another client certificate for that host and adding it to the configuration. Constraining the acceptable key size prevents users from accessing the directory using a weak certificate. You can use SSL_Require to set requirements for any field in a client certificate. You can find the complete list of possible arguments for the SSL_Require directive in "SSL Certificate Authentication and Access Control" on page 7-96.
- Save the modified configuration file.
- Restart Stronghold:
# ServerRoot/bin/reload-server
Stronghold re-reads the configuration file when it restarts.
- Test the new configuration:
- Access https://www.yourhost.com/account-data. Stronghold should return an empty directory index (if directory indexing is enabled).
- Try accessing http://www.yourhost.com/account-data. Stronghold should return an error message with status code 403.
If the test succeeds, you have successfully established access control with client certificates.
Now, imagine that you want to establish two subdirectories within the account-data directory, one for files relating to checking or savings account and one for files relating to credit accounts. You also want to apply a higher level of security to the credit account directory than to the others. To accomplish this, you can use the SSL_Group directive to establish different client certificate access control groups.
To set up access control groups
- Create the new subdirectories:
# mkdir ServerRoot/htdocs/account-data/deposit
# mkdir ServerRoot/htdocs/account-data/credit
- Open the server configuration file in your favorite text editor:
# vi ServerRoot/conf/httpd.conf
- Move to the end of the file.
- Enter the following directives:
SSLVerifyClient 2
SSL_Group deposit "size GTE 1024 AND IOU EQ DepositAcctCA"
SSL_Group credit "size GT 1024 AND IOU EQ CreditAcctCA"
- Create two new directory containers, one for each of the new subdirectories:
<Directory ServerRoot/htdocs/account-data/deposit>
. . .
</Directory>
<Directory ServerRoot/htdocs/account-data/credit>
. . .
</Directory>
- Add the following directives to the "deposit" container:
RequireSSL on
SSL_Require deposit
- the SSL/TLS requirement, which blocks HTTP access and permits HTTPS access
- the SSL/TLS access control group, whose parameters the client must satisfy
- Add the following directives to the "credit" container:
RequireSSL on
SSL_Require credit
- Save the modified configuration file.
- Restart Stronghold:
# ServerRoot/reload
Stronghold re-reads the configuration file when it restarts.
- Test the new configuration:
- Access https://www.yourhost.com/account-data/deposit using a 1024-bit certificate. Stronghold should return an empty directory index (if directory indexing is enabled).
- Try accessing http://www.yourhost.com/account-data/credit using the same certificate. Stronghold should return an error message with status code 403 (Forbidden).
If the test succeeds, you have successfully established SSL/TLS access control groups.
[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net![]()