Practical LDAP on Linux



Similar documents
The Integration of LDAP into the Messaging Infrastructure at CERN

Security with LDAP. Andrew Findlay. February Skills 1st Ltd

User Management / Directory Services using LDAP

Configuring idrac6 for Directory Services

Introduction to Linux (Authentication Systems, User Accounts, LDAP and NIS) Süha TUNA Res. Assist.

OpenLDAP. Linux Systems Authentication. Dr. Giuliano Taffoni IASFBO

Unified Authentication, Authorization and User Administration An Open Source Approach. Ted C. Cheng, Howard Chu, Matthew Hardin

LDAP Server Configuration Example

DB2 - LDAP. To start with configuration of transparent LDAP, you need to configure the LDAP server.

Introduction Installing and Configuring the LDAP Server Configuring Yealink IP Phones Using LDAP Phonebook...

The following gives an overview of LDAP from a user's perspective.

An Information System

Open Directory & OpenLDAP. David M. O Rourke Engineering Manager

LDAP Server Configuration Example

Integration with Active Directory. Jeremy Allison Samba Team

Ciphermail Gateway Web LDAP Authentication Guide

CA SiteMinder. Directory Configuration - OpenLDAP. r6.0 SP6

OpenLDAP Configuration and Tuning in the Enterprise

Linux Authentication using LDAP and edirectory

Using LDAP Authentication in a PowerCenter Domain

Integrating PISTON OPENSTACK 3.0 with Microsoft Active Directory

EVERYTHING LDAP. Gabriella Davis

SonicOS Enhanced 3.2 LDAP Integration with Microsoft Active Directory and Novell edirectory Support

FirstClass Directory Services 10 (Build 11)

Configuring and Using the TMM with LDAP / Active Directory

Creating an LDAP Directory

Samba and LDAP in 30 Minutes

Implementazione dell autenticazione con LDAP

Directory Solutions Using OpenLDAP

Active Directory and Linux Identity Management

SonicOS Enhanced 3.2 LDAP Integration with Microsoft Active Directory and Novell edirectory Support

GL-275: Red Hat Linux Network Services. Course Outline. Course Length: 5 days

Configuring Apache Web Server for x509 User Authentication

Oracle Communications Unified Communications Suite

Identity Management in Quercus. CampusIT_QUERCUS

MATLAB Toolbox implementation for LDAP based Server accessing

ENTERPRISE LINUX NETWORKING SERVICES

GL275 - ENTERPRISE LINUX NETWORKING SERVICES

Writing Access Control Policies for LDAP

User Management Resource Administrator. Managing LDAP directory services with UMRA

Authentication in a Heterogeneous Environment

ENTERPRISE LINUX NETWORKING SERVICES

System Authentication for AIX and Linux using the IBM Directory Server

Basic Configuration. Key Operator Tools older products. Program/Change LDAP Server (page 3 of keyop tools) Use LDAP Server must be ON to work

Oracle Net Service Name Resolution

UNIL Administration. > Many databases and applications:

"Charting the Course... Enterprise Linux Networking Services Course Summary

LDAP (Lightweight Directory Access Protocol) LDAP is an Internet standard protocol used by

Copyright 2016 Lexmark. All rights reserved. Lexmark is a trademark of Lexmark International, Inc., registered in the U.S. and/or other countries.

Securing SAS Web Applications with SiteMinder

Internet infrastructure. Prof. dr. ir. André Mariën

LDAP-UX Client Services B with Microsoft Windows Active Directory Administrator's Guide

Configuring the Cisco ISA500 for Active Directory/LDAP and RADIUS Authentication

Typical Directory Implementations at Institutions in Higher Education

Technical Bulletin 41137

OpenLDAP Software 2.4 Administrator's Guide

CN=Monitor Installation and Configuration v2.0

LDAP and Integrated Technologies: A Simple Primer Brian Kowalczyk, Kowal Computer Solutions Inc., IL Richard Kerwin, R.K. Consulting Inc.

Importing data from Linux LDAP server to HA3969U

Integrating AIX into Heterogeneous LDAP Environments

High-available Authorization and Authentication

Using LDAP with Sentry Firmware and Sentry Power Manager (SPM)

A Database-based System

Avaya CM Login with Windows Active Directory Services

Lab Tasks 1. Configuring a Slave Name Server 2. Configure rndc for Secure named Control

Authentication Integration

Directory Interface for User Management via LDAP BC-LDAP-USR 6.30 Test Catalog

LDAP Directory Integration with Cisco Unity Connection

How to Use Microsoft Active Directory as an LDAP Source with the Oracle ZFS Storage Appliance

How To Authenticate On An Xtma On A Pc Or Mac Or Ipad (For A Mac) On A Network With A Password Protected (For An Ipad) On An Ipa Or Ipa (For Mac) With A Log

prefer to maintain their own Certification Authority (CA) system simply because they don t trust an external organization to

Linux/Unix Active Directory Authentication Integration Using Samba Winbind

ProxySG TechBrief LDAP Authentication with the ProxySG

User Guide Self Service Password Reset April 2012

CDAT Overview. Remote Managing and Monitoring of SESM Applications. Remote Managing CHAPTER

LDaemon. This document is provided as a step by step procedure for setting up LDaemon and common LDaemon clients.

Cisco TelePresence Authenticating Cisco VCS Accounts Using LDAP

Configuring Sponsor Authentication

Directory Configuration Guide

Sample. Configuring the RADIUS Server Integrated with ProCurve Identity Driven Manager. Contents

How To Manage A Network On A Linux Computer (Vnx) On A Windows 7 Computer (Windows) On An Ipod Or Ipod (Windows 7) On Your Ipod Computer (For Windows) On The Network (For Linux)

LDAP Theory and Management

LISTSERV LDAP Documentation

Integrating Lustre with User Security Administration. LAD 15 // Chris Gouge // 2015 Sep

H3C SSL VPN Configuration Examples

LDAP and Active Directory Guide

Linuxdays 2005, Samba Tutorial

AD Schema Update IPBrick iportalmais

WirelessOffice Administrator LDAP/Active Directory Support

User Identification (User-ID) Tips and Best Practices

PriveonLabs Research. Cisco Security Agent Protection Series:

User-ID Best Practices

LDAP User Guide PowerSchool Premier 5.1 Student Information System

Transcription:

Practical LDAP on Linux A practical guide to integrating LDAP directory services on Linux Michael Clark <michael@metaparadigm.com> http://gort.metaparadigm.com/ldap/ Aug-23-02 1

Presentation Overview The need for LDAP LDAP Overview and Basics Setting up and tuning OpenLDAP Name services, authentication and authorisation Mail routing with sendmail and postfix Apache authentication Other LDAP tools and applications Aug-23-02 2

The need for LDAP Multiple disparate sources of the same information Users need separate logins and passwords to login to different systems Complex to keep information in sync Similar data spread around many flat files or in database with different formats Inadequacies of NIS ie. Not very extensible X.500 is too complicated Aug-23-02 3

LDAP Overview LDAP is a Lightweight Directory Access Protocol LDAP marries a lightweight DAP with the X.500 information model Uses an extensible hierarchical object data model An LDAP server may implement multiple back-ends : RDBMS, simple indexes (Berkeley DB), X.500 gateway Designed for frequent reads and infrequent writes Aug-23-02 4

LDAP Benefits Standardised schemas exist for many purposes (well beyond that of NIS) Allows consolidation of many information sources Well defined API, support from many applications Easily replicated and distributed Multiple backends allow integration with existing data sources (RDBMS, etc) Much faster than RDBMS (using lightweight backend like Berkeley DB) Aug-23-02 5

dc=com \----- dc=metaparadigm LDAP Basics ----- ou=people \----- uid=mclark \----- ou=groups \----- cn=users Data is organised into an hierarchical tree Each entry (tree node) is identified by a DN (distinguished name) e.g. uid=mclark,ou=people,dc=metaparadigm,dc=com Each component of a DN is called an RDN (relative DN) and represents a branch in the tree The RDN must be unique within the nodes at the same level of the tree (is generally equivalent to one of the attributes ie. uid or cn in the case of a person) Each node has 1 or many attribute values associated with it. Each attribute can have 1 or many values Aug-23-02 6

LDAP Basics (cont.) objectclass is a mandatory attribute which specifies the schema (attribute constraints) for the given node Multiple objectclass attributes can be combined together to achieve inheritance Example objectclass (common schema) attributes: dcobject, organizationalunit, person, organizationalperson, inetorgperson, inetlocalmailrecipient CN (Canonical Name) is another common attribute used to provide a unique name for a directory object Aug-23-02 7

LDAP Schemas Many standard schemas exist including: People schemas - person, organisationalperson, inetorgperson, posixaccount, maillocalrecpient, strongauthenticationuser Group schemas groupofuniquenames, posixgroup, organisationalrole, rolemember Host / Network schemas domain, iphost, ipnetwork, ipprotocol, ipservice, ieee802device, bootabledevice An invaluable schema repository from Alan Knowles at the Hong Kong Linux Centre: <http://ldap.akbkhome.com/> Aug-23-02 8

LDIF File format LDIF (Lightweight Directory Interchange Format) is used to import/export from a LDAP directory server dn: dc=metaparadigm,dc=com objectclass: dcobject objectclass: organization o: Metaparadigm Pte Ltd dc: metaparadigm dn: ou=people,dc=metaparadigm,dc=com objectclass: organisationalunit ou: people dn: uid=mclark,ou=people,dc=metaparadigm,dc=com objectclass: top objectclass: person objectclass: organizationalperson objectclass: inetorgperson uid: mclark cn: Michael Clark givenname: Michael sn: Clark o: Metaparadigm Pte Ltd userpassword: {SSHA}D3DT4BJyKicf+PJ1+eqkWMNRG/B28xt+ mail: michael@metaparadigm.com Aug-23-02 9

Custom schemas LDAP schemas uses SNMP style OIDs (Object Ids) for uniquely defining schema elements Apply for IANA enterprise number here: <http://www.iana.org/cgi-bin/enterprise.pl> Private enterprise number OID prefix is 1.3.6.1.4.1 eg. Metaparadigm uses 1.3.6.1.4.1.11137 Information on custom schemas can be found here: <http://www.openldap.org/doc/admin/schema.html> Aug-23-02 10

Linux LDAP servers OpenLDAP is the primary open-source LDAP implementation based on Univ. Michigan LDAP <http://www.openldap.org/> Sun provides the iplanet Directory Server Oracle provides an LDAP server using an Oracle database backend Many others available (Innosoft) Linux can also integrate with LDAP servers running on other platforms such as Microsoft Active Directory or Novell edirectory Aug-23-02 11

Scalability and Fault Tolerance OpenLDAP supports real-time directory replication to provide load-balancing and high availibility OpenLDAP supports single master, multiple slaves Most LDAP aware applications can be configured to use multiple LDAP servers (providing fallback servers) Multiple master support is in the works (currently alpha) OpenLDAP can be integrated with heartbeat and mon to provide fault tolerance <http://www.linux-ha.org/> Aug-23-02 12

Setting up OpenLDAP Configuration is located in: /etc/openldap/slapd.conf We need to include the schemas we are using include /etc/openldap/schema/core.schema include /etc/openldap/schema/misc.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema Next we specify a database database ldbm suffix dc=metaparadigm,dc=com" rootdn "cn=manager,dc=metaparadigm,dc=com " rootpw {crypt}mvrccd3ajnmf2 directory /opt/openldap/var/openldap-ldbm index objectclass eq Aug-23-02 13

Setting up OpenLDAP (cont.) We can now start slapd (Standalone LDAP daemon) # /etc/init.d/ldap start Next step is to add data to the directory using the LDIF example presented earlier # ldapadd -D cn=manager,dc=metaparadigm,dc=com -W < init.ldif Enter LDAP Password: xxxxx adding new entry "dc=metaparadigm,dc=com" adding new entry "ou=people,dc=metaparadigm,dc=com" adding new entry "uid=mclark,ou=people,dc=metaparadigm,dc=com" Aug-23-02 14

Tuning OpenLDAP We need to add additional indexes for performance index uidnumber,gidnumber,maillocaladdress pres,eq index cn,sn,givenname,memberuid,uid,mail pres,eq,sub We need to add ACLs for security access to attr=userpassword by self write by anonymous auth by * none access to dn="" by * read access to * by self write by users read by anonymous auth Aug-23-02 15

Tuning OpenLDAP (cont.) Setup logging in syslog.conf (default is LOCAL4) local4.* /var/log/ldap.log Make sure slapd runs as non privileged user Make slapd bind to SSL port for security need signed certificates with openssl and modify slapd.conf TLSCertificateFile /etc/openldap/ldap.metaparadigm.com.cer TLSCertificateKeyFile /etc/openldap/ldap.metaparadigm.com.key modify init script to bind to SSL port /usr/libexec/slapd -h 'ldap://ldap.metaparadigm.com/ ldaps://ldap.metaparadigm.com/' \ -l LOCAL4 -u ldap -g ldap Aug-23-02 16

LDAP Search Filters LDAP uses a simple search filters syntax (RFC2254) LDAP queries return all attributes of matching entries (or specifically selected attributes) which match the search filter LDAP query particles are enclosed within parenthesis in the form of ( attribute <matching rule> value ) ie. (cn=michael Clark) Matching rules include (=, =~, >=, <=) * can be used as a wildcard within the value These can be combined together using the boolean operators: and, or and not (&,,!) eg: (&(cn=michael Clark)(objectClass=posixAccount)) (&(objectclass=inetorgperson)(!(o=microsoft*))) ( (cn=michael*)(cn=mike*)) Aug-23-02 17

LDAP Search Filters The following example ldap search retrieves the names and email address of all users with a givenname of Michael or Mark # ldapsearch -LLL -h ldap1-prd -b dc=ofs,dc=edu,dc=sg \ '(&( (givenname=michael)(givenname=mark))(objectclass=inetorgperson))' cn mail dn: uid=mark_bergeron,ou=people,dc=ofs,dc=edu,dc=sg mail: mark_bergeron@ofs.edu.sg cn: Mark Bergeron dn: uid=michael,ou=people,dc=ofs,dc=edu,dc=sg mail: michael_chen@ofs.edu.sg cn: Michael Chen dn: uid=mclark,ou=people,dc=ofs,dc=edu,dc=sg mail: michael_clark@ofs.edu.sg cn: Michael Clark Very easy to incorporate this into shell scripts with awk or sed Aug-23-02 18

Unix Name service LDAP integrates with NSS (Name Service Switch) using the nss_ldap module <http://www.padl.com/oss/nss_ldap.html/> Requires configuration of /etc/ldap.conf host ldap.metaparadigm.com base dc=metaparadigm,dc=com ldap_version 3 binddn cn=manager,dc=metaparadigm,dc=com bindpw secret pam_filter objectclass=posixaccount pam_login_attribute uid pam_member_attribute memberuid nss_base_passwd ou=people,dc=metaparadigm,dc=com?one nss_base_group dc=metaparadigm,dc=com?sub Unix lookups are redirected in the same way as NIS: /etc/nsswitch.conf passwd: shadow: group: hosts: files nisplus ldap files nisplus files nisplus ldap files nisplus dns ldap Aug-23-02 19

LDAP authentication LDAP integrates with PAM (Pluggable Authentication Modules) using pam_ldap <http://www.padl.com/oss/pam_ldap.html> pam_ldap shares /etc/ldap.conf with nss_ldap.conf We create a pam definition file: /etc/pam.d/ldap-auth #%PAM-1.0 auth required /lib/security/pam_env.so auth sufficient /lib/security/pam_unix.so likeauth nullok auth sufficient /lib/security/pam_ldap.so auth required /lib/security/pam_deny.so account required /lib/security/pam_unix.so session required /lib/security/pam_limits.so session required /lib/security/pam_unix.so We point a services auth at LDAP eg. /etc/pam.d/imap auth required /lib/security/pam_stack.so service=ldap-auth account required /lib/security/pam_stack.so service=ldap-auth session required /lib/security/pam_stack.so service=ldap-auth Aug-23-02 20

Mail routing - sendmail We use the inetlocalmailrecipient schema which extends inetorgperson Additional attributes maillocaladdress, mailhost and mailroutingaddress. Users can have multiple maillocaladdress attributes. Allows for easily distributed multiple back-end mail stores Below are changes to sendmail.mc (tested in 8.11.x) define(`confldap_default_spec',`-h ldap.metaparadigm.com -b dc=metaparadigm,dc=com')dnl FEATURE(ldap_routing)dnl LDAPROUTE_DOMAIN(metaparadigm.com) Aug-23-02 21

Mail routing sendmail (cont.) Any sendmail map can be defined using LDAP. Example of custom alias map using 8.11.x (should also work on 8.12.x only official map schema support is available) LOCAL_CONFIG undefine(`alias_file') Kldapaliases ldap -z, -v mailforwardingaddress -k (&(objectclass=mailforwardingalias)(mailalias=%0)) O AliasFile=sequence:ldapaliases attributetype ( 1.3.6.1.4.1.11137.3.1.48 NAME 'mailalias' DESC 'alias part of address' EQUALITY caseignoreia5match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.11137.3.1.47 NAME 'mailforwardingaddress' DESC 'RFC822 address to use' EQUALITY caseignoreia5match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) objectclass ( 1.3.6.1.4.1.11137.3.2.49 NAME 'mailforwardingalias' DESC 'Internet local mail recipient' SUP top AUXILIARY MAY ( cn $ o $ mail $ mailalias $ mailforwardingaddress ) ) Aug-23-02 22

Mail routing - postfix Postfix documentation specifies a non-standard schema. Below example is implemented with same schema as sendmail. (change in /etc/postfix/main.cf) virtual_maps = ldap:metaroute metaroute_server_host = ldap.metaparadigm.com metaroute_search_base = dc=metaparadigm,dc=com metaroute_query_filter = (maillocaladdress=%s) metaroute_result_attribute = mailroutingaddress metaroute_domain = metaparadigm.com metaroute_bind = no Transport map can also be LDAP routed to provide mutliple backend support Aug-23-02 23

Shared Address book LDAP provides a convenient Corporate style shared address book similar to that of Exchange which is not otherwise available with standard Internet e-mail Support in almost all email clients: Evolution Mozilla Outlook Eudora Various web mail clients Aug-23-02 24

Apache Authentication 2 Apache modules available mod_auth_ldap apache module <http://nona.net/software/ldap/> auth_ldap apache module <http://www.rudedog.org/auth_ldap/> Example httpd.conf using mod_auth_ldap <Location /secret> AuthType Basic AuthName "Secret" AuthLDAPURL ldap://ldap.metaparadigm.com:389/ou=people,dc=metaparadigm,dc=com?uid require valid-user </Location> Aug-23-02 25

LDAP Browsers and Editors Java LDAP Browser <http://www.iit.edu/~gawojar/ldap/> Allows easy updating and editing of directory information. Can create templates for commonly used directory objects. Huge number of other tools (web, GTK, ) Aug-23-02 26

Migration to LDAP Padl migration tools <http://www.padl.com/oss/migrationtools.html> Migrates existing flat files or NIS databases passwd, group, hosts, networks, services, etc Aug-23-02 27

Other Application support Samba LDAP-PDC <http://www.unav.es/cti/ldap-smb-howto.html> LDAP DNS (no more HUPing named) http://www.nimh.org/code/ldapdns/ RADIUS (various patches floating around) Any application that supports PAM ssh, netatalk, many others Aug-23-02 28