Freeipa Introduction To Ldap
Freeipa Introduction To Ldap
INTRODUCTION TO LDAP
Florence Blanc-Renaud
January 2018
LDAP, AN APPLICATION PROTOCOL
LIGHTWEIGHT DIRECTORY ACCESS PROTOCOL
Suffixes
LDAP ENTRIES
NAMING
uid=admin, ou=people,o=ipaca
ATTRIBUTE SYNTAXES
Define the kind of information that can be stored in an attribute
ldapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )
MATCHING RULES
How to make comparisons against attribute values
matchingRules: ( 2.5.13.27 NAME 'generalizedTimeMatch' DESC 'The rule evaluates to
TRUE if and only if the attribute value represents the same universal coordinated
time as the assertion value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )
LDAP SCHEMA (2/2)
ATTRIBUTE TYPES
Define the attributes (name, syntax, matching rules)
attributetypes: ( 2.5.4.3 NAME ( 'cn' 'commonName' ) SUP name EQUALITY
caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX
1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'commonName' )
OBJECT CLASSES
Define collections of attributes: MUST = mandatory, MAY = optional
An object class can inherit from another object class: SUP = superior object class
objectclasses: ( 2.16.840.1.113730.3.8.4.14 NAME 'ipaEntitlement' DESC 'IPA
Entitlement object' AUXILIARY MUST ipaEntitlementId MAY ( userPKCS12 $
userCertificate ) X-ORIGIN 'IPA v2' )
objectclasses: ( 2.16.840.1.113730.3.8.4.4 NAME 'ipaUserGroup' DESC 'IPA user group
object class' SUP nestedGroup STRUCTURAL X-ORIGIN 'IPA v2' )
LDAP OPERATIONS
Extended operation: a generic op allowing to define new operations not described in the original
specification (for instance StartTLS, Cancel or Password modify)
Controls: appended to requests or responses, allow to modify the behavior (for instance Subtree
delete control, Sort request control...)
CLIENT TOOLS
COMMAND-LINE INTERFACE
ldapsearch
ldapadd
ldapmodify
ldapdelete
ldapcompare
common options:
-h host
-p port
-H URI
ldap://host:port
-D bind DN
-w password
GRAPHICAL TOOLS
anonymous
simple bind: username + password (-D / -w)
SASL mechanism:
external: authentication with a user certificate. Need to match the content of the certificate with
a user (-Y EXTERNAL, define $LDAPTLS_CACERTDIR, $LDAPTLS_KEY and $LDAPTLS_CERT)
GSSAPI: authentication with a Kerberos Ticket. Need to match the principal name with a user (-Y
GSSAPI)
other SASL mechanisms exist but are less frequent (anonymous, CRAM-MD5, DIGEST-MD5...)
LDAPSEARCH
accepts either a LDIF file containing modifications or reads operations from standard input
LDIF: LDAP data interchange format - RFC 2849
Example:
ldapmodify -D "cn=directory manager" -w Password -H ldap://host:port
dn: uid=jdoe,cn=users,cn=accounts,dc=example,dc=com
changetype: modify
add: description
description: This is the user entry for John Doe
Stored in /var/log/dirsrv/slapd-DOMAIN/access
Displays the connection established and the operations performed
corresponds to
ldapsearch -h localhost -p 389 -D cn=directory\ manager -w Secret123 -b "" -s base
namingcontexts
ACCESS CONTROL
linkedin.com/company/red-hat twitter.com/RedHatNews
facebook.com/redhatinc plus.google.com/+RedHat
youtube.com/redhat