Previous Next Contents Index


Chapter 6

Securing Applications

This chapter describes how to implement Netscape Application Server security.

The following topics are included in this chapter:


About Security
Implementing application security is a joint effort between the application developers and the server administrator: the application developers are responsible for determining what level of security to implement and implementing that level into their applications; the administrator is responsible for managing the users and groups who use the application, as well as access control lists.

This chapter explains how to set up users and groups, the type of security each provides, and how they are used with access control lists. It also describes how user entries are stored in Netscape Directory Server and managed using Netscape Console and LDIF. Access control lists are stored locally on each server machine and are managed using the NAS Administrator tool.

Limitations of This Document This chapter does not explain Directory Server and Netscape Console in great detail. Rather, it provides descriptions of the basic start-up tasks you must perform when setting up Directory Server in association with your instance of NAS, as well as how to use Netscape Console to manage users and groups. See Netscape Directory Server and Netscape Console documentation for detailed instructions and descriptions of these products.

You can find Directory Server documentation installed with your instance of NAS in the following location:

NAS install directory/manual/en/slapd/
Netscape Console documentation is available on Netscape's web site in the following location:

http://home.netscape.com/eng/server/console/
What Is LDAP? Every instance of Netscape Application Server (NAS) uses Directory Server to store shared server information, including information about users and groups. Directory Server supports Lightweight Directory Access Protocol (LDAP) versions 2 and 3. LDAP is an open directory access protocol that runs over TCP/IP. It is scalable to a global size and millions of entries. Using Directory Server, you can store all of your enterprise's information in a single, centralized repository of directory information that any application server can access via the network.

Netscape Directory Server is installed with each instance of NAS.

What Is Netscape Console? Netscape Console is a stand-alone Java application. It finds all resources and applications registered in Directory Server, and displays them in a graphical interface. Netscape Console functions independently of any server, and you can use it from any computer or workstation connected to your enterprise.

Netscape Console is installed with each instance of NAS. You use Netscape Console to manage users and groups for NAS. You can also use Netscape Console to launch the NAS Administrator tool, but only for local instances of NAS -- that is, instances of NAS installed on the same machine as Netscape Console. You must launch remote instances of NAS from the command line or from the Windows NT start menu.


Storing and Managing Users and Groups
The information you specify for each entry you create is stored in the Directory Server used with your instance of Netscape Application Server (NAS). The information held in Directory Server is shared between all application servers when you have multiple servers supporting an application

Implementing User-Based Security User-based security allows access to an application by authenticating a user's user name and password. The user name and password of any user who requires access to the application must be stored in Directory Server.

An application starts the user authentication process by calling the application component—usually a servlet—responsible for user authentication. The user's login privileges are then verified against the list of users stored in Directory Server.

Once a user is successfully authenticated, access to specific application components is managed programmatically using access control lists and application components responsible for application security.

User security verifies access to an application based on a user's name and password. To implement user security, you must create a user profile, which holds the user name and password, for all users of an application. This procedure is described in Using Netscape Console to Add Entries to Directory Server.

Using Netscape Console to Add Entries to Directory Server You can use Netscape Console to create user entries and group entries. A user entry contains information about an individual person or object in the directory. A group consists of all users who share a common attribute. For example, all users in a particular department might belong to the same group.

What Is a Distinguished Name (DN)?
Each of the users and groups in your enterprise is represented in Directory Server by a distinguished name (DN). A DN is a text string that contains identifying attributes. You use DNs whenever you make changes in the directory's users and groups database. For example, you need to specify DN information each time you create or modify directory entries, set up access controls, and set up user accounts for applications such as mail or publishing. The users and groups interface of Netscape Console helps you create or modify DNs.

For example, this might be a typical DN for an employee of Netscape Communications Corporation:

uid=doe,e=doe@netscape.com,cn=John Doe,o=Netscape Communications 
Corp.,c=US
The abbreviations before each equal sign in this example have the following meanings:

DNs may include a variety of name-value pairs. They are used to identify both certificate subjects and entries in directories that support LDAP.

Creating User Entries Using Netscape Console
User security is best suited for applications that have a small number of known users. You must create a user profile for each user who accesses the application.

You must be a Directory Server administrator or a user with the necessary permissions to create a user.

To create a new user entry in the directory using Netscape Console, perform the following steps:

  1. From the Windows Start menu, under Programs, choose Netscape Server Family, then Netscape Console 4.0 to open Netscape Console.
  2. Enter a valid user name and password and click OK.
  3. Click the Users and Groups tab.
  4. Use the drop-down list in the lower-right corner of the window to choose New User, then click Create.
  5. In Select Organizational Unit, click the directory subtree (ou) to which the user will belong, then click OK.
  6. In the Create User window, enter user information.
  7. Click the Licenses tab.
  8. Select the servers this user is licensed to use, then click OK.
  9. (Optional) Click the Languages tab.
Creating Group Entries Using Netscape Console
A group consists of all users who share a common attribute. For example, all users with DNs containing the attribute ou=Sales belong to the Sales group. Once you create a new group, you add users, or members, to it. You can use three types of groups in your directory: static, dynamic, and certificate groups.

Creating a Static Group

Create a static group by specifying the same group attribute in the DNs of any number of users. A static group doesn't change unless you add a user to it or delete a user from it. For example, a number of users have the attribute department=marketing in their DN. None of those users are members of the Marketing group until you explicitly add each one to the group.

To create a static group in the directory, perform the following steps:

  1. In Netscape Console, click the Users and Groups tab to display the following window:
  2. Use the drop-down list in the lower-right corner of the window to choose New Group, then click Create.
  3. In the Select Organizational Unit window, select the directory subtree (ou) to which the group will belong, then click OK.
  4. In the Create Group window, enter group information, then click the Members tab.
  5. If you only want to create the group now and plan to add group members later, click OK and skip the rest of this procedure.
  6. In the Members window, click Add or Edit as appropriate.
Creating a Dynamic Group

Create a dynamic group when you want users to be added automatically to a group based on their DN attributes. For example, you can create a group that automatically includes any DN that contains the attribute department=marketing. Whenever you apply a search filter for department=marketing, the search returns a group including all DNs containing that attribute. The DNs are included automatically; you do not have to add each individual to the group.

To create a dynamic group in the directory, perform the following steps:

  1. In Netscape Console, click the Users and Groups tab to display the following window:
  2. Use the drop-down list in the lower-right corner of the window to choose New Group, then click Create.
  3. In the Select Organizational Unit window, select the directory subtree (ou) to which the group will belong, then click OK.
  4. In the Create Group window, enter group information, then click the Members tab.
  5. Click Dynamic Group, then click Add.
  6. Use the Construct and Test LDAP URL dialog box to specify the criteria for including users in the dynamic group.
  7. Click OK.
  8. (Optional) In the Construct and Test LDAP URL dialog box, to see a list of users and groups included in the dynamic group, click Test.
  9. Click OK.
Modifying Database Entries Using Netscape Console
Before you can modify user or group data, you must first use the Users and Groups Search function to locate the user or group entry in the user directory. Then you can select operations from the menu bar to change the entry. The operations you perform apply to all in the Search list.

See Netscape Console documentation for more information.

Using LDIF to Add Entries to Directory Server You can add entries to Directory Server using LDIF or Netscape Console. Netscape Console is described Using Netscape Console to Add Entries to Directory Server.

Directory Server uses the LDAP Data Interchange Format (LDIF) to describe a directory and directory entries in text format. LDIF is commonly used to initially build a directory database or to add large numbers of entries to the directory all at once. You can also add or edit entries using the ldapmodify command along with the appropriate LDIF update statements.

To add entries to the database using LDIF, first define the entries in an LDIF file, then import the LDIF file from Directory Server.

Formatting LDIF Entries
LDIF consists of one or more directory entries separated by a blank line. Each LDIF entry consists of an optional entry ID, a required distinguished name, one or more object classes, and multiple attribute definitions.

The basic form of a directory entry represented in LDIF is:

dn: distinguished name

objectClass: object class
objectClass: object class
...
attribute type[;subtype]:attribute value
attribute type[;subtype]:attribute value
...
You must supply the DN and at least one object class definition. In addition, you must include any attributes required by the object classes that you define for the entry. All other attributes and object classes are optional. You can specify object classes and attributes in any order. The space after the colon is also optional. For information on standard object classes and attributes, refer to the Netscape Directory Server Schema Reference Guide.

Modifying Database Entries Using ldapmodify
You use the ldapmodify command-line utility to modify entries in an existing Directory Server database. ldapmodify opens a connection to the specified server using the distinguished name and password you supply, and modifies the entries based on LDIF update statements contained in a specified file. Because ldapmodify uses LDIF update statements, ldapmodify can do everything that ldapdelete can do. Most of Directory Server's command-line utilities are stored in a single location. You can find them in the following directory:

NAS install directory/bin/slapd/server
The remaining three—ldapdelete, ldapmodify, and ldapsearch—are stored in the following directory:

NAS install directory/shared/bin
The following is an example of the command used to add a user to an LDIF file:

ldapmodify -h myserverhost -p 389 -D "Directory Manager" -w admin -a -f 
MyUsersFile
Creating Entries Programmatically You can also create entries progammatically within an application using the LDAP JDK included with each installation of NAS. See the Programmer's Guide for more information.


Setting Access Control List Authorization
Access control lists (ACLs) allow you to set permissions for users and groups. A permission relates to an action the user is allowed to perform, such as read or write.

Netscape Application Server (NAS) comes with default permissions, but you can also create your own application-specific permissions and ACLs. The information in an ACL is used by the application to verify the permissions of the current user or group for an action the user attempts.

If a user does not have a certain permission, the application can direct the user to re-login, prompt him to exit the application, or direct him to a different part of the application.

Creating an Access Control List You use NAS Administrator to create and manage access control lists (ACLs). When creating an ACL, you can create groups to which users belong and add only groups to the ACL rather than adding individual users as members to the ACL. This is useful if you are using individual user-based security; you save the administration maintenance of updating users in the ACL when users change.

For example, if you have created users for an intranet application and a user leaves the company, you need to remove that user only from the appropriate group or groups, as opposed to removing the user from the groups and any ACLs.

To create an access control list, perform the following steps:

  1. On the NAS Administrator toolbar, click the Security button to open the Security window of NAS Administrator.
  2. Click the New button located at the bottom of the window.
  3. In the Access Control List field, enter a name for the ACL.
  4. To add a user or group to the ACL, click the Add User or Group button at the bottom of the dialog box.
  5. Select the users and/or groups you want to add to the ACL.
  6. Click OK.
  7. To add a new permission to the ACL, click New Permission.
  8. Enter the new permission action word.
  9. Click OK.
  10. To set the appropriate permissions for the groups in the ACL, check each permission for that group.
Modifying an Access Control List You can modify the following ACL properties:

You can also remove groups from the system.

To modify an access control list, perform the following steps:

  1. On the NAS Administrator toolbar, click the Security button to open the Security window of NAS Administrator.
  2. Click the Modify button located at the bottom of the window.
  3. To add a new user or group, click Add User or Group.
  4. Select the group or groups you want to add to the ACL.
  5. Click OK.
  6. To create a new permission, click New Permission.
  7. To edit the permissions of a group, select or deselect the appropriate permissions for that group.
  8. To remove a group, select that group and click Remove.
 

© Copyright 1999 Netscape Communications Corp.