Micro Focus Enterprise Server Security and Microsoft Active Directory:
Initial Setup

Preliminary Documentation

Copyright © 2006-2008 Micro Focus (IP) Limited. All rights reserved.

Contents

  1. Introduction
    1. Overview
  2. Using ADAM
    1. The ADAM Software
    2. Creating the ADAM Application Partition
  3. ES LDAP Setup
    1. Prerequisites
    2. Running the Setup Script
    3. Configuring ES
  4. Additional Information
    1. Browsing the ADAM Repository
    2. Adding Repository Objects using ADSIEdit
    3. Adding Existing MTO Users to the LDAP Repository
    4. Setting User Passwords with esfadmin
    5. Enabling MFDS Administration for LDAP and User Password Changes

Introduction

Starting with WebSync 2 for Micro Focus Enterprise Server 5.0, ES with Mainframe Transaction Option (ES/MTO) includes a security feature called the External Security Facility or ESF. ESF lets ES authorize users and control access to resources by querying one or more external security managers (ESMs), which are facilities outside ES that can verify users and/or supply rules for resource access control. ES communicates with ESMs using ESM Modules, plug-ins that are loaded by ESF based on the security configuration created by the ES administrator.

ESF lets you secure ES using OS or third-party security mechanisms. You can have ES verify MTO users via the operating system, so MTO user accounts are managed by the OS, for example. You also now have more flexible control over the access that MTO users have to various resources (programs, datasets, etc).

One popular option is to put user definitions and resource control rules into an LDAP directory, such as Microsoft's Active Directory Application Mode (ADAM), which is a simplified version of Active Directory suitable for running on workstations and maintaining application data. This documentation describes the initial setup of ADAM for use with ES.

Using Active Directory with ESF

If you have the full Active Directory running on your network (on Windows domain controllers), and you want to use it for storing your Enterprise Server security information, you should refer to two other documents included with Micro Focus Net Express 5.0 WebSync 3, LDAP-Setup-Instructions.rtf and LDAP-ES-Admin-Setup.rtf. The instructions here can be used with Active Directory, but because Active Directory is used to maintain enterprise configuration data, it's more complex than ADAM, so we supply additional documentation.

Even if you intend to use Active Directory, you may want to experiment with ADAM first to gain familiarity with how ES uses LDAP.

Using Other LDAP Servers

We do not currently provide instructions for configuring other LDAP servers for use with ES, but the information here and in the two documents listed above is mostly relevant to other LDAP servers as well.

Overview

External security can be enabled for ES servers and for the Directory Server (MFDS) through the security configuration panels in the MFDS administration GUI. ESM modules are defined in the ES directory, much like servers, listeners, and other objects. Then one or more modules can be specified in a security configuration. There is a security configuration for MFDS itself, a "default server" configuration that applies to all ES servers that do not have their own security configuration, and an optional configuration for each individual server. This lets you use different security configurations for different servers (eg for test and production systems), and a different configuration for MFDS.

Here we will only configure one ESM module, the MLDAP ESM module which is used with LDAP servers. You may want to configure it only for ES servers, or even for only one server, until you become familiar with how it operates.

When external security is enabled for an ES component, that component will load and initialize the ESF Manager at startup. (MFDS loads ESF Manager shortly after it starts. ES servers load ESF Manager in each SEP as the SEP initializes.) ESF Manager will load and initialize each defined (and enabled) ESM Module. In the case of the MLDAP ESM Module, the module will connect to the LDAP server (here ADAM).

At appropriate points in processing, the ES component will call the ESF Manager to verify a user signon or authorize user access to a resource. ESF Manager will relay these requests to the MLDAP ESM Module, which will perform the appropriate searches of the LDAP repository and process the returned information in order to make its decision.

In the default (and simplest) configuration, the MLDAP ESM Module uses LDAP object types defined by Micro Focus (an LDAP schema), which specify users and resource definitions. So configuring the LDAP repository for ES security requires importing the Micro Focus schema and creating user and resource objects.

LDAP user objects include such information as the user name, a password verifier (which can be a plain-text password or a password hash), and user data such as default group, idle timeout, and expiration date. Resource objects name the resource or resources they apply to and include an access control list (ACL) which details who is allowed what kind of access to the object. Resource objects can use wildcards in their names, as can ACL entries, which makes it possible to easily create generic rules. ACL entries can also apply to individual users or to user groups, for role-based access control.

The rest of this document covers configuration of the LDAP server. For more information on the MLDAP ESM Module, access control rules, and external security in general, see your product documentation.


Using ADAM

The Enterprise Server product line includes ADAM and automatically installs it. ADAM is a Windows component, and is always installed into the ADAM directory under the system root (usually C:\Windows).

If you are using AD, and not using ADAM, you can skip the final step in this section, "Creating the ADAM Application Partition".

Some people may want to initially configure ES to use ADAM while they get acquainted with the LDAP support in ESF, even if they eventually intend to use AD, as ADAM is simpler to administer and use.

The ADAM Software

ADAM should have been installed automatically when you installed or updated Enterprise Server (or Net Express).

If for some reason ADAM is not installed on your system, the ADAM installer can be downloaded from Microsoft free of charge. That Microsoft page also contains additional information on installing and configuring ADAM, but the instructions here should be sufficient.

Note: There is a known issue with ADAM on some versions of Windows which may cause problems if the following Registry key is set to any value other than 0:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\forceguest

You can ensure that this key has the value 0 by running the following command:

reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v forceguest /t REG_DWORD /d 0 /f

or by editing the Registry using a tool such as Regedit.

After downloading the installer, simply run it (as an administrative user) to install ADAM.

Creating the ADAM Application Partition

You can skip this step if you plan to use Active Directory rather than ADAM.

Select "Start" > "Programs..." > "ADAM" > "Create an ADAM Instance...".

(You can also open an "ADAM Tools Command Prompt" window, or open a regular command prompt window and cd to %systemroot%\ADAM, and run adaminstall.exe.)

Each "ADAM Instance" is an LDAP server running on your machine. We'll create an instance specifically for ES use, though if you already had an ADAM instance (or Active Directory) running locally you could use that.

Note: ADAM Instances appear in the Add/Remove Programs control panel after they have been created, as "ADAM Instance Name". To remove an ADAM Instance, select the instance in Add/Remove Programs, click "Remove", and follow the prompts. You'll have to click through a few warnings about deleting the configuration set; this is normal and safe.

In the Wizard screens specify the following:

As the instance is created you may be prompted by your firewall; configure it appropriately to allow your ADAM instance to accept connections at least from localhost on port 389.


ES LDAP Setup

After installing ES and ADAM, and creating your ADAM application partition (unless you are using AD), you will need to define the LDAP object classes and containers (the schema) that will hold ES data. That data includes:
After the LDAP schema is created, it needs to be populated with the ES users, groups, and resources from the default configuration, plus any additional MTO users and MFDS users and groups you may have created.

Micro Focus supplies a command script, es-ldap-setup.cmd, which will perform these steps for you.

Prerequisites

You need to have Micro Focus Net Express 5.0 or Server 5.0 installed, with MTO, and Websync 2 or later. (Websync 3 is preferred.) ADAM should be installed, even if you plan to use AD, so that the script can use the ADAM utilities.

Running the Setup Script

Open a Command Prompt window, and change to the bin directory of your Net Express or Server installation.

You can run es-ldap-setup with no parameters for the default behavior. Without parameters it will prompt you for several pieces of information, such as the LDAP server location. You can just press Enter to accept the default values unless you need to specify something else.

The full syntax for es-ldap-setup is:

es-ldap-setup [options] username password partition server
Most users will run es-ldap-setup with no parameters, but in some cases you may need to specify some or all of them:

These are the actions es-ldap-setup performs:
  1. Prompts for values for username, etc, if they are not specified on the command line. Press Enter to accept the default, or supply a different value.
  2. If ADAM is not configured to allow password operations over unsecured connections, the script will configure it to allow them. This is required by some of the following actions. If the script changes this option on the server, it will reset it to its old value before exiting.
  3. Adds the ES user, group, and resource LDAP class definitions to the schema. These specify what attributes each of these types of object has.
  4. Adds the container objects for ES to the repository.
  5. Creates MFReader, the default LDAP user account for ES.
  6. Creates the administrative LDAP user for adding MTO users. (This step is skipped if the /AD option is specified.)
  7. Imports MTO users that are defined in the default MTO resource definition file into the LDAP repository. See Adding MTO Users to the LDAP Repository for more information.
  8. Imports MFDS users and groups into the LDAP repository.
  9. Imports the default MTO resource access control definitions into the LDAP repository.
Before each action, es-ldap-setup will pause and tell you what it's about to do. When it finishes, it will report how many actions succeeded and how many failed, and give a list of the failing actions, which you can provide to Micro Focus Support if you have questions.

Note: Some users may encounter a known issue with the ADAM dsmgmt utility when running the script. If you get an error message similar to the following:

    DsBindWithSpnExW error 0x6ba (The RPC server is unavailable.)

then there is an issue with your network configuration which is preventing the utility from connecting to your ADAM server. This is a Windows issue, not a Micro Focus one. Possible fixes include:

Configuring ES

After you have successfully configured your LDAP server for ES, you can configure ES to use LDAP for security. This is discussed in more detail in the product documentation. Here is a short overview:


Additional Information

This section describes some optional tasks that may be useful in creating, viewing, and editing your ES LDAP security configuration.

Browsing the ADAM Repository

You can use the Microsoft ADAM ADSIEdit utility (ADAM-ADSIedit.msc) to view the ES areas of your LDAP repository.

Start ADAM ADSIEdit from the Start menu, then:
  1. Select Actions → Connect to..., which lets you create a view of a part of the repository.
  2. Create a connection to the ES application partition:
  3. Click OK.
Now the left-hand pane should contain a tree view item named "MF". If you expand this item, and then the container within it, you will see the ES containers such as "CN=Enterprise Server Users", the container "CN=ADAM Users" which has the definition of the MFReader user, and automatically-generated containers such as "CN=Roles".

You can open these containers and double-click on the objects within them to view (or edit) their attributes.

Adding Repository Objects using ADSIEdit

You can also use ADSIEdit to create new objects in the repository, such as new MTO users, using Action → New. Select the appropriate object type, then complete the wizard, which will prompt for required values and give you an opportunity to enter optional ones. (You can change any of these later by editing the object.)
You may want to create a new ADAM user for ES to use. If you want to give ES permission to change objects in the repository – to let users change their passwords when they sign on, or to enable LDAP administration through MFDS – then you will want to configure the MLDAP Security Manager in MFDS with a different Authorized ID and Password. (It's not safe to give the default MFReader account write permission to the repository, because that username and its password are available to anyone who reads the ES LDAP setup materials.)

Adding MTO Users to the LDAP Repository

Many existing ES/MTO customers have created multiple MTO resource definition (RDO) files, to configure various ES servers (or "regions"). These RDO files may contain users defined for MTO. The es-ldap-setup script reads the default RDO file (files\sys\dfhdrdat under the product installation directory) and adds any user definitions in it to the LDAP repository. If you have other RDO files, though, you may want to extract user definitions from them and import them into LDAP for use with ES external security.

You can use the cas-to-ad.exe utility to migrate MTO user definitions into LDAP. Run "cas-to-ad -h" to get a syntax message. Current options are:

Option Use To Default
-u user Set username for AD connection (name or DN) Current logon name
-p password Set password for AD connection None; if not set, you will be prompted
-d DN DN for AD application partition CN=Micro Focus,CN=Program Data,DC=local
-c container container for added ES users CN=Enterprise Server Users
-l host:port Location of the AD server localhost:389
-s host:port Synonym for -l localhost:389
-r path Path to CAS RDO file See below
-e encoding Password encoding md5 (the other option is "literal")
-U class User object class microfocus-MFDS-User (see LDAP-Setup-Instructions.rtf)
-v Show version and exit N/A
-h Show syntax help and exit N/A


Option values can be appended to the option character or specified as the next argument on the command line.
 

The CAS RDO file (always named dfhdrdat) that cas-to-ad will process is located as follows:

  1. If the -r option is used, cas-to-ad will use the specified path
  2. If not, cas-to-ad will see if the environment variable TXRDTP is defined, and if so will use that path
  3. If not, it will look for a dfhdrdat file in the current directory, and if one is present use it
  4. If not, it will look for the Net Express 5 (or Server 5) base directory Registry key, and use files\sys\dfhdrdat under that directory

The -e option controls how user passwords are stored in LDAP. The default is -e md5, which stores a salted MD5 hash of the password. The value of the microfocus-MFDS-User-Pwd attribute will have the form "MF-MD5:base64-salt:base64-hash", where base64-salt and base64-hash are character strings that contain base64-encoded data. This is an irreversible transformation (the hash can be used to verify the password but not to reconstruct it). The other encoding currently supported is -e literal, which stores the password in plain text, in the form "literal:password". This form is useful for debugging and when creating ES users using ADSIEdit.

Setting User Passwords with esfadmin

If you edit a user's password (the microfocus-MFDS-User-Pwd attribute) directly in the LDAP repository, using a tool such as ADSIEdit, you can only set a literal password value. This is often not satisfactory because the password can be seen by anyone who can read the repository.

If you have enabled MFDS administration of the LDAP repository, you can use MFDS to change a user's password: go to the MFDS security options, view the list of Security Managers, select the MLDAP manager, click the Properties button, edit the user, and set a new password. See the MFDS documentation for more information.

Another alternative is to use the esfadmin.exe utility, which is part of Net Express and Server and can be found in the product's bin directory. esfadmin is a command-line utility that calls the ESF Admin API to request administrative actions against ESMs. The advantage of esfadmin is that you supply all its configuration information on the command line, so you do not have to configure your MLDAP security manager in MFDS with an LDAP administrative user ID.

To set a password using the esfadmin command, you will need a valid ES username and password (not necessarily the user whose password you're setting), and an LDAP username and password for an account with write access to the user's record in the repository. esfadmin has to sign on to ESF before it can perform an admin request, which is why you need an ES username / password.

You set a password using the setpassword option:

    esfadmin [options] setpassword user=username password=new-password

esfadmin will prompt for the LDAP user ID and password. (The user ID is usually specified as an LDAP DN, eg CN=admin,CN=ADAM Users,CN=Micro Focus,CN=Program Data,DC=local; or as a Windows username with domain, eg domain\admin.) You can also specify these on the command line using the -U and -P options (note these must be uppercase-U and uppercase-P).

By default esfadmin uses "SYSAD", one of the default accounts created during setup, for the ES username and password it uses to sign on to ESF. You can supply a different username and password with the -u and -p (both lowercase) options.

Enabling MFDS Administration for LDAP and User Password Changes

By default, ES uses the MFReader account to connect to the LDAP server. As its name suggests, MFReader does not have authority to make changes to the repository, only to read from it.

You may want to configure your MLDAP Security Manager in MFDS with different LDAP user credentials (Authorized ID and Password), to give it update access to part or all of the repository. You can configure it with credentials for an administrative user, or create a new LDAP user (see Adding Repository Objects using ADSIEdit) and then set ACLs in the LDAP repository (using ADSIEdit or other Microsoft tools) to give that user write access to specific parts of the repository.

For example, if you have created an ADAM user named "MFUpdate", you could give it write access to user objects by setting an ACL with the dsacls.exe ADAM utility:

dsacls "\\localhost\CN=Enterprise Server Users,CN=Micro Focus,CN=Program Data,DC=local"
/I:S /G "CN=MFUpdate,CN=ADAM Users,CN=Micro Focus,CN=Program Data,DC=local":WP
(Enter this command all on one line.)

Generally speaking, you do not want to give the MFReader LDAP user write access to the repository, because its name and password are well-known. Configure your security manager to use a different account instead, and be careful to keep that account's password a secret. (If non-privileged users have access to the system where MFDS is running, it's a good idea to set ACLs on the MFDS configuration files so that they can only be read by the account MFDS runs under, which is usually SERVICE.)

If an ES/MTO region is configured to use a MLDAP Security Manager that has update access to user objects, then interactive MTO users will be able to set their passwords when they sign on to the system (using the CESN transaction, or another program that calls the EXEC CICS SIGNON interface). This is particularly useful if you make use of the password expiration date attribute (microfocus-MFDS-User-Pwd-ExpirationDate) to force users to change passwords periodically, since it gives them a way to do so. (Note that the MLDAP ESM Module does not currently provide any way to automatically set the expiration date; that has to be done using some other tool.)

If MFDS is configured to use an MLDAP Security Manager that has update access to the various ES objects in the LDAP repository, then you can use MFDS to administer those objects. From the Security page of the MFDS administration GUI, go to the Security Managers tab, edit the Security Manager you have defined for LDAP, and click its Properties button. From there, you can view and edit users, groups, and resource access controls.