<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hacklab.to &#187; hacks</title>
	<atom:link href="http://hacklab.to/archives/tag/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://hacklab.to</link>
	<description>Toronto&#039;s hacker collective</description>
	<lastBuildDate>Thu, 10 May 2012 19:19:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>LDAP Outside the Enterprise</title>
		<link>http://hacklab.to/archives/ldap-outside-the-enterprise/</link>
		<comments>http://hacklab.to/archives/ldap-outside-the-enterprise/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 05:15:18 +0000</pubDate>
		<dc:creator>Owen Jacobson</dc:creator>
				<category><![CDATA[Running a Hacker Space]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://hacklab.to/?p=98</guid>
		<description><![CDATA[I&#8217;ve just spent about 3 days LDAPizing several of the support apps Hacklab uses, so I thought I&#8217;d share my notes. LDAP is Easy LDAP is the grandaddy of centralized databases, designed in the early 90s to replace the huge, complex, and expensive X.500 directory protocols. It models the universe as a tree of entries, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just spent about 3 days LDAPizing several of the support apps Hacklab uses, so I thought I&#8217;d share my notes.<br />
<span id="more-98"></span></p>
<h3>LDAP is Easy</h3>
<p><abbr title="Lightweight Directory Access Protocol">LDAP</abbr> is the grandaddy of centralized databases, designed in the early 90s to replace the huge, complex, and expensive X.500 directory protocols. It models the universe as a tree of entries, where each entry has a <abbr title="Distinguished Name">DN</abbr> and a set of attributes. DNs are built by selecting an attribute to uniquely identify a given entry at its level of the LDAP tree, so an entry&#8217;s DN looks like a list of name=attribute pairs: <code>ou=People,dc=hacklab,dc=to</code> identifies the entry whose <abbr title="Organizational Unit">ou</abbr> attribute is &#8220;People&#8221; and whose parent is the entry <code>dc=hacklab,dc=to</code>.</p>
<p>That&#8217;s the entire data model: a tree of dictionaries.</p>
<h3>LDAP is Hard</h3>
<p>LDAP itself is a only protocol, not a service for any particular use; when people talk about LDAP, what they really mean is &#8220;LDAP plus the schemata we&#8217;re using.&#8221; The <abbr title="Singluar 'schema'">schemata</abbr> define what attributes a given entry can have and how they&#8217;re validated, and LDAP client applications, in turn, often expect entries to obey a given schema. Because of LDAP&#8217;s X.500 roots, there are many schemata, and it&#8217;s not always clear which ones you need for a given task.</p>
<p>The tools around LDAP are the other main source of frustration. While Microsoft Active Directory and the Apple Open Directory tools are extremely high-quality management tools, they&#8217;re also relatively expensive and aimed at large deployments. The open-source offerings around LDAP are almost universally very open-ended LDAP frontends. If you&#8217;re lucky, they can be customized around however you&#8217;re actually using LDAP; if you&#8217;re not, they&#8217;re barely more useful than the command-line <code>ldap-utils</code>.</p>
<h3>In Practice</h3>
<p>Hacklab&#8217;s LDAP server doesn&#8217;t have to deal with filesystem mount points, shell accounts, Windows security domains, or any of the many other things that make ActiveDirectory and OpenDirectory so complex. Instead, the LDAP server is primarily for keeping track of logins for the various website: this blog uses it, as does <a href="http://trac.hacklab.to/">the wiki</a>. This means we&#8217;re free to use a fairly simple schema.</p>
<p>For users, we&#8217;re using <a href="http://www.it.ufl.edu/projects/directory/ldap-schema/oc-INETORGPERSON.html"><code>inetOrgPerson</code></a>, which requires very few fields (only <abbr title="Canonical Name"><code>cn</code></abbr> and <abbr title="Surname"><code>sn</code></abbr>), but allows many fields for identifying people. We also use the <code>userPassword</code> attribute to store hashed passwords, which apps check by attempting to bind to (log into) the LDAP server as that person. Groups of users are implemented as <a href="http://www.it.ufl.edu/projects/directory/ldap-schema/oc-GROUPOFNAMES.html"><code>groupOfNames</code></a> entries, which are barely more than a DN and a list of member DNs.</p>
<p>All of these structures are very simple and well-understood: <code>inetOrgPerson</code> and its parent classes define the attributes every address book application expects to find in LDAP address books, so the LDAP server could (were it public) be used as a Hacklab address book.</p>
<p>Integrating apps into LDAP was mostly very straightforward, but different apps have different ideas of what &#8220;integrated&#8221; actually means. Trac, out of the box, trusts whatever identity Apache passes it but handles authority roles internally. The plugin for pulling roles from LDAP hasn&#8217;t been updated in approximately forever, and doesn&#8217;t work with Trac 0.11. So, Trac roles are managed by Trac, and Apache only checks whether users are allowed to access Trac at all (and presents the login box). WordPress&#8217;s wpDirAuth plugin doesn&#8217;t handle role management at all, so WordPress also manages privileges itself, relying on LDAP for logins. WordPress also talks directly to LDAP, rather than using Apache&#8217;s LDAP integration.</p>
<p>The only real snag is user management, and I still haven&#8217;t found a good tool that doesn&#8217;t assume you&#8217;re running an enterprise with hundreds of users. <a href="http://members.hacklab.to/passwd/">The password page</a> is a PHP script I found while googling around that I vetted for security and installed, but for actually creating new users I&#8217;ve been relying on <a href="http://www.mcs.anl.gov/~gawor/ldap/">LDAP Browser</a>, which isn&#8217;t so much a user management tool as it is a generic LDAP query tool. Combined with some custom templates, it works, but it&#8217;s not hugely comfortable.</p>
<p>Using LDAP is not a magic bullet for centralizing identity data. However, it&#8217;s cut down on my own admin overhead for trac and the wiki, and it makes life easier for hacklab members by reducing the number of passwords they need to remember. I think it&#8217;s a net win.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacklab.to/archives/ldap-outside-the-enterprise/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

