User Authentication via Pluggable Authentication Module (PAM)

Users of Linux and some other unix-like operating systems, including recent versions of Solaris, can use the Pluggable Authentication Module (PAM) system.

PAM allows PAM-compatible applications including the to switch authentication methods without recompiling the application. This allows a system administrator to upgrade to a completely different authentication system without recompiling the application. Changes are made by updating configuration files to specify which authentication method should be used and optionally by adding additional subroutine libraries to add new types of authentication methods. The additional subroutine libraries can be purchased, or you can develope one yourself.

Note: At the time PAM was added to Sybase CEP, PAM was not available on MS-Windows systems.

This document assumes that you already have the PAM modules that you need and therefore we explain only how to configure your to use existing PAM modules. For more information about PAM, including information about how to develop PAM modules of your own, see the PAM documentation on the internet. As of the date that this feature was introduced in Sybase CEP, these documents were located at:

http://www.kernel.org/pub/linux/libs/pam/
    Linux-PAM-html/Linux-PAM_SAG.html
http://www.kernel.org/pub/linux/libs/pam/
    Linux-PAM-html/Linux-PAM_ADG.html

The first of these documents is the System Installation Guide, which explains how to configure a PAM system when you already have the files you need. The second document explains how to write your own pluggable authentication module.

We assume:

A Brief Overview of PAM with C8

In the diagram below, you can see the basic components involved when Sybase CEP uses PAM:

contains functions designed to work with PAM, including the initialize, authenticate, and shutdown functions. You will need to configure your c8-server.conf file to specify the name of the library that contains these functions.

The API box indicates what type of information is transmitted from the Sybase CEP Server to the PAM Plugin (which is a library that actually runs as part of the same process as the Server). The Server passes user and password information to the C8 PAM Plugin, and the C8 PAM Plugin returns a set of values that indicate:

The C8 PAM Plugin calls appropriate functions in the PAM library, and passes appropriate information to that library.

The PAM library does a variety of things, including:

The PAM library does more than this, but these are the key high-level tasks as far as the is concerned.

The /etc/pam.d/c8 file specifies which authentication method should be used, and other details, which are explained in more detail below. For additional information, see the internet pages that document PAM.

Configuring Sybase CEP Server to Use PAM

As with any plugin, you must update the c8-server.conf configuration file to specify information about the plugin. The default c8-server.conf file included with your contains a commented-out section with PAM-related configuration parameters. The basic parameters are described here:

<!-- Sample PAM authentication plugin configuration -->
<section name="Plugin">
<preference name="LibraryName" value="c8_server_plugins_lib"/>
<preference name="InitializeFunction" value="c8_auth_plugin_pam_initialize"/>
<preference name="AuthenticateFunction" value="c8_auth_plugin_pam_authenticate"/>
<preference name="ShutdownFunction" value="c8_auth_plugin_pam_shutdown"/>
<!--
 Uncomment the following line and change 'value' to 
 set the password prompt that PAM sends to applications.  
 The defaultprompt is "Password: ".  (Note the required 
 space at the end.)  You should only need to do this if 
 you encounter a system that does not use the default, 
 and as such, it failing authentication.
-->
<!-- <preference name="PasswordPrompt" value="Password: "/> -->
</section>

Look carefully at your c8-server.conf file to see the exact parameters for your version of Sybase CEP. See also the .

By default, this section is commented out in the c8-server.conf file. Make sure that you de-comment it.

To use a PAM, you must specify:

Since the C8 PAM library is supplied by Sybase CEP, the names of the library and the functions in it are known, so you can de-comment this section of the c8-server.conf file. You do not need to change the values of the library or function names.

Configuring the PAM Service

Create or edit a PAM configuration file to specify which authentication method (for example, password, or fingerprint) you want to use with . Sybase CEP Server calls the PAM library functions to read this configuration file. The PAM library functions then know which of the many PAM authentication functions to use. Complete documentation about this PAM configuration file can be found as part of the PAM documentation. Key aspects are covered below.

In this document, we assume that you will create

/etc/pam.d/c8

Although PAM allows 4 different types of management group rules (account, auth, password, and session), uses only two: account and auth.

The examples below use only a single rule. See the PAM documentation if you need information about how to use a "stack" containing multiple rules.

This sample configuration file will check the user against the system password:

# type     control    module-path    module-arguments
# -------  --------   ------------   -------------------
auth       required   pam_stack.so   service=system-auth
account    required   pam_stack.so   service=system-auth 

The type is either auth or account.

In this case, the user must follow the specified authentication rule, so we put required. If you are using a stack that contains multiple rules, you might specify values other than required for some rules. For more information, see the PAM documentation.

The module-path indicates which PAM library we want to use to perform the authentication. The module-path is either the absolute path and filename of the PAM to be used by the application (if the path begins with a '/'), or a relative pathname from the default module location: /lib/security/ or /lib64/security/, depending on the architecture.

The module-arguments are a space-separated list of tokens that can be used to modify the specific behavior of the given PAM. The exact values depend on which PAM library module you are using and can be found in the documentation for that specific module. In this example, we are specifying that we want the normal system-wide authentication method on this computer (typically a user ID and password).

This configuration file allows access to all users. This may be useful for testing but is not secure.

# type    control   module-path    module-arguments
# -----   --------  -------------  ----------------
auth      required  pam_permit.so 
account   required  pam_permit.so
         

This configuration file denies all access and is useful for testing.

# type    control   module-path  module-arguments
# -----   -------   -----------  ----------------
auth      required  pam_deny.so 
account   required  pam_deny.so

PAM Troubleshooting

This section provides troubleshooting tips for some PAM-related problems.