Duke Extensions to krbdirp - krbdirp-1.4


Credits

This is the download page for Duke's code extensions to Jeremy Rumpf's original iPlanet 5.x Kerberos authentication plugin. As noted in the comments associated with the code below, this work incoroporates code written at OSU by Jeremy Rumpf, ideas derived from code written by Michael Gettes and copyrighted by Princeton University, and code written by Rob Carter at Duke University. The bulk of the code is released under the L-GPL.

Downloads

You can download the full source code for the Duke version of the krbdirp-1.4 plugin here.

A new (beta) version of the code is available for testing (version 1.5). The new version includes additional code intended to make the plugin compatible with the JES Directory Server version 6.2. The new code addresses interactions between the 6.2 DSCC and the plugin, and builds properly under Solaris 10 in 64 bit mode. The beta code is available here.

Please forward any questions or comments to the author at rob@oit.duke.edu or to the LDAP2PAM mailing list at ldap2map@georgetown.edu.

Additional supporting code (necessary for using the Solaris "door" mechanism described below to combat threadsafety problems in using various PAM libraries with the plugin) is also available. If you're planning on building the code to use the Solaris door mechanism, you'll need at least the add-in passauthd daemon, source to which is available here.

Likewise, if you're interested in using the passauthd daemon to integrate an LDAP with the Duke WebAuth web-based authentication mechanism, in addition to the WebAuth code (available here) you'll need the WebAuth Proxy Token PAM module.

Why extend the original krbdirp code?

The Duke extensions to the original krbdirp-1.1 code fall into two categories: Extensions which change the semantics of of plugin itself and extensions to support the use of PAM libraries as an alternative to direct Krb5 authentication for directory users. In the first category (enabled by compiling the code with with "-DDUKE" turned on in the Makefile) are a handful of changes designed to facilitate the use of the plugin in mixed Kerberos/non-Kerberos or PAM/non-PAM environments. Specifically, the extensions:

In the second category (enabled by including -DPAM or -DDOOR along with -DDUKE in the Makefile) is a set of extensions which essentially replace the original Krb5 back-end with a PAM-based back-end. The extension merely replaces the underlying "verify()" routine in Jeremy's original code with a PAM-enabled version. It retains the plugin's authentication caching features, replacing only the back-end password verification routine and leaving the cache-checking wrapper routines intact.

In the "-DPAM" case, the code incorporates PAM support directly into the plugin. This has the advantage of being self-contained, but has disadvantages in situations where the PAM libraries used are not entirely threadsafe, or where they aren't relatively threadsafe in the context of the LDAP server processes. Specifically, since both the LDAP server code and the MIT Kerberos code make heavy use of thread-unsafe DNS resolver calls, and since the SunOne plugin API doesn't expose any of the mutexes used internally to do thread interlocking around DNS resolver calls, operating in "-DPAM" mode with Kerberos PAM libraries can be risky. In our experience at Duke, we've found that it's typically not an issue when running on a single-processor machine -- the plugin ensures that it's the only code running on a given processor. In multi-processor environments, however, the plugin isn't able to interlock with LDAP threads running on different processors, and frequently runs into thread collisions.

For this reason, we introduced the "-DDOOR" option. Built with "-DDOOR" rather than "-DPAM", the plugin expects to communicate through a Solaris door with an external daemon (passauthd) which incorporates all of the requisite PAM library calls, and simply reports success or failure back to the plugin through its door. We've been running this version of the plugin code at Duke in production for over two months, and have found performance to be at least as good with the "-DDOOR" version as with the "-DPAM" version, and since moving to the separate-daemon model, we've experienced no thread collisions. It is worth noting that the "door" mechanism is very Solaris-specific -- in future, we'd like to make available mods to also support using a named pipe or local unix-domain socket to exchange information between the plugin and the passauthd daemon, but for now, this feature is only available for Solaris servers.

Caveats


Previous Version

For those of you looking for the krbdirp-1.3-duke distribution, you can still retrieve it here.


Rob Carter Systems and Core Services, OIT Duke University Last updated 10/02/2007