|
||
|
|
Chapter 8 Controlling Access to Your Server
This chapter discusses the various methods you can use to control access to the Administration Server and to the files or directories on your web site. For example, for the Administration Server, you can specify who has full control of all the servers installed on a machine and who has partial control of one or more servers. Before you can use access control on the Administration Server, you must enable distributed administration from and set up an administration group in your LDAP database. This chapter assumes you have already configured distributed administration and have defined users and groups in your LDAP database.
You should also ensure the security of the web server as discussed in Chapter 5 "Securing Your Enterprise Server."
This chapter contains the following sections:
- What Is Access Control?
![]()
- How Access Control Works
![]()
- Setting Access Control
![]()
- Selecting Access Control Options
![]()
- Limiting Access to Areas of Your Server
![]()
- Working with Dynamic Access Control Files
![]()
- Controlling Access for Virtual Servers
![]()
Access control allows you to determine:
- Who can access the Administration Server
![]()
- Which programs they can access
![]()
- Who can access the files or directories on your web site
![]()
You can control access to the entire server or to parts of the server, or the files or directories on your web site. You create a hierarchy of rules called access control entries (ACEs) to allow or deny access. Each ACE specifies whether or not the server should check the next ACE in the hierarchy. The collection of ACEs you create is called an access control list (ACL).
By default, the server has one ACL file that contains multiple ACLs. After determining the virtual server to use for an incoming request, Enterprise Server checks if any ACLs are configured for that virtual server. If ACLs are found that apply for the current request, Enterprise Server evaluates their ACEs to determine whether access should be granted or denied.
You allow or deny access based on:
- Who is making the request (User-Group)
![]()
- Where the request is coming from (Host-IP)
![]()
- When the request is happening (for example, time of day)
![]()
- What type of connection is being used (SSL)
![]()
Setting Access Control for User-Group
You can limit access to your web server to certain users or groups. User-Group access control requires users to enter a username and password before gaining access to the server.
The Administration Server uses only the basic authenticaton. If you wish to require client certificate authentication on your Administration Server, you must manually edit the ACL files in
obj.confchanging the method to SSL.User-Group authentication methods for server instances include:
All of these methods require a directory server.
User-Group authentication requires users to authenticate themselves before getting access to the Administration Server, or the files and directories on your web site. With authentication users verify their identity by entering a username and password, using a client certificate, or digest authentication plug-in. Using client certificates requires encryption. For information on encryption and using client certificates, see Chapter 5 "Securing Your Enterprise Server."
Default authentication is the preferred method. The Default setting uses the default method you specify in the
obj.conffile, or "Basic" if there is no setting inobj.conf. If you check Default, the ACL rule doesn't specify a method in the ACL file. Choosing Default allows you to easily change the methods for all ACLs by editing one line in theobj.conffile.Basic authentication requires users to enter a username and password to access your web server or web site. It is the default setting. You must create and store a list of users and groups in an LDAP database, such as the Netscape Directory Server. You must use a direstory server installed on a different server root than your web server, or a directory server installed on a remote machine.
When users attempt to access a resource that has User-Group authentication in the Administration Server or on your web site, the web browser displays a dialog box asking the user to enter a username and password. The server receives this information encrypted or unencrypted, depending on whether encryption is turned on for your server.
The following dialog appears to prompt users to authenticate themselves to the server:
Figure 8-1 Example of Username and Password Prompt
![]()
After clicking OK, the user will see:
- The Server Administration page, if authenticated to access Enterprise Application Server
![]()
- The file or directory listing requested, if logging in to a web site
![]()
- A message denying access if the username or password was invalid
![]()
You can customize the access denied message that unauthorized users receive in the Access Denied Response page.
The server can confirm users' identities with security certificates in two ways:
- Using the information in the client certificate as proof of identity
![]()
- Verifying a client certificate published in an LDAP directory (additional)
![]()
When you set the server to use certificate information for authenticating the client, the server:
- Checks first if the certificate is from a trusted CA. If not, the authentication fails and the transaction is ended. To learn how to turn on client authentication, see "Requiring Client Authentication".
![]()
- Maps the certificate to a user's entry using the
certmap.conffile, if the certificate is from a trusted certificate authority (CA). To learn how to set up the certificate mapping file see Using the certmap.conf File.![]()
- Checks the ACL rules specified for that user if the certificate maps correctly. Even if the certificate maps correctly, ACL rules can deny the user access.
![]()
Requiring client authentication for controlling access to specific resources differs from requiring client authentication for all connections to the server. If you set the server to require client authentication for all connections, the client only needs to present a valid certificate issued by a trusted CA. If you set the server's access control to use the SSL method for authentication of users and groups, the client will need to:
- Present a valid certificate issued by a trusted CA
![]()
- The certificate must be mapped to a valid user in LDAP
![]()
- The access control list must evaluate properly
![]()
When you require client authentication with access control, you need to have SSL ciphers enabled for your web server. See Chapter 5 "Securing Your Enterprise Server" to learn how to enable SSL.
In order to successfully gain access to an SSL authenticated resource, the client certificate must be from a CA trusted by the web server. The client certificate needs to be published in a directory server if the web server's
certmap.conffile is configured to compare the client's certificate in the browser with the client certificate in the directory server. However, thecertmap.conffile can be configured to only compare selected information from the certificate to the directory server entry. For example, you could configure thecertmap.conffile to only compare the user ID and email address in the browser certificate with the directory server entry. To learn more aboutcertmap.confand certificate mapping, see Chapter 5 "Securing Your Enterprise Server."Digest authentication allows the user to authenticate based on username and password without sending the username and password as cleartext. The browser uses the MD5 algorithm to create a digest value using the user's password and some information provided by Enterprise Server. This digest value is also computed on the server side using the Digest Authentication plug-in, and compared against the digest value provided by the client. If the digest values match, the user is authenticated.
In order for this to work, your directory server needs access to the user's password in cleartext. Later versions of Directory Server include a reversible password plug-in using a symmetric encryption algorithm to store data in an encrypted form, that can later be decrypted to its original form. Only the Directory Server holds the key to the data.
For digest authentication, you need to enable the reversible password plug-in and the digestauth-specific plug-in included with Enterprise Server 6.1. To configure your web server to process digest authentication, set the
digestauthproperty of the database definition indbswitch.conf.The server tries to authenticate against the LDAP database based upon the ACL method specified, as shown in Table 8-1. If you do not specify an ACL method, the server will use either digest or basic when authentication is required, or basic if authentication is not required.
Table 8-1 Digest Authentication Challenge Generation
Digest Authentication Not Supported by Authentication Database
When processing an ACL with
method = digest, the server attempts to authenticate by:
- Checking for Authorization request header. If not found, a 401 response is generated with a Digest challenge, and the process stops.
![]()
- Checking for Authorization type. If Authentication type is Digest the server then:
![]()
- Checks nonce. If not valid, fresh nonce generated by this server, generates 401 response, and the process stops. If stale, generates 401 response with
stale=true, and process stops.![]()
- Checks realm. If it does not match, generates 401 response, and process stops.
![]()
- Checks existence of user in LDAP directory. If not found, generates 401 response, and process stops.
![]()
- Gets request-digest value from directory server and checks for match to client's request-digest. If not, generates 401 response, and process stops.
![]()
- Constructs Authorization-Info header and inserts into server headers.
![]()
Installing the Digest Authentication Plug-in on UNIX
The Digest Authentication plug-in consists of a shared library found in both:
To install the Digest Authentication plug-in on UNIX, perform the following steps:
- Make sure this shared library resides on the same server machine that the Directory Server is installed on.
![]()
- Make sure you know the Directory Manager password.
![]()
- Modify the
libdigest-plugin.ldiffile, changing all references to the path of the digest plug-in shared library.![]()
- To install the plug-in, enter the command:
![]()
% ldapmodify -D "cn=Directory Manager" -w password -a < libdigest-plugin.ldif
Installing the Digest Authentication Plug-in on Windows NT/Windows 2000
You will need to copy several
.dllfiles from the Enterprise Server installation to your Directory Server server machine in order for Directory Server to start properly with the Digest plug-in.To install the Digest Authentication plug-in on Windows NT/Windows 2000, perform the following steps:
- Access the shared libraries in the Enterprise Server installation in:
![]()
- server_root
\bin\https\bin
- Locate the files:
![]()
- Copy them into either:
![]()
Setting the Directory Server to Use the DES Algorithm
The DES algorithm is needed to encrypt the attribute where the digest password is stored.
To set the Directory Server to use the DES algorithm, perform the following steps:
- Launch the Directory Server Console.
![]()
- Open your Directory Server instance.
![]()
- Select the Configuration tab.
![]()
- Click on the + sign next to plug-ins.
![]()
- Select the DES plug-in.
![]()
- Choose Add to add a new attribute.
![]()
- Enter
netscapeReversiblePassword.![]()
- Click Save.
![]()
- Restart your Directory Server instance.
In order to set a digest authentication password in the
netscapeReversiblePasswordattribute for a user, your entry must include thenetscapeReversiblePasswordobjectobject.
![]()
Using Other LDAP Attributes for Authentication
You can configure Enterprise Server to use an LDAP attribute other than
uidfor user authentication. Thedbswitch.confpropertyuniqueattrallows you to specify an alternative LDAP attribute that will be used to determine the user's DN.For example, to configure the default database for authentication against the common name (
cn) attribute, add the following todbswitch.conf:
dbswitch.conf:directory default ldap://hostname:389/o%3example.comdefault:binddn cn=directory managerdefault:encoded bindpw bmV0c2NhcGawdefault:uniqueattr cn
You can use
uniqueattrto specify any attribute that will return a single entry when the LDAP server is queried. If a query returns multiple entries, the authentication will fail.When you use an alternative attribute for user authentication, you can still use normal syntax in your ACL entries unless the LDAP entry returned by a query will include spaces (for example,
user = "John Doe"). To accommodate entries with spaces, specify each user entry separately, usingoras a delimiter. For example, to allow access for users identified by thecnvaluesJohn DoeandJane Doe, your ACL would look like this:
You can create a custom authentication method using the Access Control API.
Setting Access Control for Host-IP
You can limit access to the Administration Server, or the files and directories on your web site by making them available only to clients using specific computers. You specify hostnames or IP addresses for the computers that you want to allow or deny. You can use wildcard patterns to specify multiple computers or entire networks. Access to a file or directory using Host-IP authentication appears seamless to the user. Users can access the files and directories immediately without entering a username or password.
Since more than one person may use a particular computer, Host-IP authentication is more effective when combined with User-Group authentication. If both methods of authentication are used, a username and password will be required for access.
Host-IP authentication does not require DNS to be configured on your server. If you choose to use Host-IP authentication, you must have DNS running in your network and your server must be configured to use it. You can enable DNS on your server through the Performance Tuning page in the Preferences tab on your Server Manager.
Enabling DNS degrades the performance of Enterprise Server since the server is forced to do DNS look-ups. To reduce the effects of DNS look-ups on your server's performance, resolve IP addresses only for access control and CGI instead of resolving the IP address for every request. To do this,
iponly=1toAddLogin yourobj.conffile:
AddLog fn="flex-log" name="access" iponly=1
When you use access control on the Administration Server or the files or directories on your web site, the settings are stored in a file with the extension
.acl. Access control files are stored in the directory server_root/httpacl.The main ACL file name is
generated-https-server-id.acl; the temporary working file is calledgenwork-https-server-id.acl. If you use Netscape Administration Server to configure access, you'll have these two files. However, if you want more complex restrictions, you can create multiple files, and reference them from theserver.xmlfile. There are also a few features available only by editing the files such as restricting access to the server based on the time of day or day of the week.You can manually create and edit
.aclfiles to customize access control using APIs. For more information on using access control APIs, see the Netscape Enterprise Server Programmer's Guide.For more information on access control files and their syntax, see Appendix C "ACL File Syntax".
Configuring the ACL User Cache
Enterprise Server caches user and group authentication results in the ACL user cache. You can control the amount of time that ACL user cache is valid by using the
ACLCacheLifetimedirective in themagnus.conffile. Each time an entry in the cache is referenced, its age is calculated and checked againstACLCacheLifetime. The entry is not used if its age is greater than or equal to theACLCacheLifetime. The default value is 120 seconds. Setting the value to 0 (zero) turns the cache off. If you use a large number for this value, you may need to restart Enterprise Server when changes are made to the LDAP entries. For example, if this value is set to 120 seconds, Enterprise Server might be out of sync with the LDAP directory for as long as two minutes. Only set a large value if your LDAP directory is not likely to change often.Using the
magnus.confparameter ofACLUserCacheSize,you can configure the maximum number of entries that can be held in the cache. The default value for this parameter is 200. New entries are added to the head of the list, and entries at the end of this list are recycled to make new entries when the cache reaches its maximum size.You can also set the maximum number of group memberships that can be cached per user entry using the
magnus.confparameterACLGroupCacheSize. The default value for this parameter is 4. Non-membership of a user in a group is not cached.For more information on ACL file directives, see the Netscape Enterprise Server NSAPI Programmer's Guide.
When the server gets a request for a page, the server uses the rules in the ACL file to determine if it should grant access or not. The rules can reference the hostname or IP address of the computer sending the request. The rules can also reference users and groups stored in the LDAP directory.
For example, the following ACL file contains the two default entries for the Administration Server, plus an additional entry that allows users in the "admin-reduced" group to access the Preferences tab in the Administration Server.
For example, if a user requests the URL:
http://server_root/my_stuff/web/presentation.htmlEnterprise Server would first check access control for the entire server. If the ACL for the entire server was set to continue, the server would check for an ACL for the directory
my_stuff. If an ACL exists, the server checks the ACEs within the ACL, and then moves on to the next directory. This process continues until an ACL is found that denies access, or until the final ACL for the requested URL (in this case, the filepresentation.html) is reached.To set up access control for this example using the Server Manager, you could create an ACL for the file only, or for each resource leading to the file. That is, one for the entire server, one for the
my_stuffdirectory, one for themy_stuff/webdirectory, and one for the file.
This section describes the process of restricting access to the files or directories on your web site. You can set global access control rules for all servers, and also individually for specific servers. For instance, a human resources department might create ACLs allowing all authenticated users to view their own payroll data, but restrict access to updating data to only human resource personnel responsible for payroll.
You can set access control globally for all servers through the Administration Server. Each option is described in detail in the following section, Selecting the Access Control Options.
Distributed administration must be configured and activated before global access control can be created.
Setting Access Control Globally
To create or edit access control globally for all servers, perform the following steps:
- Access the Administration Server and choose the Global Settings tab.
![]()
- Click the Restrict Access link.
![]()
- Select the administration server (https-admserv) from the drop-down list.
![]()
- Click either:
![]()
- The Access Control Rules for
uri=/https-admserv/bin/*page appears:
Figure 8-2 Access Control Rules Page.
![]()
The Administration Server has two lines of default access control rules which cannot be edited.
- Check Access control is on, if not already selected.
![]()
- To create or edit the global ACL, click on Deny in the Action column.
![]()
- The Allow/Deny page is displayed in the lower frame:
- Select Allow, if it isn't already selected as the default, and click Update.
![]()
- Click on anyone in the Users/Groups column.
![]()
- The User/Group page appears in the lower frame:
- Select which users and groups you will allow access to and click Update.
![]()
- Clicking List for Group and User will provide lists for you to choose from.
- Click on anyplace in the From Host column.
![]()
- Enter Host Names and IP Addresses allowed access and click Update.
![]()
- Click on all programs in the Programs column.
![]()
- Select the Program Groups or enter the specific file name in the Program Items field you will allow access to, and click Update.
![]()
- (Optional) Click the x under the Extra column to add a customized ACL expression.
![]()
- Put a check in the Continue column, if it isn't already selected as the default.
![]()
- The server will evaluate the next line before determining if the user is allowed access. When creating multiple lines, work from the most general restrictions to the most specific ones.
- (Optional) Click Response when denied to direct the user to a different URL or URI.
![]()
- Enter the path to the absolute URL or a relative URI and click update.
![]()
- Click Submit to store the new access control rules in the ACL file.
Clicking Revert will remove all of the settings you've just created.
![]()
Setting Access Control for a Server Instance
You can create, edit, or delete access control for a specific server instance using the Server Manager.
To create access control for a server instance, perform the following steps:
- Access the Server Manager and select the server instance you wish to create or edit ACLs for.
![]()
- Choose the Preferences tab from the Server Manager.
![]()
- Click the Restrict Access link.
![]()
- Under the Option column choose one of the following:
![]()
The Access Control List Management Page offering three options appears:
Figure 8-6 Access Control List Management Page
![]()
- Select one of the following:
![]()
- Pick a resource to specify a wildcard pattern for files or directories (such as
*.html), choose a directory or a filename to restrict, or browse for a file or directory.![]()
- Pick an existing ACL to select from a list of all the ACLs you have enabled. Existing ACLs you have not enabled will not appear in this list.
![]()
- Enter the ACL name allows you to create named ACLs. Use this option only if you're familiar with ACL files. You'll need to manually edit
obj.confif you want to apply named ACLs to resources.![]()
Table 8-2 describes the resource wildcards you can use.
Table 8-2 Server Resource Wildcards
Figure 8-7 Access Control Rules Page
![]()
- Check Access control is on, if not already selected.
![]()
- To create or edit the ACL for this server instance, click on Deny in the Action column.
![]()
- The Allow /Deny page is displayed in the lower frame:
- Select Allow, if it isn't already selected as the default, and click Update.
![]()
- Click on anyone in the Users/Groups column.
![]()
- The User/Group page appears in the lower frame:
- Select which users and groups you will allow access to and click Update.
![]()
- Clicking List for Group and User will provide lists for you to choose from.
- Click on anyplace in the From Host column.
![]()
- Enter Host Names and IP Addresses allowed access and click Update.
![]()
- Click on all in the Rights column.
![]()
Figure 8-10 Access Rights Page
![]()
- Select one of the following and then click Update:
![]()
- (Optional) Click the x under the Extra column to add a customized ACL expression.
![]()
- Put a check in the Continue column, if it isn't already selected as the default.
![]()
- The server will evaluate the next line before determining if the user is allowed access. When creating multiple lines, work from the most general restrictions to the most specific ones.
- (Optional) Click Response when denied to direct the user to a different URL or URI.
![]()
- Enter the path to the absolute URL or a relative URI and click update.
![]()
- Click Submit to store the new access control rules in the ACL file.
Clicking Revert will remove all of the settings you've just created.
![]()
- Repeat all steps above for each server instance you wish to establish access control for.
![]()
- When finished, click Apply.
![]()
- Select hard start /restart or dynamically apply.
![]()
ACL settings can also be enabled on a per virtual server basis. To learn how this is done, see "Editing Access Control Lists for Virtual Servers".
Selecting Access Control Options
The following sections describe the various options that you can select when setting access control. For the Administration Server, the first two lines are set as defaults and cannot be edited.
You can specify the action the server takes when a request matches the access control rule.
- Allow means users or systems can access the requested resource
![]()
- Deny means users or systems cannot access the resource
![]()
The server goes through the list of access control expressions (ACEs) to determine the access permissions. For example, the first ACE is usually to deny everyone. If the first ACE is set to "continue," the server checks the second ACE in the list, and if it matches, the next ACE is used. If continue is not checked, everyone would be denied access to the resource. The server continues down the list until it reaches either an ACE that doesn't match, or that matches but is set to not continue. The last matching ACE determines if access is allowed or denied.
With user and group authentication, users are prompted to enter a username and password before they can access the resource specified in the access control rule.
Enterprise Server checks lists of users and groups stored in an LDAP server, such as Directory Server.
You can allow or deny access to everyone in the database, you can allow or deny specific people by using wildcard patterns, or you can select who to allow or deny from lists of users and groups.
- Anyone (No Authentication) is the default and means anyone can access the resource without having to enter a username or password. However, the user might be denied access based on other settings, such as host name or IP address. For the Administration Server, this means that anyone in the administrators group that you specified with distributed administration can access the pages.
![]()
- Authenticated people only
![]()
- All in the authentication database matches any user who has an entry in the database.
![]()
- Only the following people lets you specify which users and groups to match. You can list users or groups of users individually by separating the entries with commas, or with a wildcard pattern, or you can select from the lists of users and groups stored in the database. Group matches all users in the groups you specify. User matches the individual users you specify. For the Administration Server, the users must also be in the administrators group you specified for distributed administration.
![]()
- Prompt for authentication allows you to enter message text that appears in the authentication dialog box. You can use this text to describe what the user needs to enter. Depending on the operating system, the user will see about the first 40 characters of the prompt. Browsers cache the username and password, and associate them with the prompt text. When the user accesses files and directories of the server having the same prompt, the usernames and passwords won't need to be entered again. If you want users to authenticate again for specific files and directories, you simply need to change the prompt for the ACL on that resource.
![]()
- Authentication Methods specifies the method the server uses for getting authentication information from the client. The Administration Server offers only the Basic method of authentication.
![]()
- Default uses the default method you specify in the
obj.conffile, or "Basic" if there is no setting inobj.conf. If you check Default, the ACL rule doesn't specify a method in the ACL file. Choosing Default allows you to easily change the methods for all ACLs by editing one line in theobj.conffile.![]()
- Basic uses the HTTP method to get authentication information from the client. The username and password are only encrypted if encryption is turned on for the server.
![]()
- SSL uses the client certificate to authenticate the user. To use this method, SSL must be turned on for the server. When encryption is on, you can combine Basic and SSL methods.
![]()
- Digest uses the an authentication mechanism that provides a way for a browser to authenticate based on username and password without sending the username and password as cleartext. The browser uses the MD5 algorithm to create a digest value using the user's password and some information provided by Enterprise Server. This digest value is also computed on the server side using the Digest Authentication plug-in and compared against the digest value provided by the client.
![]()
- Other uses a custom method you create using the access control API.
![]()
- Authentication Database lets you select a database the server will use to authenticate users. This option is only available through the Server Manager. If you choose Default, the server looks for users and groups in an LDAP directory. If you wish configure individual ACLs to use different databases, select Other, and choose the database from the drop-down list. Non-default databases and LDAP directories need to have been specified in the file server_root
/userdb/dbswitch.conf. If you use the access control API for a custom database, such as Oracle or Informix, select Other, and enter the database name.![]()
You can restrict access to the Administration Server or your web site based on which computer the request comes from.
- Anyplace allows access to all users and systems
![]()
- Only from allows you to restrict access to specific Host Names or IP Addresses
![]()
If you select the Only from option, enter a wildcard pattern or a comma-separated list in the Host Names or IP Addresses fields. Restricting by hostname is more flexible than by IP address: if a user's IP address changes, you won't need to update this list. Restricting by IP address, however, is more reliable: if a DNS lookup fails for a connected client, hostname restriction cannot be used.
You can only use the
*wildcard notation for wildcard patterns that match the computers' host names or IP addresses. For example, to allow or deny all computers in a specific domain, you would enter a wildcard pattern that matches all hosts from that domain, such as*.example.com. You can set different hostnames and IP addresses for superusers accessing the Administration Server.For hostnames, the
*must replace an entire component of the name. That is,*.example.comis acceptable, but*users.example.comis not. When the*appears in a hostname, it must be the left-most character. For example,*.example.comis acceptable, butusers.*.comis not.For the IP address, the
*must replace an entire byte in the address. For example,198.95.251.*is acceptable, but198.95.251.3*is not. When the*appears in an IP address, it must be the right-most character. For example,198.*is acceptable, but not198.*.251.30.Restricting Access to Programs
Access to programs can only be restricted by the Administration Server. Restricting access to programs allows only specified users to view the Server Manager pages and determines if they can configure that server. For example, you might allow some administrators to configure the Users & Groups section of the administration server and not allow them access to the Global Settings.
- All Programs allows or denies access to all programs. By default administrators have access to all programs for a server.
![]()
- Only the following Program Groups allows you to specify which programs the user has access to. Select the program from the drop-down list. You can choose multiple program groups by pressing the Control key while clicking on the groups. You can restrict access to the following programs groups:
![]()
- The Program Groups listed reflect the tabs of the Administration Server, for example, Preferences and Global Settings, and represent access to those pages. When an administrator accesses the Administration Server, the server uses their username, host, and IP to determine what pages they can view.
- Program Items allows you to enter a page name in the Program Items field to control access to a specific page within a program.
![]()
- To determine the name of a page, place your pointer over the link in the left frame of the Administration Server and then view the text in the status bar on the bottom of your browser. The last word after the last %2b is the name for that page.
- For example, if you want the person who administers a Directory Server to have access only to the "Configure Directory Service" page, you would set up a rule that applies only to them (host, IP, and so on), and enter
dsconfigin the Program Items field
Figure 8-11 Page Name /Program Item
![]()
Access rights can only be set by the Server Manager for a server instance. Access rights restrict access to files and directories on your web site. In addition to allowing or denying all access rights, you can specify a rule that allows or denies partial access rights. For example, you allow users read-only access rights to your files, so they can view the information, but not change the files.
- All Access Rights is the default and will allow or deny all rights
![]()
- Only the following rights allows you to select a particular combination of rights to be allowed or denied
![]()
- Read allows users to view files, including includes the HTTP methods GET, HEAD, POST, and INDEX
![]()
- Write allows users to change or delete files, including the HTTP methods PUT, DELETE, MKDIR, RMDIR, and MOVE. To delete a file, a user must have both write and delete rights
![]()
- Execute allows users to execute server-side applications, such as CGI programs, and Java applets
![]()
- Delete allows users who also have write privileges to delete files or directories.
![]()
- List allows users to access lists of the files in directories that don't contain an
index.htmlfile.![]()
- Info allows users to receive information about the URI.
![]()
Writing Customized Expressions
You can enter custom expressions for an ACL. Only select this option if you are familiar with the syntax and structure of ACL files. There are a few features available only by editing the ACL file or creating custom expressions. For example, you can restrict access to your server depending on the time of day, day of the week, or both.
The following customized expression shows how you could restrict access by time of day and day of the week. This example assumes you have two groups in your LDAP directory: the "regular" group gets access Monday through Friday, 8:00am to 5:00pm. The "critical" group gets access all the time.
allow (read)
{
(group=regular and dayofweek="mon,tue,wed,thu,fri");
(group=regular and (timeofday>=0800 and timeofday<=1700));
(group=critical)
}For more information on valid syntax and ACL files, see Appendix C "ACL File Syntax" and "Referencing ACLs in obj.conf".
When you uncheck the option labeled "Access control is on," you'll get a prompt asking if you want to erase records in the ACL. When you click OK, the server deletes the ACL entry for that resource from the ACL file.
If you want to deactivate an ACL, you can comment out the ACL lines in the file
generated-https-server-id.aclby putting # signs at the beginning of each line.From the Administration Server, you could create and turn on access control for a specific server instance and leave it off (which is the default) for other servers. For example, you could deny all access to the Server Manager pages from the Administration Server. With distributed administration on and access control off by default for any other servers, administrators could still access and configure the other servers, but they cannot configure the Administration Server.
Responding When Access is Denied
Enterprise Server provides the following default message when access is denied: "FORBIDDEN. Your client is not allowed access to the restricted object." You can choose a different response when denied access. You can also create a different message for each access control object.
To change the message sent for a particular ACL, perform the following steps:
- Click the Response when denied link in the ACL page.
![]()
- Check Respond with the following file in the lower frame.
![]()
- Enter the path to the absolute URL or a relative URI and click update.
![]()
- Make sure users have access to the URL or URI they are redirected to.
- Click Update.
![]()
- Click Submit in the top frame to submit the access control rule.
![]()
Limiting Access to Areas of Your Server
This section describes some commonly used access restrictions to a web server and its contents. The steps for each procedure detail the specific actions you need to take; however, you will still need to complete all of the steps described under "Setting Access Control for a Server Instance".
The following procedures are described in this section:
- Restricting Access to the Entire Server
![]()
- Restricting Access to a Directory (Path)
![]()
- Restricting Access to a URI (Path)
![]()
- Restricting Access to a File Type
![]()
- Restricting Access Based on Time of Day
![]()
- Restricting Access Based on Security
![]()
Restricting Access to the Entire Server
You may wish to allow access to users in a group called who access the server from computers in a subdomain. For instance, you may have a server for a company department that you only want users to access from computers in a specific subdomain of your network.
Using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Choose the ACL File to edit.
![]()
- Pick the entire server resource, and click Edit Access Control.
![]()
- Add a new rule to deny access to all.
![]()
- Add another new rule to allow access to a specific group.
![]()
- Enter a wildcard pattern for the host names of the computers to be allowed.
![]()
- For example,
*.employee.example.com
- Unselect Continue.
![]()
- Submit and Apply your changes.
![]()
Restricting Access to a Directory (Path)
You can allow users in a group to read or run applications in directories, and its subdirectories and files, that are controlled by an owner of the group. For example, a project manager might update status information for a project team to review.
To limit access to a directory on the server, using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Choose the ACL File to edit.
![]()
- Browse the Pick a Resource section and select the directory you want to restrict.
![]()
- The directories in the server's document root are displayed. Once selected, the Editing drop-down list displays the absolute path to the directory.
If you want to view all files in your server root, click Options and then check List files as well as directories.
- Click Edit Access Control.
![]()
- Create a new rule and leave the defaults to deny access to everyone from everywhere.
![]()
- Create another new rule allowing users in a specific group to have read and execute rights only.
![]()
- Create a third line to allow a specific user to have all rights.
![]()
- Unselect Continue for the second and third lines and click Update.
![]()
- Submit and Apply your changes.
![]()
An absolute path to the file or directory would be created in the docroot directory. The entry in the ACL file would appear as follows:
acl "path=d:\Netscape\suitespot\docroot1\sales/";Restricting Access to a URI (Path)
You can use a URI to control access to a single user's content on the web server. URIs are paths and files relative to the server's document root directory. Using URIs is an easy way to manage your server's content if you frequently rename or move all or part of it (for example, for disk space). It's also a good way to handle access control if you have additional document roots.
To limit access to a URI, using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Enter the URI you want to restrict in the Type in the ACL name section.
![]()
- For example:
uri=/my_directory.
- Click Edit Access Control.
![]()
- Create a new rule to allows all users read access.
![]()
- Create another new rule to allow access for the owner of the directory.
![]()
- Uncheck Continue for both the first and second rules.
![]()
- Click Submit and Apply your changes.
![]()
A path for the URI is created relative to the document root. The entry in the ACL file would appear as follows:
acl "uri=/my_directory";Restricting Access to a File Type
You can limit access to file types on your server or web site. For example, you might wish to allow only specific users to create programs that run on your server. Anyone would be able to run the programs, but only specified users in the group would be able create or delete them.
To limit access to a file type, using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Click Wildcard in the Pick a resource section and enter a wildcard pattern.
![]()
- For example,
*.cgi.
- Click Edit Access Control.
![]()
- Create a new rule to allow read access to all users.
![]()
- Create another rule that allows write and delete access only to a specified group.
![]()
- Submit and Apply your changes.
![]()
For file type restriction, you would leave both continue boxes checked. If a request for a file comes in, the server will then check the ACL for the file type first.
A Pathcheck function is created in
obj.confthat may include wildcard patterns for files or directories. The entry in the ACL file would appear as follows:acl "*.cgi";Restricting Access Based on Time of Day
You can restrict write and delete access to the server or during specified hours or on specified days. You might use this to prevent people from publishing documents during working hours when people might be accessing the files.
To limit access based on time of day, using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Select the entire server from the drop-down list in Pick a Resource and click Edit Access Control.
![]()
- Create a new rule allowing read and execute rights to all.
![]()
- This means that if a user wants to add, update, or delete a file or directory, this rule won't apply and the server will search for another rule that matches.
- Create another new rule denying write and delete rights to all.
![]()
- Click X link to create a customized expression.
![]()
- Enter the days of the week and the times of day to be allowed.
![]()
- Example:
user = "anyone" and
dayofweek = "sat,sun" or
(timeofday >= 1800 and
timeofday <= 600)
- The message "Unrecognized expressions" will be displayed in the Users/Groups and From Host fields when you create a custom expression.
- Submit and Apply your changes.
![]()
Any errors in the custom expression will generate an error message. Make corrections and submit again.
Restricting Access Based on Security
You can configure SSL and non-SSL listen sockets for the same server instance. Restricting access based on security allows you to create protection for resources that should only be transmitted over a secure channel.
To limit access based on security, using the steps described for setting access control for a server instance, you would:
- Use the Server Manager to select the server instance.
![]()
- Choose the Preferences tab.
![]()
- Click the Restrict Access link.
![]()
- Select the entire server from the drop-down list in Pick a Resource and click Edit Access Control.
![]()
- Create a new rule allowing read and execute rights to all.
![]()
- This means that if a user wants to add, update, or delete a file or directory, this rule won't apply and the server will search for another rule that matches.
- Create another new rule denying write and delete rights to all.
![]()
- Click X link to create a customized expression.
![]()
- Enter
ssl="on".![]()
- Submit and Apply your changes.
![]()
Any errors in the custom expression will generate an error message. Make corrections and submit again.
Working with Dynamic Access Control Files
Server content is seldom managed entirely by one person. You may need to allow end users to access a subset of configuration options so that they can configure what they need to, without giving them access to the Administration Server. The subset of configuration options are stored in dynamic configuration files.
The following topics are described in this section:
Enterprise Server supports
.htaccessdynamic configuration files. You can enable.htaccessfiles either through the user interface or by manually changing the configuration files. The files that support.htaccessare in the server_root/plugins/htaccessdirectory. These files include a plug-in that enables you to use.htaccessfiles and a script for converting.nsconfigfiles to.htaccessfiles.You can use
.htaccessfiles in combination with the server's standard access control. The standard access controls are always applied before any.htaccessaccess control, regardless of the ordering ofPathCheckdirectives. Do not require user authentication with both standard and.htaccessaccess control when user-group authentication is `Basic' You could use SSL client authentication via the standard server access control, and also require HTTP `Basic' authentication via an.htaccessfile.This section includes the following topics:
- Enabling .htaccess from the User Interface
![]()
- Enabling .htaccess from magnus.conf
![]()
- Converting Existing .nsconfig Files to .htaccess Files
![]()
- Using htaccess-register
![]()
- Example of an .htaccess File
![]()
Enabling .htaccess from the User Interface
To configure your Enterprise Server to use
.htaccess, perform the following steps:
- Access the Server Manager and select the server instance you wish to enable
.htaccessfor.![]()
- Click on the Class Manager link at the top of the screen.
![]()
- Select the Content Mgmt tab.
![]()
- Click on the
.htaccessConfiguration link.![]()
- Select the server to edit by:
![]()
- Choosing the entire server or a specific server from the drop-down list
![]()
- Choosing the directory and files to edit by clicking Browse
![]()
- Choosing a wildcard pattern to edit by clicking Wildcard
![]()
- Select Yes to activate
.htaccess.![]()
- Enter the file name where you want the .
htaccessconfiguration to be added.![]()
- Click OK.
![]()
- When finished, click Apply.
![]()
- Select hard start /restart or dynamically apply.
![]()
Enabling .htaccess from magnus.conf
To manually enable your server to use the
.htaccess, you need to first modify the server'smagnus.conffile to load, initialize, and activate the plug-in.
- Open
magnus.conf in the server_root/https-identifier/configfile.![]()
- After the other
Initdirectives, add the following lines:![]()
- For UNIX/Linux:
![]()
Init fn="load-modules" funcs="htaccess-init,htaccess-find"server_root
shlib="/plugins/htaccess/htaccess.so" NativeThread="no"
Init fn="htaccess-init"
- For Windows NT/Windows 2000:
![]()
Init fn="load-modules" funcs="htaccess-init,htaccess-find,htaccess-register"server_root
shlib="/plugins/htaccess/htaccess.dll" NativeThread="no"
Init fn="htaccess-init"
- For HP:
![]()
Initfn="load-modules" funcs="htaccess-init,htaccess-find,htaccess-register" shlib="server_root/plugins/htaccess/htaccess.sl" NativeThread="no"
Init fn="htaccess-init"
- (Optional) Make the final line read:
![]()
Init fn="htaccess-init"[groups-with-users=yes]
- Click File /Save.
![]()
- Open
obj.conf.![]()
- Add the PathCheck directive to the
obj.conffile.![]()
- To activate
.htaccessfile processing for all directories managed by a virtual server, add thePathCheckdirective to the default object in theobj.conffile:![]()
<Object name="default">
...
PathCheck fn="htaccess-find"
</Object>
.htaccessprocessing should be the lastPathCheckdirective in the object.
- To activate
.htaccessfile processing for particular server directories, place thePathCheckdirective in the corresponding definition inobj.conf.![]()
- To name your
.htaccessfiles something other than.htaccess, you must specify the filename in thePathCheckdirective using the following format:![]()
Subsequent access to the server will be subject to
.htaccessaccess control in the specified directories. For example, to restrict write access to.htaccessfiles, create a configuration style for them, and apply access control to that configuration style. For more information, see Chapter 15 "Applying Configuration Styles."Converting Existing .nsconfig Files to .htaccess Files
Enterprise Server includes the
htconvertplug-in for converting your existing.nsconfigfiles to.htaccessfiles. The.nsconfigfiles are no longer supported. If you have been using.nsconfigfiles, you should convert them to.htaccessfiles.When activated,
htconvertsearches the givenserver.xmlfile document roots andobj.conffiles. It then searches theobj.conffiles forPathCheckdirectives and document-root directives.htconvertthen examines each of the directories so identified for.nsconfigfiles and converts any found files into.htaccessfiles. Multipleobj.conffiles can be examined if they are configured in theserver.xmlfile.
The
htconvertplug-in currently only supports theRestrictAccessandRequireAuthdirectives, and the<Files>wrapper. If<Files>other than<Files*>are presented, the script will give a warning and behave as though all files in the directory are to be access-controlled.To convert your files, at the command prompt, enter the path to Perl on your system, the path to the plug-in script, and the path to your
server.xmlfile. For example:
- server_root
\install\perl server_root/plugins/htaccess/htconvertserver_root/https-identifier/config/server.xml
All
.nsconfigfiles are converted to.htaccessfiles, but not deleted.The
groups-with-usersoption facilitates handling large numbers of users in groups. If you have many users in a group, follow these steps:
- Revise the format of the user file format to list all the groups a user belongs to:
![]()
username:password:group1,group2,group3,...groupn
- Revise the
AuthGroupFiledirective to point to the same file as theAuthUserFile.![]()
- Remove the
AuthGroupFiledirective entirely.![]()
- Add the following to the
Init fn=htaccess-initline in themagnus.conffile:![]()
groups-with-users="yes"
The
htaccess-registeris a new function allowing you to create your own authentication methods. You can create external authentication modules and plug them into the.htaccessmodule viahtaccess-register. Two sample modules are provided in server_root/plugins/nsapi/htaccess.You can use external modules to create one or more new directives. For example, you might specify the user database for authentication. The directives may not appear within
<Limit>or<LimitExcept>tags.The following example shows an
.htaccessfile:Supported .htaccess Directives
The following
.htaccessdirectives are supported in this release:
- host is all, to allow access from all client hosts
![]()
- host is all or the last part of a DNS host name
![]()
- host is a full or partial IP address
![]()
Does not need to be enclosed within a
<Limit>or<LimitExcept>range but usually is.Allows access to the specified hosts. Normally appears inside a
<Limit>range.
- host is all, to deny access from all client hosts
![]()
- host is all or the last part of a DNS host name
![]()
- host is a full or partial IP address
![]()
Does not need to be enclosed in a
<Limit> <LimitExcept>range but usually is.Denies access to the specified hosts. Normally appears inside a
<Limit>range.
AuthGroupFilefilename where filename is the name of file containing group definitions in the form: groupname: user user.Must not appear within a
<Limit>or<LimitExcept>range.Specifies that the named group file is to be used for any group definitions referenced in a require group directive. Note that if the filename specified in an
AuthGroupFiledirective is the same as the filename in anAuthUserFiledirective, the file is assumed to contain users and groups in the format:
username:DES-encrypted-password:comma-separated-list-of-groups
- filename is the name of file containing user definitions in the form: username
:password![]()
- username is a user login name, and password is the DES-encrypted password.
![]()
Must not appear within a
<Limit>or<LimitExcept>range.Specifies that the named user file is to be used for any user names referenced in a require user or require valid-user directive.
Note that the use of
groups-with-users=yesin theInit fn=htaccess-initdirective inobj.conf, or specifying anAuthGroupFiledirective with the same filename, causes that file to be assumed to be in the format:
username:DES-encrypted-password:comma-separated-list-of-groups
AuthNameauthentication realm where authentication realm is a string identifying an authorization realm to be associated with any request for user authentication.Must not appear within a
<Limit>or<LimitExcept>range.The authentication realm string typically appears in the prompt for username and password on the client side. It may affect caching of username and password on the client.
AuthTypeBasic. Must not appear within a<Limit>or<LimitExcept>range.Specifies the user authentication method as HTTP Basic Authentication, the only method currently supported.
allow, deny, order, or require directiveswhere method is an HTTP method such as GET, POST, or PUT. Any method that the web server understands can be used here.
Applies the enclosed directives only for requests using the specified HTTP methods.
<LimitExcept method method ...>
allow, deny, order, or require directives
where method is an HTTP method such as GET, POST, or PUT. Any method that the web server understands can be used here.
Applies the enclosed directives only for requests types not matching the specified HTTP methods.
Order ordering where ordering is one of:
Does not need to be enclosed within a
<Limit>or<LimitExcept>range, but usually is.
- allows, denies, evaluates allow directives and then deny directives
![]()
- denies, allows, evaluates deny directives and then allow directives
![]()
- mutual-failure denies access for a host listed in both allow and deny directives, regardless of their ordering
![]()
Does not need to be enclosed within a
<Limit>or<LimitExcept>range, but usually is.
- requires group requires the authenticated user to be a member of one of the specified groups.
![]()
- requires user requires the authenticated user to be one of the specified users.
![]()
- requires valid-user requires an authenticated user
![]()
.htaccess Security Considerations
By default, server support for HTTP PUT is disabled. You can activate HTTP PUT using the Remote File Manipulation page of Content Mgmt in the Class Manager. Great care should be taken in allowing PUT access to directories containing
.htaccessfiles, since it will allow them to be replaced. PUT access can be prevented on all files in a directory by restricting access. See "Restricting Access to a Directory (Path)".Controlling Access for Virtual Servers
Access control information in Enterprise Server can come from a per-virtual server ACL file and
.htaccessfiles in the document directories.Your
server.xmlfile can contain one or more ACLFILE tags which define an ID associated to a particular standard Enterprise Server 6.x ACL file. For example:
<ACLFILE id="standard" file="standard.acl">For virtual servers to use access control you must create a reference to one or more ACL file IDs in their `aclids' property. Example:
This configuration allows multiple virtual servers to share the same ACL file. If you want to require user-group authentication for a virtual server, you must add one or more USERDB tags to its definition. These USERDB tags create a connection between the database names in your ACL file and the actual databases found in
dbswitch.conf.The following example maps the ACLs with no `database' attribute to the `default' database in
dbswitch.conf:<USERDB id="default" database="default"/>
Accessing Databases from Virtual Servers
You can globally define user authentication databases in the
dbswitch.conffile.It is only read at server startup.The
baseDNof the LDAP URL indbswitch.confdefines the global root of all accesses to the database. This maintains backward compatibility. For most new installations, thebaseDNwould be empty.
dcsuffixis a new attribute for LDAP databases indbswitch.confthat defines the root of the DC tree according to the Netscape LDAP schema. It is relative to thebaseDNin the LDAP URL. When thedcsuffixattribute is present, the LDAP database is Netscape LDAP schema compliant, and the behaviour of some operations changes. For more information about the Netscape LDAP schema, see the Netscape Enterprise Server NSAPI Programmer's Guide.For every virtual server, you can define one or more
USERDBblocks that point to one of the directories, and you can define additional information. TheUSERDBblocks ID can be referenced in the database parameter of the ACL. If a virtual server has noUSERDBblocks, user or group-based ACLs will fail.
USERDBtags define an additional layer of indirection between the database attribute of an ACL anddbswitch.conf. This layer of indirection adds the necessary protection for the server administrator to have full control over which databases virtual server administrators have access to.For more information on USERDB, see the Netscape Enterprise Server NSAPI Programmer's Guide.
Specifying LDAP Databases in the User Interface
After you have defined one or more user authentication databases in
dbswitch.conf, you can use the Class Manager to configure which databases each of your virtual servers will use for authentication. You can also use the Class Manger to add a newly created database definition fromdbswitch.conffor the virtual server to authenticate againstTo specify which LDAP database or databases a virtual server should use, perform the following steps:
- Access the Server Manager and select the Virtual Server Class tab.
![]()
- Click on the virtual server class link where you wish to specify the LDAP database listed under Tree View of the Server.
![]()
- Select the Virtual Servers tab, if not already displayed.
![]()
- Click the ACL Settings link.
![]()
- Choose ACL Settings from the Select a Setting drop-down list.
![]()
- The ACL Settings for Virtual Servers page is displayed.
- Choose Edit from the drop-down list in the Option column, if not already displayed.
![]()
- Select a database configuration from the drop-down list in the Database column of the virtual server you are editing.
![]()
- Click OK.
![]()
- Close the Edit ACL Files window.
![]()
- Click Apply.
![]()
- Choose dynamically apply.
![]()
Editing Access Control Lists for Virtual Servers
ACLs for virtual servers are created for the server instance that the virtual server resides in. Virtual server ACL settings default to those created for the server instance. However, access control for each virtual server can be edited through the Class Manager. You would also use this method to add a newly created ACL file to a virtual server.
To edit ACL settings for a virtual server, perform the following steps:
- Access the Server Manager and select the Virtual Server Class tab.
![]()
- Click on the virtual server class link where you wish to specify the LDAP database listed under Tree View of the Server.
![]()
- Select the Virtual Servers tab, if not already displayed.
![]()
- Click the ACL Settings link.
![]()
- Choose Edit or Delete from the drop-down list in the Option field for each virtual server you wish to change.
![]()
- Click the Edit link in the ACL File field to display the available ACL files.
![]()
- Select one or more ACL files to add or delete for the virtual server.
![]()
- A virtual server can have multiple ACL files because they may have multiple document roots.
- Choose the database to associate the ACL list with from the drop-down list.
![]()
- (Optional) Enter the BaseDN.
![]()
- Click OK when you have finished making changes.
![]()
- Click Apply.
![]()
- Select dynamically apply.
![]()
© 2001 Sun Microsystems, Inc. Portions copyright 1999, 2002 Netscape Communications Corporation. All rights reserved.
Last Updated August 02, 2002