My colleague works at One Secure, and he's going to talk to you about LDAP. Hi. Just to give you a background about me, some of you may know me as XS. You can call me Greg, whichever you want. I work with Pete at a security vendor of sorts in the Bay Area. I'm a security engineer over there, so I don't really work with LDAP every day. A little bit of my background with LDAP is when I was first brought on board, I was asked to implement a new mail and user system, and I was looking at a couple different options, either like a SQL backend or a virtual user backend, and I kept hearing things about LDAP, and I'd never used it before. So I figured, eh, let's see what I could use it for. And it turns out my favorite MTA, Qmail, has a patch for it called Qmail LDAP, which lets you use a LDAP backend for user authentication, aliasing, et cetera. That's pretty much how I picked it up. Unfortunately, the project I was working on was kind of canceled. So I had to go back to Qmail LDAP, and I had to go back to Qmail LDAP, and I haven't had much other implementation work with LDAP aside from that. So that's about where my knowledge ends. But what I've done is I've tried to get as much research on LDAP as I can find in RFCs and associated facts and online documentation so that those of you who haven't heard of LDAP or X500 or any directory access protocol can walk away from this, at least knowing what it is, knowing what you can do with it, and hopefully wanting to go back and learn. I did have some pretty slides and such for you, but seeing as I can't get internet access, we're going to go with text and e-terms. So you'll have to look at my ASCII diagrams. So with that, feel free to ask me questions anytime. Just let me get through this spleel I wrote in a paper, and then you can just hammer me away. I have no intention of this being long-winded or taking all day or anything. So as soon as you feel like you're going to be able to do this, if you feel like you don't have any more questions, just get the hell out of here. If you have any LDAP 3 questions, there's someone else in the room that can help you out a little more with that, but we'll get into that in a little while. LDAP, Lightweight Directory Access Protocol. It's an open standard alternative to X500 directory access protocol. X500 is a directory access protocol first approved as a standard in 1988. It was maintained by the ITU, International Telecommunications Union, which released an enhanced version in 1998. In 1983, X500 uses the OSI network stack instead of TCP, IP, UDP, et cetera. Not many of us use that anymore. A directory. For those of you who don't know what directories are, the intent of the directory was based on the fact that human users must be able to look up assorted information about other people. Email addresses, mailing addresses, telephone numbers, fax numbers, birth dates, spoken languages, et cetera. Computers need to be able to look up addresses for various services. Passwords for users, user IDs, permissions, file system information, mount points, remote hosts, et cetera. A lot of the time you think, why not just use a centralized database for all this information? The problem comes in because most centralized databases are big enough and comprehensive enough to cause slowdowns during peak query times. And because of their centralization, they're usually isolated on very inefficient high availability networks or the simplest thing could just make them unavailable to any other networks. More on that, the administration of these databases is usually also centralized. Often this means that there's a long turnaround time between when you want changes done and when changes are done. Often called passing the buck. There's another similar way of, of, of distributing this information and it's DNS, Domain Name Service. DNS is maintained in a distributed fashion like LDAP, where each DNS server provides name servers for a limited number of domains. And along with that, servers are often identified, but backup servers are often identified for domains. So that in case of failure of a primary server, hosts won't lose name servers. Simple enough. There's some problems with DNS though. DNS has very limited search capabilities. And the fact that it provides, it provides very few data types. Data types in A records, PTR records, C names, different types of records you can associate with the actual names you're hosting. And adding new names involves widespread implementation changes. You know, I can't just go out tomorrow and create a new record type and expect everyone else to be able to read it without everyone else changing what their name server is. does um solution to this ldap provides decentralized maintenance meaning that each site running ldap is responsible for its part of the directory so that maintenance and updates can be done instantaneously and easy you know if i want to make a change to my local company's database i don't have to go you know i don't have to call i don't know washington to get them to change the database and then wait for the changes to sync all the way back to me i make it locally they see it over there as easy as that um it has extremely powerful searching capabilities not exactly all regular expression style but very similar and you can construct just extremely complex queries uh to search ldap databases or excuse me not databases directories is the correct term uh the definition of how it stores data is actually stored inside of it so if you want to make a change to how it stores data say um you want to add a new type of record uh favorite topping on pizza you don't have to go out and change the actual implementation you just add it to your directory and people remotely can't see it unless they add it to their directory and it doesn't affect them it doesn't affect you because they can't see it it's just something you've added to your database they can sync it up to theirs you can sync it up to theirs whichever as its standard based it's very very very easy to build applications which use directory service email servers automated resource locators other special purpose tools regardless of where they are what they're running on or what what they're running for an ldap implementation also because of standard base there are few incompatibilities between different different implementations once you start using it you'll see that's a little wrong but because it's it's based on a standard they're supposed to be all the same but you know one has an api that allows you to do this a different one has an api that allows you to do that so it gets confusing when you start running software for it um and it can be accessed by most information in one implementation can be accessed from another implementation without much headache uh most of the time problems with ldap oh start over excuse me uh searches searches in ldap can span more than one ldap server meaning that they're gonna have to cross network boundaries and a lot of implementations cache all this information that that it goes out and requests from a remote server and this usually slows down the response time in queries it's not as true anymore with people getting larger and larger servers and you know more and more bandwidth but um the that was one of the slowdowns and why you haven't seen ldap deployed everywhere yet um security configurations are another uh problem with ldap a lot of the security configurations allow a limited number of query returns when you uh query ldap uh you may seek you know something like everyone named bob and you may get a hundred results uh but the security restrictions on the server may only restrict you to seeing 10 results uh these are all stuff that can be leaked but it requires a lot of work on the user end if it's not set up correctly to begin with some examples of directory service in case you still haven't caught on uh phone companies 401 or directory service uh excuse me directory assistance um it's provided by all the baby bells or all the ilex and all the clex um they keep an electronic list of all the then you know everyone has a phone line their names their addresses their phone number um you call up give them the name give them the address to give you the phone number um it's also available on the phone book the problem with that is if uh if you you need the city they live in excuse me it's hot as hell in here uh and their name now if you return more than one name say two names there's really no other way to limit down who's who it's a limit of the an example of another directory service um in addition the information they may have in there could be from two weeks old in the electronic version to up to a year old in the phone book so not much they could do about a phone book that's sitting in your house other than sending you another phone book pretty inefficient um another problem with that is if i want to look up the number of someone in atlanta for example i have to call a directory service in atlanta i can't call my directory service so another limitation of this directory service or excuse me directory assistance how directories are broken up entries are primarily constructed holding information in a directory an entry would be a entry for a user for example or a person each entry contains information about an object an object would be telephone number favorite topping on pizza uh spoken language mailing address email address those are examples of objects in ldap each of these has a collection of attributes for them or syntax for attributes for them for example telephone number can only contain numerics your surname can only contain contain alphanumeric characters there's some other ones that you know photo data time code different types of syntax you can stick on attributes boring stuff security in ldap ldap by default is extremely lax when it comes to security it's not much more secure than any default installation of your favorite os pick whatever it is excluding windows just never secure securing it requires much administrative intervention so it's not something you could plug and play and hope no one owns it access control lists are built into ldap you just have to have to know how to use them and you have to use them each attribute or each object of a given entry entry being a person for example can be permitted detect compare read modify permissions based on the reader's membership in various groups for example if someone wanted to look me up and get my phone number my ldap server can restrict them from seeing my phone number they could see that i exist they could compare my password against another password if i allow them to do that they could get my address but i could restrict them from seeing my phone number or it could be the other way around i could let them only see my phone number and see that i exist um so that's what they what's that's what i mean when i say compare read and modify compare would be just compare two entries uh does he you know is greg in the ldap database yes greg's in the ldap database for example um you can also specify information given to the public so that anyone can read it the same way um you know if i just want them to have my phone number a pretty cool security feature of ldap is when if you're using it for user authentication is the user password object which stores user passwords of course uh syntaxfist allows you to store it in plaintext unit script md5 sha and cd md5 or sha which is pretty cool considering um say i'm running a free bsd machine and i um i want to authenticate my linux users off of it and i'm running ldap for authentication i can use any of these schemes sha md5 unix crypt and it doesn't matter what platform i'm using it's all based in ldap so i can go from sys5 to bsd without having to worry about going between md5 and crypt um some common uses ldap email servers not all mtas but as far as i know most mtas have either patches or come default with support for ldap that allows uh control of addressing aliasing forwarding uh and another example of this is qml ldap um uses user it uses ldap to look up user information and then uses the return information to process messages um let's say it's having to add you know users to a mail server just to get them to receive mail you stick it in the ldap database and you're set you don't have to add anyone to the machine kind of like virtual users with any other mta except you're doing yourself a favor by putting them in ldap um the patch for qml that i was referring to earlier will also do authentication for you know if you want to pop in and get your mail or i'm at the end and get your mail um you can use the authentication scheme in ldap on a variety of platforms uh use the using LDAP as the transport, but there's also PAM LDAP modules. Solaris comes with PAM support. If you wanted your Solaris machine to start authenticating off an LDAP server, you would just stick a PAM LDAP module on there in your set, or your Red Hat machine, or whatever you have PAM compiled on. Employee listing and automation is another use for it. Very similar to what Netscape uses. Netscape's, well, last time I read, Netscape's corporate network was based on LDAP. It basically meant HR hires a person, they add them to the database, and instantly they're on the contact list, on the phone list, in the mail server. They have an account to dial up and do whatever. All just by adding one entry. That's where the centralization comes in. But, it's not limited by centralization. I'll get to that. LDAP can be used as an NIS replacement, which I'm very happy about. There's some plug-in replacements which are written by the guys at paddle.com, P-A-D-L dot com. One of their products is called YPLDAPD. And what it basically does is, if you say you have an existing NIS server and you want to replace it with an LDAP server, but you have machines on the network that don't support LDAP, you can stick YPLDAPD on there to answer NIS's queries from the LDAP database. That way you can start sticking access lists on there and use the LDAP database for other things on your network. Pretty easy to implement, too. I've done it a couple times. They make another software product. These are all free products, by the way. I don't recall what the name is. It's available from the same people. And what it does is, it acts as a object that you stick in. It's in Solaris. It's lib. It's security. User lib security. It's a YP object that you stick in there that, instead of going to an NIS server, it will just automatically go to an LDAP server. Save you tons of trouble. And with an infrastructure like this, it's pretty easy to roll it out network-wide without anything hiccuping or anyone dying coming in the office with a gun and killing you or anything. And it allows for replication and authentication across your network. I'm going to throw out a few examples of some software and some products that use LDAP. Netscape's got a really nice LDAP server. It's called iPlanet directory server now. There's some... Most Cisco hardware nowadays supports LDAP. Bay Network sells some stuff that supports LDAP. It's rolling out at a very fast rate. That was the paper I've written. I hope it's answered some of the questions you have. I also have some diagrams I'll show you. Maybe this will help you out if you don't understand yet. But if you guys have any questions, just start firing away. Hit me. What's a good open source LDAP server? Open LDAP. That's all I've used. I swear by it. It's free. Be careful with the documentation. It's... You've got to look through their fax system. They have one of those automated fax systems. It gets a little confusing. It's confusing at times. But all in all, it's a pretty hardcore server. I've used it on a variety of platforms. Linux, FreeBSD, Solaris. So that's my favorite. They're at openldap.org. How do the directory servers communicate with each other? How do they communicate with each other? If you're spanning more than one directory server? I don't remember. Yeah, Lito. He wants to know, how servers, if they're spanning a network, authenticate against each other. So it doesn't think that it's just a user going out and trying to pull information. It's built into the protocol to replicate against servers. And in the comp files on each slave server, you have the root or manager account that can look into the whole server. And you can have that in your password that you want. S-H-A-A-N-D-B-I-Z-W-E-E-S authenticate as a regular user to the slave server. Sounds about right. Lito knows a little bit more about LDAP3 than I do. There you go. Safe pages? Is it based off UMichigan? Yes. Okay. That reminds me. Another open one. University of Michigan. Let me give you the URL for that because it's kind of convoluted. Yay. Nope. I'll pull that up for you. Any other questions? Go ahead. Can you run regular NIST services? And LDAP3 is on the same machine in the gravity library? I wouldn't. Well, if I were rolling it out, I would have two separate machines simply to minimize the confusion involved. You could. It's not going to hurt anything. It's just a matter of maintenance versus confusion. The YP or NIS LDAP implementations are pretty easy to set up. Once they're set up, it's all a matter of maintaining the LDAP server. Try not... What's up? I don't think so. I'm talking about migration rules. I think it will take XT password, XT shadow, group, all your down points, and you can modify it to your other directory or add it with LDAP, add it with LDAP. So, let's say, you want to... And then I have to read that as a flat file and create an LDAP. There we go. LDAP, LDAP, LDAP, LDAP, or they use the LDAP app at the bottom of certain runs. And then you can... When I was on the phone, even though they have a one-hour, half-an-hour update with your LDAP server, NIS, because I have all the machines that are located in the LDAP NIS, you can go to the panel. Yeah. PA... Oh, excuse me. I spelled that wrong. Dyslexia sets in. Yeah. Any other questions? Go, dude. When you use LDAP... Well, you did out-add the root DN first. The very first entry in the DAP role in the creation of the stuff. Mm-hmm. Is that where it's in the file? The... When you're adding it the first time or where it is in the slapd config? I'll mention slapd.com. Okay. I'll mention that the very first time that I did it in slapd.com. And then I tried to run the LF add to add a user and it didn't work. Mm-hmm. You have to add... You actually have to add the root DN first. Oh. It's not documented and, you know, it may not be something you always have to do, but I've always had to do it. You have to add the root DN. You do the same thing when you're adding a user. You just add the actual... So, like, if you're... If your organization equals DEF CON, you know, and your country equals US, you add that first and then add users underneath that. Okay. You don't use it. It'll give you like, you know, the means. Oh, you need to use that for the authentication. I can't even do that. Hmm. Catch me later. We'll take a look at it on here. Do you know when you did this for LDAP or organizing your data for LDAP? In the LDAP... For LDAP or prior to LDAP? Like, where are you going to show people where you're going to do this? The RFCs. Let me show you the RFCs here. There's a couple of them. These are the RFCs you want. Oops. Right there. Right there. A lot of the earlier ones in here are X500 RFCs. The later ones are LDAP3 RFCs. But everything in between will help you organize it. You'll see how other people have done it. Another good example is if you look at some of the facts on these pages here and see how they've laid it out. It's a good indication on how to do it. It's pretty straightforward. When you add users, you know, you add them as people. When you add computers, you add them as computers. It's pretty tough. to confuse yourself when you do it. Except with the number of options you have, the number of objects you have. Think of anything you've used. Lito? That's probably a good start. There was one I was using for a while. Net LDAP. There's another one. It's Simple LDAP. Administration Tool. It's S-L-A-T-K. Check out FreshMeet also. Do a search for LDAP. There's quite a few front ends. That's another problem, actually, with some of the open or free LDAP servers is that they don't come with a front end. So you're going to have to do it all by hand unless you go out and either write a front end or download a front end. Yeah. That's the advantage of the commercial servers versus the free servers. You have a front end to do everything in. I haven't implemented that before. It's SlurpD. It uses SlurpD. I'm not sure what port it runs on. But you run a replication server. Well, not actually, not if you're replicating. If you're just running flat LDAP between servers, it's still LDAP. It just goes out as a user. That's what we were discussing before, how it authenticates. Yeah. It's X500, which was the predecessor to LDAP ran on the OSI network stack. LDAP runs on TCP IP. Let me see what port it is for here. Yeah. That's SSL LDAP. I don't recall which port it runs on. 389? There you go. 389. You've all met the rules of LDAP. Yeah. What's the most common version of LDAP that's used in most operations? Is it much LDAP 3 out there? That's the LDAP 3 master over there. LDAP 3 is the most common version. Yeah. Most of the, well, you've got, okay, there's a couple of examples of LDAP ripoffs or similarities. Notes uses, I think, X400, X500. For the back end. Active Directory from Microsoft, similar to LDAP. NDS from Novell, similar to LDAP. We were actually talking one day about using an Active Directory server for an LDAP back end with the NIS module for Solaris to use a 2000 machine to authenticate a Solaris machine. We never got around to that. Would have been kind of cool. Well, we know that that's the forward version 3, so that's what we're going to do. The UMichigan URL is right here. LDAP, ITD, UMich. OpenLDAP is based off of that, and there's a little more, there's more developers on the OpenLDAP team. I would stand behind them more than the OpenLDAP team myself. I think you have kind of a hierarchy between servers. You say you've got a server A and C, but you said the only other thing where it is is a server A. If they didn't have the information you can't afford the request to use the server A. That's exactly how it works. That's exactly how it works. It's awkward. Yeah, it's just on the server that you're querying, it needs to have other servers to find. It needs to know where to look for the other objects that you want to grab. It's not as bad anymore. If you're running huge, huge queries, you're going to see slowdowns. But, you know, everyone's running their LDAP servers in like 450s and craps. You're not going to have a problem. We have a question here. Do you have a shop on the LDAP market? Did you actually use the LDAP support to use the information? So, if you do that on the LDAP, can you find an IMAP? How do you do an LDAP watch IMAP from the time you do an IMAP? Well, Courier IMAP, which Inter7 is now maintaining, supports LDAP for authentication. So, I had all the user's information stored in LDAP. Yeah. Someone back there had a question. What firmware database is not recommended for LDAP? SleepyCat? SleepyCat is what they roll out with and they suggest that you use. That's all I've ever used. SleepyCat DB. SleepyCat Berkeley DB, excuse me. What's the maximum use of LDAP support? And the second question is, what's the largest implementation you've seen as far as your number алась? Netscape. Corporate. 411.com. 411.com. So, what if we're talking to those services and they don't see us today and turn to internet The security of it versus Active Directory or NDS? I don't even know yet. It was just an assumption. It's passing clear text by default. So you'd want to use LDAP SSL. And since you're authenticating off an Active Directory server, again, not that we know that it's possible or not, you don't have SSL support. It's all in transport. It's not that much different from using RADIUS, except that RADIUS has to do everything before it sends it. So it'd be what's actually on your network that you need to worry about. As far as the machine, the access lists are what you want to set up to allow people on your network to access your network. So you don't have to either just compare passwords, just get usernames, user IDs. I haven't done that, so I can't really comment on what you can do with it. I'm sorry, dude. I can't hear you. Oh, a lot of bugs in LDAP. Yeah, documentation. The first bug. Lack of any knowledge amongst network administrators about LDAP. Most of the bugs are just user-created. Just lack of knowledge, or no one's ever used it before. That or confusion. When you set it up for the first time, you're going to be really frustrated, just like anything else. The first time I set it up, I'm like, what the fuck? Just use SQL or something. But after a while, I realize, okay, I see where this fits in. I haven't run into any major bugs. That's easy, though. Because you dump it to an LDF, pull out what you don't want, and then dump it back in. I mean, I would... You'd think. That's a way I've found to fix the database a lot of times. Just dump it to an LDF, pull out what you want, and then dump it back. Anyone else? He was talking about corruption in databases. Yeah. I had problems when you set it up for replication. The corruption did not work at all. And then I just dump it to LDF and put it back in. Yeah. LDF is the... It just dumps... See the format I have here on the command line? It just... It just basically dumps the database back to that format out of the DB format. So you can go in there and modify it or replicate it, back it up, show it to your friends, tattoo it on your back or something. Would you rather have an LDF server on, say, a DMZ, if you're kind of, say, a database, but I mean, I mean, how secure are the servers? Not very. Out of the box. Well, the problem you're going to run into is if it's on your DMZ, and someone knows it's there, they're going to be able to query it for certain user information. But if you have it on the DMZ specifically for a few machines on the DMZ, you can have it post simply what it needs. You can have it post the portion of the directory that it needs. So if... I don't know, say you have a list of all your clients for your web servers in the LDF server, you can have the one on the DMZ hold only that and have it replicate or work with an internal LDF server. You can use ACLs also. Yeah. You can make it so that the user is the only person that can see their own password. So when they use it, they can see their name and their whatever, but only to know what attributes they didn't see. So they can only write to their own password. So if you compare it to LDF, when it gets to TACACS plus, how do you think it will... I haven't used TACACS before. Actually, I have to as soon as I get back. I think... Play with TACACS. LDAP versus RADIUS. I was bored a long time ago. And I wrote a QML backend in Perl that used RADIUS for authentication and user information. And it's pretty convoluted to use RADIUS to store real names, forwarding addresses, mailboxes, pictures of people, what languages they speak. I think it should stick only to doing authentication with RADIUS. Authentication. And pulling down, you know, network information, not ROS and NAS information. Okay, authentication. You have the benefit with RADIUS because more stuff supports it right now. Just getting to that. Authentication. Accounting was one of the ones you mentioned. And authorization. Authorization, you're going to win with LDAP every time. You could say, you know, you can... If you're running the NIS backend with LDAP, you can have it do everything on your machine. So you're going to have the benefit there. And it can be distributed, too. You know, RADIUS, you can do the whole... What is it called? Realms with RADIUS. But you're still limited to the... Authentication. You can't store as many objects in RADIUS. So authentication, you're probably going to win with RADIUS if that's all you want to do. Is that answer your question? Convoluted enough? Maybe you can flag me down later and hit me or something. Anyone else? Did I bore you to death enough? Okay. My... You can... I'll have slides for you, which weren't here today. You can get them here. I'm going to write them down. I'm going to write down the URL. Or you can email me. It's my email address. Always around. Always available. If you see me here at cons, just run up to me, ask me a question, whatever. I'll either avoid the question or deny it. That's been LDAP. That's what I know. That's what you know now. Hope you enjoyed it. Thank you. Whatever. Whatever.