rseabra / pam_ipahbac

Implements FreeIPA's HBAC for other systems without SSSD
Other
5 stars 2 forks source link

Intro

PAM IPA HBAC logo

AIX supports it's own two LDAP attributes, per user: one which lists hosts where the user is allowed to login, and another of hosts where he is forbidden to.

Solaris has just one, for allowed hosts.

Both are unmaintanable messes per user, not the elegancy of FreeIPA's HBAC controls, they both miss the concept of flexible control of user access to hosts and services.

This is just a simple PAM module that aims to implement FreeIPA's HBAC for systems that don't support it, like AIX and Solaris, or for systems that want to support it without a full FreeIPA client stack.

The logo is a play with the concept of plugging in the missing piece.

Building the PAM module

To build, either use the build scripts or use these commands:

./configure --prefix=/usr
make
sudo make install

Building in AIX is a very long story, checkout the rpm SPEC. One used to need to build a lot of dependencies before it could work, but the usual source of RPMS for AIX seems to have had some recent love fixing most of the issues.

Testing

You can check sample.pam included for more details about configuring the module, but it's a bit like this:

cat <<EOF > /etc/pam.d/ipahbac_test
account    required     pam_ipahbac.so blameGetOpt -u YourSysAccount -b dc=your,dc=domain -P /etc/ldap.secret -l ldaps://ldap1/,ldaps://ldap2/..
EOF

Options

Note: since I was meeting instability processing the options with AIX's getopt, I had to move them into a file.

Just use the options above in a file (eg /etc/ipahbac.conf) one per line, such as:

-d
-D dc=example,dc=com
...

Status

OS Status Observations
Fedora 23 Done Just for fun, not really needed on modern IPA-ready native systems. And never tested again! :)
Solaris 11.3 Done No longer supported as I don't have neither servers nor time to test!
7.1 Done Should work properly since AIX 7.1, but have only tested in 7.2 and 7.3 with IBM IDS ldap client. Remember to compile in 64 and 32 bits... check the RPM spec for further compile instructions with Xlc

Resources

I found these resources especially helpful.

Beat Gammit's Simple PAM

I forked Beat Gammit's simple example as basis for start. You can find it here: https://github.com/beatgammit/simple-pam

Guides

These guides give brief overviews about PAM and how to write modules. This is useful if you already have a little knowledge.

License

The whole project is licensed under the GNU GPL version 2 or later. test.c is licensed under MIT since most of it's original code remains. If none remains after sometime, this alert will be removed.

Aditionally, you're allowed to link with Solaris and AIX's PAM libraries.