Pain-free ldap scenarios

26
Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz Page 1 of 26 Plone Conference 2010 Bristol Pain-free ldap scenarios Florian Friesdorf <[email protected]> Munich, Germany 2010-10-28

description

 

Transcript of Pain-free ldap scenarios

Page 1: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 1 of 26

Plone Conference 2010Bristol

Pain-free ldap scenarios

Florian Friesdorf <[email protected]>Munich, Germany

2010-10-28

Page 2: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 2 of 26

Overview

● What is LDAP and how do users and groups look in there

● The current stack of libraries for LDAP in Plone● Our goal and principles● Our tools● Current status● Outlook

Page 3: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 3 of 26

LDAP, a tree

● basically an object database● tree structure● every object has attributes● every object may have children● slow in writing, but fast in searching● indices for selected attributes

Page 4: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 4 of 26

LDAP, a tree

● every object has– objectClasses defining possible attributes

– attributes

– children (optional)

● schemas define objectClasses and attributeTypes

● three scopes:– BASE: the entry itself

– ONELEVEL: all children of the entry

– SUBTREE: the entry and everything beneath

Page 5: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 5 of 26

Example LDAP user

dn: uid=hagbard,o=LDD

uid: hagbard

objectClass: person

cn: Hagbard Celine

sn: Celine

userPassword: haileris

password normally encrypted

Page 6: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 6 of 26

Groups in LDAP

● membership information on the group– OpenLDAP (core.schema)

● membership information on the user● membership information on both, redundant

– ActiveDirectory, OpenLDAP (optional)

● membership information on both, not redundant– POSIX: OpenDirectory, OpenLDAP (nis.schema)

Page 7: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 7 of 26

Membership info on group

dn: cn=lieferickson,o=LDD

cn: lieferickson

objectClass: groupOfNames

member: uid=hagbard,o=LDD

member: uid=howard,o=LDD

Page 8: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 8 of 26

Membership info on user

dn: uid=hagbard,o=LDD

uid: hagbard

objectClass: person

cn: Hagbard Celine

sn: Celine

userPassword: haileris

memberOf: cn=lieferickson,o=LDD

Page 9: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 9 of 26

Membership info on bothnon-redundant

dn: uid=hagbard,o=LDD

objectClass: posixAccount

uidNumber: 17

gidNumber: 42

dn: cn=lieferickson,o=LDD

objectClass: posixGroup

gidNumber: 42

memberUID: 91

memberUID: 113

Page 10: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 10 of 26

Current LDAP stackand related

● python-ldap, dataflake.ldapconnection, dataflake.cache

● PloneLDAP / LDAPMultiPlugins / LDAPUserFolder● PlonePAS / PluggableAuthServices● plone.app.ldap● PASGroupsFromLDAP (posix groups based on

bda.ldap)

Page 11: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 11 of 26

python-ldap, dataflake.connection

dataflake.cache● low-level python ldap library● basic connection management● ldapadd, ldapdelete, ldapmodify, passwd● search, authenticate● synchronous and asynchronous operation

dataflake:● enhanced connection management/caching● unicode instead of utf-8

Page 12: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 12 of 26

PloneLDAP, LDAPMultiPlugins,

LDAPUserFolder

LDAPUserFolder– acl_users implementation of former times

– builds on dataflake.ldapconnection/cache

LDAPMultiPlugins– PAS plugins specific to ActiveDirectory and OpenLDAP,

no posix support (OpenDirectory)

– uses LDAPUserFolder to access LDAP

PloneLDAP– wrapper for LDAPMultiPlugins

Page 13: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 13 of 26

PlonePASPluggableAuthServices

PASGroupsFromLDAP

PluggableAuthServices (PAS)– acl_users implementation nowadays

– supports plugins for users, groups, rols, properties, session management

PlonePAS– massive monkey patch for PAS

– aware of PloneLDAP, monkey patching it if present

PASGroupsFromLDAP– support for posix groups, parallel to ldapmp

Page 14: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 14 of 26

plone.app.ldap

● genericSetup profile to wrap installation of all above

● plone control panel integration for configuration of default setups

– baseDN

– uid attribute, rdn attribute,

● for everything else → ZMI, with potential for conflict

Page 15: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 15 of 26

Current LDAP stackwrap-up

● too many packages with no clear borders● close to zero test coverage (except dataflake

packages)● caching on 5 levels

– PAS

– LDAPMultiPlugins

– LDAPUserFolder

– dataflake.cache

– python-ldap

● too complex

Page 16: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 16 of 26

Goal

Make LDAP simple:● for the developer● for the inegrator● for the system administrator

Page 17: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 17 of 26

Principles

● (LDAP) usermanagement is not specific to plone and should be realized independent of plone

● minimal code for plone integration● no ZMI● loadable presets for default setups● support whatever LDAP supports● ldap is a tree, so should our abstraction of it be● full test coverage

Page 18: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 18 of 26

Our approach

● enhancement of python-ldap● Node-based tree representation

(bda.ldap/zodict)● Node-based user management (bda.ldap),

independent of plone● glue code PAS plugin, just for API translation● Plone integration (generic setup, config views)● bfg user management UI, also based on the

node-based user management

Page 19: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 19 of 26

The nodes

→ python shell (bda.ldap fun)● LDAPNode with attributes and children● ONELEVEL vs. SUBTREE● AliasedNodespace● User/group node adapter● User/group folder node adapter

Page 20: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 20 of 26

Plone integration

● PAS plugin that maps PAS plugin API to the API of the outside user management API (bda.ldap)

● generic setup profile to install the plugin● plone control panel views for persistent

configuration– how to connect to ldap

– how to find users and how to create one

– how to find groups and how to create one

Page 21: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 21 of 26

bda.bfg.ugm

● repoze.bfg application to manage users● one dedicated application to manage users for

multiple plone sites● enable users for sites● assign to global groups● assign to site specific groups● define global roles per site● first stage suitable for up to 2000 users

Page 22: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 22 of 26

bda.bfg.ugm

● node-based data model (bda.ldap)● node-based application model● direct rendering of UI on nodes● new form library (yafowil)

Page 23: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 23 of 26

Statusbda.ldap

● ldap node – fully functional● ldap filter abstraction – fully functional● aliasing of attribute names – fully functional● user node adapter – fully functional● group node adapter – work in progress

Page 24: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 24 of 26

bda.pasldapbda.plone.ldap

bda.bfg.app● bda.pasldap

– users readonly for hardcoded config

● bda.plone.ldap– plugin installation – fully functional

– users readonly for hardcoded config

– configuration views – work in progress

● bda.bfg.ugm– work in progress

Page 25: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 25 of 26

Outlook

● user management via bfg application + full plone support (end of 2010)

● group management via bfg application + full plone support (February 2011)

● no schedule– group in group support

– further backends (sql)

– adapt UI too seriously many users

Page 26: Pain-free ldap scenarios

Creative Commons Namensnennung-Keine kommerzielle Nutzung-Keine Bearbeitung 3.0 Österreich LizenzPage 26 of 26

The End

Questions

Answers

Discussions