How to use LibAuth API Interface to design new auth library

This section explains about how to use LibAuth APIs interface to design new auth library that can be used to authenticate user/connection and encrypt/decrypt data by PBS (or any other application who follows LibAuth API specification)

As per LibAuth API specification, you have to define all API mentioned in specification except two optional API (auth_encrypt_data and auth_decrypt_data), if your auth library support encrypt and decrypt of data then you must have to define auth_encrypt_data and auth_decrypt_data.

The name of the new auth library must be "libauth_<auth method name>.so" where "auth method name" is the name to identify your library, for example "munge" for munge authentication, "gss" for GSS/Kerberos authentication

The new auth library should be installed in PREFIX/lib directory of the application, For PBS it should be installed in PBS_EXEC/lib directory.

If the new auth library has any executable then it should be installed in PREFIX/bin or PREFIX/sbin, For PBS it should be PBS_EXEC/bin or PBS_EXEC/sbin.

Munge + LibAuth = libauth_munge.so

This is the authentication library on top of Munge authentication. It only supports the authentication part. This means no encrypt and/or decrypt data part.

GSS/Kerberos + LibAuth = libauth_gss.so

This is the authentication library on top of GSS/Kerberos authentication. It supports authentication as well as encrypt/decrypt data also.

How PBS uses LibAuth APIs

PBS_AUTH_METHOD in the PBS configuration file (or as an environment variable) is used to specify which authentication method PBS should use. Possible value as of now in PBS are "MUNGE" (for munge authentication), "GSS" (for GSS/Kerberos authentication) and "resvport" (for resv-port authentication)

"resvport" is the default value for PBS_AUTH_METHOD, if not specified in the PBS configuration file.

Once PBS loads its configuration, it will call load_auth_lib(), which will decide which auth library to dynamically load based on "auth_method" and "is_auth_resvport" obj in "pbs_config" structure.

If it is an external auth method (aka "pbs_conf.is_auth_resvport == 0" and "auth_method" != "resvport") then it will try to load "libauth_<auth_method>.so" from PBS_EXEC/lib directory.

Once approriate libauth is loaded using dlopen()/LoadLibrary() it will load LibAuth APIs from loaded library using dlsym()/GetProcAddress() and put it in global function pointers for LibAuth (see src/lib/Libifl/auth.c for those function pointers).

Now rest of the PBS code will use those function pointers to access LibAuth APIs from the given auth library.

For more details please see below flows on where and how which LibAuth API will be used in PBS to authenticate and encrypt/decrypt data.

For now "resvport" is considered as internal and default auth method as it is still part of PBS code and all other auth method is considered as an external auth method, but in future, if resvport becomes auth library then it will also be considered as external auth method.

How Client Authenticate to Server (TCP)

How Server Authenticate client (TCP)

How TPP Leaf/Router authenticate to Router

How Secure data flows in TCP connection (between Client and Server)

How Secure data flows in TPP connection (between TPP Leaf/Router and Router)

Changes in PR:



OSS Site Map

Project Documentation Main Page

Developer Guide Pages