Integrated identity management with FreeIPA

Identity Check

Article from Issue 102/2009

FreeIPA offers integrated identity management and big ideas for the future.

Enterprise Linux systems employ a set of standard tools for security, auditing, and identity management. These tools work well independently, once you get them all configured, but when it comes to integration, the admin often must improvise. Features such as central management of audit logs from multiple machines, as well as the ability to distribute SELinux policy modules to multiple machines, are often the domain of home-grown scripts. Although many proprietary solutions exist, they are typically expensive and inflexible.

The FreeIPA [1] project is an effort to combine a number of popular open source projects into a common, unified system. IPA stands for Identity, Policy, and Audit, but the developers clearly use this abbreviation with an eye on future goals. The current emphasis is on identity management, with support for Kerberos and LDAP. Future releases will offer central configuration and management of certificates, as well as policy and auditing features.

Figure 1 shows the individual FreeIPA version 1 components and how they cooperate. The combination of LDAP and Kerberos means that FreeIPA is easy to integrate with Microsoft's Active Directory System. Although the Linux world offers other options for Active Directory integration (such as Samba or Likewise [2]), Active Directory itself is only part of the solution for a fully integrated security and auditing tool. For instance, Active Directory does not offer anything in the line of policy or audit management for Linux systems, thus forcing admins to turn to other sources for these functions. Many Linux users must also consider whether it is a good idea to place their network security infrastructure in the hands of a proprietary technology like Microsoft Active Directory.

Figure 1: Popular open source tools running under the common umbrella of FreeIPA.

FreeIPA is still a work in progress; the developers haven't yet achieved the full potential of this promising tool (see the box titled "The Path Ahead"). The current version, however, does provide LDAP and Kerberos support, as well as many other useful features. Here, I show you how to get started with FreeIPA.

The Path Ahead

The focus of the current FreeIPA version 1 is on managing user and group identities. Migrating existing NIS solutions to FreeIPA for a secure LDAP environment with Kerberos passwords is easy. The developer version already offers synchronization with an existing Active Directory server; in fact, Active Directory integration should be available in the official FreeIPA version by the time this issue leaves the press.

Version 2, which is due for release early next year, will add more features. The identity management feature will be extended to handle machine accounts.

Another feature on the roadmap is a Certificate Authority (CA) for issuing user and service certificates. Of course, the two missing IPA components, Policy (P) and Audit (A), still need to be included. The policy component will not just handle SELinux rule set management. The developer's roadmap also includes central management of PAM settings, with pam_access, pam_time, and pam_limits. It will also be easier to assign user privileges via sudo because admins will be able to manage these settings centrally with FreeIPA.

The audit components primarily access the functions of popular audit daemons to ensure compliance with existing identity policies. Of course, a central audit rule roll-out will include collecting audit events on individual machines. These audit events will be recorded on the FreeIPA server for reporting and evaluation.

Server Installation

Before you start installing the FreeIPA server itself, make sure all of the machines support DNS name resolution. Adding a couple of service (SRV) records to the existing DNS server will simplify later client configuration by allowing a DNS request to discover the responsible server and the Kerberos realm.

When you install the FreeIPA server, it will create a sample DNS zone file with all the required entries, and you can base your own DNS server extensions on this file (Listing 1).

Listing 1

DNS Extensions


To install the FreeIPA server on a Fedora system, just type yum -y install ipa-server. The server and all the required packages are available from the standard repositories and have been since Fedora 8. After installing, you need to call ipa-server-install to configure. If you prefer to create a matching DNS zone file directly, you can call the tool with the --setup-bind parameter. This step drops a zone file into the tmp folder.

Calling the setup routine installs the following components on your machine:

  • NTP
  • Fedora Directory Server
  • MIT Kerberos
  • Apache/TurboGears
  • SELinux-targeted policy for FreeIPA

The installation program prompts you to enter the required information (e.g., the LDAP Base DN, Kerberos realm, server name); just a couple of minutes later, the server and all its components are ready to rumble. Next, type kinit admin and ask for a user ticket for admin to check that the Kerberos server is working properly.

The following call adds a new user to the directory/Kerberos server:

# ipa-adduser -f Thorsten -l Scherf tscherf
Password (again):
tscherf successfully added

If your password entry is in line with the password complexity policy, ipa-finduser will find the user account, which now exists on the directory server:

# ipa-finduser tscherf
Full Name: Thorsten Scherf
Home Directory: /home/tscherf
Login Shell: /bin/sh
Login: tscherf

If you need more information on the LDAP attributes, you can, of course, set up a Kerberos-authenticated connection to the LDAP server and query it for the information you need (Listing 2).

Listing 2

Querying the Server


The klist tool now displays the transferred service ticket for the LDAP server:

[root@devel-srv1 ~]# klist -5
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: admin@VIRT.FOO.DE
Valid starting Expires Service principal
09/19/08 13:57:28 09/20/08 13:57:26 krbtgt/VIRT.FOO.DE@VIRT.FOO.DE
09/19/08 13:57:42 09/20/08 13:57:26 ldap/

Of course, a web interface is available for easier handling of all of these tasks (Figure 2), but you do need to configure the web browser. Firefox shows the current configuration when you type about:config. The following commands are those you need to customize:

network.negotiate-auth.using-native-gsslib true

After opening an https connection to the FreeIPA server, you can easily create or query user accounts via the web interface.

Figure 2: The web interface makes it easy to add users to the directory.

Client Configuration

A FreeIPA client is available for Fedora, Red Hat Enterprise Linux (RHEL), and a variety of Unix variants, including Solaris, AIX, HP-UX, and Mac OS X. Installing on a Fedora system is easy with a simple yum command line:

yum install ipa-client ipa-admintools

If you then transfer the /etc/krb5.conf Kerberos configuration file from the server to the client, all you need to do is call ipa-client-install to start the client installation. Thanks to the dns_lookup_realm = true entry in /etc/krb5.conf, the client will ask its DNS server for all the necessary configuration information (Listing 3).

Listing 3

Client Installation


To test the server connection, you can use kinit admin on the client; if everything is working, the next step is to set up a host principal for the client in the Kerberos database and store the password locally on the client side:

# ipa-addservice host/
# ipa-getkeytab host/ -k /etc/krb5.keytab
Keytab successfully retrieved and stored in: /etc/krb5.keytab

Kerberos Services

The next step is to configure a service to work with Kerberos. First, consider the example of an NFS server that the client machines can access via the secure NFSv4 protocol with Kerberos authentication. The server will ensure data integrity and privacy. To allow this to happen, you need to set up an NFS share on the IPA server:

# cat /etc/exports
/data gss/krb5(rw,fsid=0,subtree_check)
/data gss/krb5p(rw,fsid=0,subtree_check)
/data gss/krb5i(rw,fsid=0,subtree_check)

Entering echo SECURE_NFS=yes > /etc/sysconfig/nfs activates all the required NFS services after the service nfs start command is issued.

Now you need to set up a service principal for the NFS service in the Kerberos database and export it to the server's keytab file:

# ipa-addservice nfs/
# ipa-getkeytab nfs/ -k
Keytab successfully retrieved and stored in: /etc/krb5.keytab

The client configuration is fairly similar. If you follow the same steps to create an NFS service principal and store it locally in the /etc/krb5.keytab file, the ipa-findservice command will tell you whether or not it has worked. The ipa-findservice command will list all the host and service principals in the keytab file.

To make sure that the required NFS client services, rpcgssd and rpcidmapd, start correctly, you need to add a SECURE_NFS=yes entry to the etc/sysconfig/nfs file. Now you are ready for a secure NFSv4 mount:

# mount -v -t nfs4 -o sec=krb5p devel-srv1:/ /mnt/nfs4

Note that FreeIPA stores the complete Kerberos configuration in LDAP (Figure 3). Because native Kerberos tools such as kadmin or kadmin.local do not offer a native LDAP interface, you cannot use them to manage the Kerberos database. Instead, administrators will always need to use the FreeIPA tools for administrative tasks.

Figure 3: FreeIPA stores the Kerberos database in an LDAP container.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Linux with Active Directory

    We explore some leading tools for integrating your Linux network with an Active Directory environment.

  • oVirt

    The days when administrators were forced to manage virtual machines at the console are gone. Competitors of VMware and Citrix now offer equally sophisticated GUIs. One promising alternative is Red Hat’s oVirt – a free Java interface for Libvirt.

  • Samba 4.0 Released

    The Samba team announces Samba 4.0 – the latest version of the free software file, print, and authentication server suite designed for compatibility with Windows networks.

  • Samba 4

    A technical preview version of Samba 4 became available at the end of January. We took a look at what’s coming in the next version of the Samba file and print service suite.

  • Linux with Active Directory

    Microsoft's Active Directory system provides centralized user management and single sign-on. If you're ready for a few manual steps, Linux can leverage this potential.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More