Open Source


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Open Source

  1. 1. <ul><li>Open Source </li></ul><ul><li>Lightweight Directory </li></ul><ul><li>Access Protocol </li></ul>
  2. 2. Interoperability with Windows and Unix/Linux <ul><li>A hot topic in enterprise networks where unique O/S is not always possible </li></ul><ul><li>Authentication is a major concern to provide users the keys to get on the network services running on different O/S </li></ul><ul><li>Older Windows authentication used NT authentication (LM (Lan Manager), NTLM and NTLM2 protocols) </li></ul><ul><li>Modern Windows uses Kerberos with user information stored in Active Directory for centralised authentication </li></ul><ul><li>Unix/Linux traditionally store accounts and passwords locally in a file called /etc/passwd and /etc/shadow </li></ul><ul><li>/etc/shadow contains the hashed password plus information about when the password will expire </li></ul>
  3. 3. Centralised Authentication - Linux <ul><li>Linux provides a shared networked alternative to /etc/passwd files. Options are </li></ul><ul><li>NIS </li></ul><ul><li>OpenLDAP </li></ul><ul><li>Samba </li></ul><ul><li>Kerberos </li></ul>
  4. 4. NIS (Network Information Service) <ul><li>NIS – originally designed by Sun Microsystems helps centralise accounts by looking up passwords stored on master and secondary servers instead of on local machine </li></ul><ul><li>NIS is not hierarchical – there is not efficient way to examine for instance only the users in the marketing department </li></ul><ul><li>NIS has difficulties working through a firewall </li></ul><ul><li>Subject to many network security problems </li></ul><ul><li>NIS+ attempts to solve some of these problems – some support for hierarchical structure and security protections are added (not included in Fedora) </li></ul>
  5. 5. OpenLDAP <ul><li>Provides directory services to Unix clients </li></ul><ul><li>Hierarchical – potentially a better choice than NIS when a large number of accounts is involved </li></ul><ul><li>Much easier to pass through a firewall than NIS </li></ul>
  6. 6. Samba <ul><li>Samba 3 allows a Linux machine to pretend to be a Windows file server, print server or NT4 Primary Domain Controller (PDC) or Backup Domain Controller (BDC) </li></ul><ul><li>Samba 4 pretends to be an Active Directory Domain Controller </li></ul><ul><li>Samba store accounts centrally in its own database or in an LDAP database and then Windows users can authenticate to Samba </li></ul>
  7. 7. Kerberos <ul><li>Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using symmetrical key cryptography and and requires a trusted third party (timed ticket). </li></ul><ul><li>Both Linux and windows clients and servers can use Kerberos to authenticate logons </li></ul><ul><li>Kerberos is not a directory service, its task is to authenticate user identities, not to store information such as user and group IDs </li></ul>
  8. 8. Centralised Authentication - Windows <ul><li>Microsoft Windows Services for UNIX SFU 3.5 – Interoperability Toolkit from Microsoft enables Windows and UNIX clients and servers to share network resources, integrates account management, simplifies cross-platform management and provides a full UNIX scripting and application execution environment that runs natively on Windows </li></ul>
  9. 9. Integrated Authentication for Network Resources <ul><li>As number of enterprise users increases, account management is becoming more complex. </li></ul><ul><li>Imagine how many passwords an user has to remember if he has to access several servers POP3, Webmail, FTP server etc. besides system login. </li></ul><ul><li>System Administrator has to notify all users in case passwords and permission of each service have changed. </li></ul><ul><li>LDAP Directory Services can help to simplify account and password management. </li></ul>
  10. 10. What LDAP Can/Cannot Do <ul><li>LDAP provides central management of access, authentication and authorization. </li></ul><ul><li>What LDAP can do: </li></ul><ul><ul><li>Centralize users and group management </li></ul></ul><ul><ul><li>Centralize information stores </li></ul></ul><ul><ul><li>Set security and access control </li></ul></ul><ul><ul><li>Securely delegate read and modification authority </li></ul></ul><ul><ul><li>Serve almost any platform </li></ul></ul><ul><ul><li>Scale efficiently </li></ul></ul><ul><li>What LDAP cannot do: </li></ul><ul><ul><li>Be a heavy-duty relational or transactional database </li></ul></ul><ul><ul><li>Be a file system </li></ul></ul>
  11. 11. Is LDAP a Database or Not? <ul><li>LDAP – Lightweight Directory Access Protocol - is a protocol, not a database. </li></ul><ul><li>It accesses a special kind of database that is optimised for fast reads </li></ul><ul><li>Use it for relatively static information, such as company directories, user data, customer data, passwords and security keys </li></ul><ul><li>OpenLDAP uses the Sleepycat Berkeley DB </li></ul><ul><li>It is not a good choice when you need fast, frequent changes - for a retail backend, for example </li></ul><ul><li>Its structure is very different from a relational database </li></ul><ul><li>Data are stored in attribute type/attribute value pairs </li></ul><ul><li>New types of data can be added without having to re-design the entire database </li></ul>
  12. 12. Roots and Hierarchies <ul><li>An LDAP directory follows the familiar Unix filesystem structure – root directory at the top of the “tree” with sub-directories branching off </li></ul><ul><li>A typical design is to have a single master root directory for the company. Sub-directories are then organised by department, location, function and anything that makes sense for you. </li></ul><ul><li>A nice and tidy way to organise the master directory and let you grant access permissions to specific pieces of a central data pool in a precise, controlled fashion. </li></ul><ul><li>Any individual subdirectory can be replicated elsewhere </li></ul><ul><li>Updates can be initiated in either direction. E.g. the accounting department can make updates to their directory then push the updates to the master server. </li></ul>
  13. 13. Directory Systems <ul><li>Directories organise complex information, making it easy to find. </li></ul><ul><li>They list resources – people, books in library, goods in department store and give details about each one. </li></ul><ul><ul><li>E.g. telephone books, library catalog, department store catalog. </li></ul></ul><ul><li>Enterprises with distributed computer systems use online directories for fast searches, cost-effective management of users and security, and a central integration point for multiple applications and services. </li></ul><ul><li>LDAP is used by almost all commercial directory systems. </li></ul>
  14. 14. LDAP Specifications <ul><li>Lightweight Directory Access Protocol (LDAP) is one of the pre-eminent directory services deployed in the world. </li></ul><ul><li>LDAP is based on ITU X.500 standard but significantly simpler and more readily adapted to meet custom needs. </li></ul><ul><li>Unlike X.500 which is too tied to the OSI protocols, LDAP supports TCP/IP (uses port 389) which is necessary for Internet access. </li></ul><ul><li>The core LDAP specifications are all defined in RFC’s 1777-1779; 1959-1960; 2251-2256 and 2819-2830. </li></ul><ul><li>Strictly speaking, LDAP is not a database but a protocol used to access information stored in an information directory (a.k.a LDAP directory). </li></ul><ul><li>Using LDAP, data will be stored in and retrieved from the correction within an LDAP information directory . </li></ul>
  15. 15. Advantages of LDAP Directories <ul><li>Companies can access the LDAP directory from almost any computing platforms. </li></ul><ul><li>LDAP protocol is Internet standards-based and is finding much wider industry acceptance. </li></ul><ul><li>LDAP-aware applications are readily available. </li></ul><ul><li>Unlike many relational databases, you do not have to pay for either client connection software or for licensing. </li></ul><ul><li>LDAP servers can replicate their data via push or pull methods, allowing you to push data to remote offices to increase security. </li></ul><ul><li>Replication technology is built-in and easy to configure (By contrast, many of the big DBMS vendors charge extra for this features and it is far more difficult to manage). </li></ul><ul><li>Read and modification authority can be delegated based on your needs using Access Control Instances (ACI). </li></ul>
  16. 16. Access Control Instances (ACIs) <ul><li>LDAP access control instances (ACIs) which collectively form an access control list allow extremely fine-grained control. Examples are: </li></ul><ul><ul><li>Users can modify their own personal information – home address, phone extension, email – but no one else’s </li></ul></ul><ul><ul><li>All of the information for a particular user can be kept in a single record, but access to individual entries is completely configurable </li></ul></ul><ul><ul><li>Give managers a precise level of read and read/write permissions for their group </li></ul></ul><ul><ul><li>Put usernames and passwords and other sensitive data under the control of the sysadmin. </li></ul></ul><ul><ul><li>Let groups and group leaders determine who gets what kind of access to resource under their control. </li></ul></ul>
  17. 17. Figure 1. Integration of applications & infrastructure with LDAP
  18. 18. LDAP Data Organization <ul><li>Action in LDAP takes place around a data structure known as an entry. </li></ul><ul><li>Figure 2. The LDAP entry data structure </li></ul>
  19. 19. LDAP Entry Structure <ul><li>An entry has a set of named component parts called attributes that hold the data for that entry. </li></ul><ul><li>To use database terms, they are like the fields in database record. </li></ul><ul><ul><li>If we keep a list of machines in an LDAP directory, each machine entry can have attributes like names, model, location, owner, etc. </li></ul></ul><ul><li>Besides its name, an attribute consists of a type and a set of values that conform to that type. </li></ul><ul><ul><li>If we store employee information, each entry might have a phone attribute that has a type of telephoneNumber . </li></ul></ul><ul><ul><li>The values of this attribute might be that employee’s phone numbers. </li></ul></ul><ul><ul><li>A type also has a syntax that dictates what kind of data can be used (strings, numbers, etc.), how it is stored and how it is used in a search. </li></ul></ul>
  20. 20. LDAP’s Naming Model <ul><li>When we consider a directory populated with many entries, we are immediately faced with the question that “ How do you find anything?” </li></ul><ul><li>To answer this question, we need to look to LDAP’s “naming model”. A common set of naming rules called namespace is needed. </li></ul><ul><li>Namespace serves two functions: </li></ul><ul><ul><li>To identify objects and </li></ul></ul><ul><ul><li>To define the hierarchical structure </li></ul></ul><ul><li>Each entry indicates a location in the directory, its name must be unique. </li></ul><ul><li>Management control can be delegated at multiple points in the hierarchical structure (natural inheritance of hierarchy) </li></ul><ul><li>LDAP namespace is very similar to DNS so works seamlessly with DNS. (DNS is preferred by not required). </li></ul>
  21. 21. Relative Distinguished Name (1) <ul><li>In Figure 2, each entry has a name known as its Distinguished Name (DN). The DN consists of a string of Relative Distinguished Names (RDNs). </li></ul><ul><li>An RDN is composed of one or several attribute name-value pairs. E.g. cn=Jay Sekora (where cn stands for “common name”) could be an RDN. </li></ul><ul><li>The attribute name is cn and the value is Jay Sekora . </li></ul><ul><li>Neither the LDAP nor the X.500 specifications dictate which attributes should be used to form an RDN. </li></ul><ul><li>They do require RDNs to be unique at each level in a directory hierarchy to distinguish between individual entries at that level. </li></ul>
  22. 22. Relative Distinguished Name (2) <ul><li>Take another example RDN: cn=Robert Smith </li></ul><ul><ul><li>Not a good RDN choice. </li></ul></ul><ul><ul><li>There is likely to be more than one Robert Smith in an organisation of even moderate size. </li></ul></ul><ul><ul><li>If you have a large number of people in your organisaton and your LDAP hierarchy is flat, name collisions like this are to be expected. </li></ul></ul><ul><li>A better entry would combine two attributes, cn=Robert Smith+l=Boston </li></ul><ul><ul><li>Attributes in RDNs are combined with a plus sign. </li></ul></ul>
  23. 23. Relative Distinguished Name (3) <ul><li>The revised RDN which appends a locality attribute may have postponed a name clash but have not eliminated the possibility. </li></ul><ul><li>Furthermore, if Smith moves to some other locality, we will have to change both the RDN for the entry and the location attribute in the entry. </li></ul><ul><li>The best RDN would be one with a unique and immutable user ID for this person. </li></ul><ul><ul><li>e.g., we could use that person’s email address so the RDN would be uid=rsmith . </li></ul></ul>
  24. 24. Directory Information Tree (DIT) <ul><li>Entries exist in a tree-like structure known as Directory Information Tree (DIT) or just directory tree . </li></ul><ul><li>The root of the directory has a name known as the directory’s base DN . </li></ul><ul><ul><li>The server’s base DN typically matches the DNS name of the directory server and uses the domain component ( dc ) attribute to represent the DNS zones (however, the match is not compulsory). </li></ul></ul><ul><li>Each entry in a directory tree can be located by its Distinguished Name (DN). </li></ul><ul><li>A DN is composed of an entry’s RDN followed by all of the RDNs (separated by comma or semicolons) found as you walk your way back up the tree towards the root entry. </li></ul><ul><li>If we follow the arrows in Figure 3 and accumulate RDNs as we go, we’ll construct DNs for each highlighted entry. </li></ul>
  25. 25. In the left pane of Figure 3, our DN would be: cn=Robert Smith,l=main campus,ou=CCS,o=Hogwarts School,c=US In the right pane of Figure 3, it is: uid=rsmith,ou=systems,ou=people,dc=ccs,dc=hogwarts,dc=edu <ul><li>Figure 3. Walking Back up the tree to produce a DN </li></ul>
  26. 26. Distinguished Name (DN) <ul><li>DN is the name of an entry </li></ul><ul><ul><li>ou is short for organizational unit </li></ul></ul><ul><ul><li>o is short for organization </li></ul></ul><ul><ul><li>dc stands for “domain component” </li></ul></ul><ul><ul><li>c is for country </li></ul></ul><ul><li>DNs are more like postal addresses than absolute pathname in a filesystem because they have a “most specific component first” ordering. In a postal address like: </li></ul><ul><ul><ul><li>Chan Tai Man </li></ul></ul></ul><ul><ul><ul><li>20 Tsing Yi Road </li></ul></ul></ul><ul><ul><ul><li>Tsing Yi, NT </li></ul></ul></ul><ul><ul><ul><li>HK </li></ul></ul></ul><ul><ul><li>You start off with the most specific object (the person) and get more vague from there, eventually winding up at the least specific component (the country). </li></ul></ul>
  27. 27. Summary – DN and RDN <ul><li>The concept of the distinguished name is the heart of the naming model. DN is used to construct the namespace and the directory information tree. </li></ul><ul><li>Each model has an attributed called “distinguished name” (DN) used to identify the entry unambiguously </li></ul><ul><li>DN must be unique throughout the whole directory </li></ul><ul><li>RDN has to be unique only in its scope. For example, if the parent is </li></ul><ul><li>DN: ou=sales, l=Europe, </li></ul><ul><li>under this subtree there can be only one RDN: </li></ul><ul><li>uid=usr1 </li></ul><ul><li>resulting in the DN: </li></ul><ul><li>DN: uid=urs1,ou=sales,l=Europe, </li></ul><ul><li>This means that you can have an entry with an RDN of uid=usr1 under l=Asia , resulting in the unique DN: </li></ul><ul><li>DN: uid=usr1,ou=sales,l=Asia, </li></ul>
  28. 28. Figure 4. Person and part records with DNs in an LDAP directory that integrates with the DNS namespace Example to illustrate DN usage
  29. 29. <ul><li>The name of the root of the directory is known as the directory’s base DN ( e.g. dc=mycompany,dc=com). </li></ul><ul><li>The DN of the person entry shown in Figure 4 could have been </li></ul><ul><li>cn=Brian Arkills,ou=People,dc=mycompany,dc=com instead of uid=barkills,ou=People,dc=mycompany,dc=com </li></ul><ul><li>Notice that each RDN component includes both the attribute type and value. For example, the single component cn=Brian Arkills has both the attribute type cn and the attribute value Brian Arkills . </li></ul><ul><li>Attribute value without the attribute type would be be sufficient to distinguish the entry. </li></ul><ul><li>The common name (cn) of the entry is Brian Arkills. It must be unique among all entries in the container ou=People to qualify as an RDN. </li></ul><ul><li>Since uniqueness of a person’s name is not guaranteed, so another attribute is often used instead as the RDN. E.g. user identity uid=barkills is chosen because login IDs must be unique. </li></ul><ul><li>The DN uid=barkills,ou=People,dc=mycompany,dc=com refers to exactly the same record in the directory namespace as the DN above. It simply uses a different RDN to identify the entry. </li></ul>
  30. 30. base DN (Directory Suffix) <ul><li>The top level (or root) of the LDAP directory tree is the base, referred to as the “base DN”, a.k.a “directory suffix”. </li></ul><ul><li>For example DN: ou=sales,l=Europe, </li></ul><ul><li>base DN takes one of the three forms listed below; </li></ul><ul><li>base DN in X.500 format: o=ldap_abc,c=de </li></ul><ul><ul><li>o=ldap_abc refers to the organization i.e., company name and c=de indicates that the company headquarters is in Germany. </li></ul></ul><ul><ul><li>With Internet globalization, using a country code in the base DN makes things more confusing. </li></ul></ul><ul><li>base DN derived from Internet presence: </li></ul><ul><ul><li>This format uses the company’s Internet domain name as the base </li></ul></ul><ul><li>base DN derived from domain components: dc=ldap_abc,dc=org </li></ul><ul><ul><li>As with the previous format, this uses the DNS domain name as its basis. This format is split into domain components: becomes dc=ldap_abc,dc=org </li></ul></ul><ul><ul><li>If merges with , you simply think of “ dc=org ” as the base DN and new records can be placed into your existing directory under dc=ldap_xyz,dc=org </li></ul></ul>
  31. 31. Example - Content of a directory exported to a LDIF file <ul><li>dn: </li></ul><ul><li>objectclass: top </li></ul><ul><li>objectclass: organization </li></ul><ul><li>o: </li></ul><ul><li>l: Munich </li></ul><ul><li>dn: ou=IT, </li></ul><ul><li>objectclass: top </li></ul><ul><li>objectclass: organizationalUnit </li></ul><ul><li>ou: IT </li></ul><ul><li>description: Information Technologies </li></ul><ul><li>dn: ou=HR, </li></ul><ul><li>objectclass: top </li></ul><ul><li>objectclass: organizationalUnit </li></ul><ul><li>ou: HR </li></ul><ul><li>description: Human Resources </li></ul><ul><li>dn: uid=SParker, ou=HR, </li></ul><ul><li>objectclass: top </li></ul><ul><li>objectclass: person </li></ul><ul><li>objectclass: organizationalPerson </li></ul><ul><li>objectclass: inetOrgPerson </li></ul><ul><li>ou: HR </li></ul><ul><li>cn: Sarah Parker </li></ul><ul><li>sn: Parker </li></ul><ul><li>givenName: Sarah </li></ul><ul><li>uid: SParker </li></ul><ul><li>mail: [email_address] </li></ul><ul><li>Mobile: (0049) 89 671 293 </li></ul>
  32. 32. Relationship between Entries and Attributes <ul><li>The previous directory can be broken down into smaller data structure called “entries” or objects. </li></ul><ul><li>First type of entry describes the whole organization, the second a single organizational unit and the third a single person. </li></ul><ul><li>Each entry contains information describing what it is or, to which object class it belongs – called objectClass. </li></ul>
  33. 33. Different Types of Objects <ul><li>To summarize, we have three different types of objects. Each representing a different object class; </li></ul><ul><ul><li>The whole organization is identified by an “ o ”: </li></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><li>The individual departments, called “ organizationalUnit ” abbreviated with “ ou ”: </li></ul></ul><ul><ul><ul><li>ou=IT, </li></ul></ul></ul><ul><ul><ul><li>ou=HR, </li></ul></ul></ul><ul><ul><li>The entry for a single person, called “inetOrgPerson ” is identified as follows: </li></ul></ul><ul><ul><ul><li>uid=SParker,ou=HR, </li></ul></ul></ul><ul><li>Each entry corresponds directly to an object in the real world, i.e, a person, a printer, a computer, an organization, etc. </li></ul>
  34. 34. Object Class <ul><li>LDAP is object-oriented. </li></ul><ul><li>Object classes define what entries are possible in an LDAP directory. </li></ul><ul><li>Each entry has a special attribute called objectClass . </li></ul><ul><li>objectClass contains multiple values that when combined with server and user settings, dictate which attributes must and may exist in that particular entry. </li></ul><ul><li>Each of the values of an objectClass attribute is a name of an object class. These classes either define the set of attributes that can or must be in an entry, or expand on the definitions inherited from another class. </li></ul><ul><li>Provides a convenient way for a user to query for all the entries with a particular objectClass attribute. </li></ul><ul><ul><li>E.g. to query just with objectclass=user identifies all user accounts in a Microsoft Active Directory. </li></ul></ul>
  35. 35. Inheriting characteristics of object class <ul><li>New object classes can be constructed hierarchically by inheriting characteristics from an existing object class. </li></ul><ul><ul><li>Object class “ organization ” is derived from the “ root ” object class by inheritance. </li></ul></ul><ul><ul><li>The root of all object classes from which all other object classes are inheriting is the “ top ” object class. </li></ul></ul><ul><ul><li>Object class “ inetOrgPerson ” derives from the previous class “ organizationalPerson ”, which inherits from the previous class “ person ”, which in turn inherits from the root object class “ top ”. </li></ul></ul><ul><li>Given this hierarchical system of inheritance, we can see why most entries “belong” to more than one object class: </li></ul><ul><ul><li>Each entry belongs to a specific object class as well as the ladder of increasingly broader classes from which it was derived. </li></ul></ul><ul><ul><li>The attribute “ objectClass ” describes all of the object classes to which the entry belongs. </li></ul></ul>
  36. 36. Object Class Definitions <ul><li>The root object class “ top ” is the ancestor of all object classes and contains the required attribute “ objectClass ”. </li></ul><ul><li>Since all entries inherit directly or indirectly from the root “ top ”, every object class MUST contain the attribute “ objectClass ”. </li></ul><ul><li>In the previous directory, the object with DN: “ ” implements the object class “ organization ”. The attribute “ objectClass ” of this entry has the two values: “ top ” and “ organization ”. </li></ul><ul><ul><li>The definition shows which attribute are required (MUST) and which attributes are optional (MAY) </li></ul></ul><ul><ul><li>“ top ” must only contain the attribute “ objectClass ” </li></ul></ul><ul><ul><li>“ organization ” inherits all attributes from “ top” and must also contain o (organization) </li></ul></ul><ul><ul><li>“ top ” has no optional attribute, “ organization ” has many optional attributes. </li></ul></ul>
  37. 37. Object Class Definition for top and organization <ul><li>Objectclass top: </li></ul><ul><li>( </li></ul><ul><li>Name ‘top’ </li></ul><ul><li>ABSTRACT </li></ul><ul><li>MUST ( </li></ul><ul><li>objectClass </li></ul><ul><li>) </li></ul><ul><li>) </li></ul><ul><li>Objectclass organization: </li></ul><ul><li>( </li></ul><ul><li>NAME ‘organization’ </li></ul><ul><li>SUP top </li></ul><ul><li>STRUCTURAL </li></ul><ul><li>MUST ( </li></ul><ul><li>o </li></ul><ul><li>MAY ( </li></ul><ul><li>userPassword </li></ul><ul><li>searchGuide </li></ul><ul><li>seeAlso </li></ul><ul><li>businessCategory </li></ul><ul><li>x121Address </li></ul><ul><li>registeredAddress </li></ul><ul><li>destinationIndicator </li></ul><ul><li>preferredDeliveryMethod </li></ul><ul><li>telexNumber </li></ul><ul><li>teletexTerminalIdentifier </li></ul><ul><li>telephoneNumber </li></ul><ul><li>internationaliSDNNumber </li></ul><ul><li>facsimileTelephoneNumber </li></ul><ul><li>street </li></ul><ul><li>postOfficeBox </li></ul><ul><li>postalAddress </li></ul><ul><li>physicalDeliveryOfficeName </li></ul><ul><li>st </li></ul><ul><li>l </li></ul><ul><li>description </li></ul><ul><li>) </li></ul><ul><li>) </li></ul>
  38. 38. Examples – Object Class Definitions (1) <ul><li>Object class “ top ” </li></ul><ul><ul><li>All object classes derived from the object class “ top ” </li></ul></ul><ul><ul><li>Its purpose is to ensure every object contains the “ objectClass ” attribute </li></ul></ul><ul><ul><li>It exists only to be subclassed i.e., ABSTRACT </li></ul></ul><ul><ul><li>You will not find an entry for object class “ top ” </li></ul></ul><ul><ul><li>Because every object class inherits from “ top ”, every object class must contain the attribute “ objectClass ” </li></ul></ul><ul><ul><ul><li>( </li></ul></ul></ul><ul><ul><ul><li>NAME ‘top’ </li></ul></ul></ul><ul><ul><ul><li>ABSTRACT </li></ul></ul></ul><ul><ul><ul><li>MUST ( </li></ul></ul></ul><ul><ul><ul><li>objectClass </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul>
  39. 39. Examples – Object Class Definitions (2) <ul><li>Object class “ person ” </li></ul><ul><ul><li>Derived from “ top ” </li></ul></ul><ul><ul><li>Besides the attribute “ objectClass ” inherited from “ top ” every “person” entry must have the attributes “ sn ” and “ cn ” </li></ul></ul><ul><ul><li>The line with “SUP top” expresses that the object class “ top ” is its ancestor </li></ul></ul><ul><ul><li>We can use the numeric OID here: SUP ‘’ </li></ul></ul><ul><ul><ul><li>( </li></ul></ul></ul><ul><ul><ul><li>NAME ‘person’ </li></ul></ul></ul><ul><ul><ul><li>SUP top </li></ul></ul></ul><ul><ul><ul><li>STRUCTURAL </li></ul></ul></ul><ul><ul><ul><li>MUST ( </li></ul></ul></ul><ul><ul><ul><li>sn $ cn </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul><ul><ul><ul><li>MAY ( </li></ul></ul></ul><ul><ul><ul><li>userPassword $ telephoneNumber $ seeAlso $ description </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul>
  40. 40. Examples – Object Class Definitions (3) <ul><li>Object class “ organizationalPerson ” </li></ul><ul><ul><li>Derived from “ person ” </li></ul></ul><ul><ul><li>This object class has a number of attributes useful for implementing an employee object such as fax number, organizational unit and so on. </li></ul></ul><ul><ul><li>It adds more optional attributes in addition to those provided by “ person ”. </li></ul></ul><ul><ul><ul><li>( </li></ul></ul></ul><ul><ul><ul><li>NAME 'organizationalPerson' </li></ul></ul></ul><ul><ul><ul><li>SUP person </li></ul></ul></ul><ul><ul><ul><li>STRUCTURAL </li></ul></ul></ul><ul><ul><ul><li>MAY ( </li></ul></ul></ul><ul><ul><ul><li>title $ x121Address $ registeredAddress $destination Indicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminal Identifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ 1 </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul>
  41. 41. Examples – Object Class Definitions (4) <ul><li>Object class “ inetOrgPerson ” </li></ul><ul><ul><li>This class was intended to accommodate information about a person in a typical Internet/Intranet environment </li></ul></ul><ul><ul><ul><li>(2.16.840.1.113730.3.2.2 </li></ul></ul></ul><ul><ul><ul><li>NAME ' inetOrgPerson ' </li></ul></ul></ul><ul><ul><ul><li>SUP organizationalPerson </li></ul></ul></ul><ul><ul><ul><li>STRUCTURAL </li></ul></ul></ul><ul><ul><ul><li>MAY ( </li></ul></ul></ul><ul><ul><ul><li>audio $ businessCategory $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ pager $ photo $ roomNumber $ secretary $ uid $ userCertificate $ x500uniqueIdentifier $ preferredLanguage $ userSMIMECertificate $ userPKCS12 </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul><ul><ul><ul><li>) </li></ul></ul></ul>
  42. 42. Summary Object Class Definitions <ul><li>In most cases, we use the pre-defined standard object classes. If you need to construct entries with attributes not found in an existing object class, it is usually good form to locate the closest existing object class and build upon it, like organizationalPerson , builds upon person above. </li></ul><ul><li>A collection of object classes that specify attributes for the entries in an LDAP server is called a schema . </li></ul>
  43. 43. organizationalUnit Object Class
  44. 44. domain Object Class
  45. 45. person, organizationalPerson and inetOrgPerson objectClasses
  46. 46. posixAccount (above) Auxiliary object class posixGroup (below) Structural object class
  47. 47. shadowAccount Object Class
  48. 48. Elements of an Object Class (1) <ul><li>Object class definition contains several key fields that help to define an entry of the object class and what rules that entry follows. </li></ul><ul><ul><li>OID – the unique object identifier for this object class. </li></ul></ul><ul><ul><li>Name – the name used to refer to the object class. </li></ul></ul><ul><ul><li>Description – brief description of what the object class represents. </li></ul></ul><ul><ul><li>Inactive status – indicated by OBSOLETE which means the object class is inactive. </li></ul></ul><ul><ul><li>Superior class – lists the object class(es) on which this object class is based (some schema formats label this field SUP while others call it SUBCLASS OF . </li></ul></ul>
  49. 49. Elements of an Object Class (2) <ul><ul><li>Category of object class – specified with the presence of abstract, auxiliary, or structural </li></ul></ul><ul><ul><ul><li>By default, structural is assumed. </li></ul></ul></ul><ul><ul><ul><li>The categories indicate to the schema checking process how to create an entry of that object class and what attributes are required or allowed. </li></ul></ul></ul><ul><ul><li>Mandatory attributes – usually noted by a MUST field, which lists all the attributes that must have values for an entry of this object class to exist. </li></ul></ul><ul><ul><li>Optional attributes – usually noted by a MAY field, which lists all the attributes that are allowed on an entry of this object class . </li></ul></ul>
  50. 50. Object Class Categories <ul><li>Three categories of object classes: abstract, auxiliary and structural. </li></ul><ul><li>Every entry in the directory has at least one structural class and one abstract class, and may have auxiliary classes. </li></ul><ul><li>Any particular object class may build on another object class definition or pick the attractive parts of another object class definition – this functionality is enabled by object class categories. </li></ul><ul><li>Object classes can either include or inherit existing definitions thereby forming relationships between object classes </li></ul><ul><ul><li>one object class has a whole set of object classes depending on it, so a hierarchy is formed. </li></ul></ul>
  51. 51. Abstract Object Class <ul><li>Not intended to be actually implemented </li></ul><ul><ul><li>e.g., TOP class </li></ul></ul><ul><li>No entry implementing the object class TOP , but it is from this class that all other classes are derived. </li></ul><ul><li>Exists to ensure that all classes derived from it contain the attribute objectClass . </li></ul><ul><li>No need to use an object of this class. </li></ul>
  52. 52. Structural Object Class <ul><li>Objects whose object class is of the type “structural” can be stored in the directory. </li></ul><ul><ul><li>e.g., person, organizatioalPerson, inetOrgPerson </li></ul></ul><ul><li>Some server implementations use structural classes to define where in the directory information tree a certain object can be stored. </li></ul><ul><li>You cannot have more than one structural objectClass in your schema. </li></ul>
  53. 53. Auxiliary Object Class <ul><li>This is for situations when you need a new object class extending from an existing one. </li></ul><ul><li>You can define all the data the new object needs to hold together in an auxiliary class. </li></ul><ul><li>An object of type “auxiliary” can be attached anywhere in the directory information tree. </li></ul><ul><ul><li>An example is the subschema object, which holds the schema for the directory server, i.e., object-class definitions, attribute-type definitions, matching rules, etc. </li></ul></ul>
  54. 54. Example of Auxiliary Object Class <ul><li>dcObject – stands for “domain component object”. </li></ul><ul><li>Used to describe objects having DN being similar to DNS like domain names. </li></ul><ul><li>It has the attribute “ dc ”, which stands for “domain component”. </li></ul><ul><li>This dcObject class can be used to implement an organization object with DN: dc=tyict,dc=vtc,dc=edu,dc=hk </li></ul>
  55. 55. More example – Auxiliary Object Class <ul><li>You cannot use objectClass o , because this cbjectClass does not allow the attribute dc . </li></ul><ul><li>The objectClass dcObject, on the other hand, does not allow the attribute o or description . </li></ul><ul><li>Solution: Mix the two; auxiliary object class allows mixing. </li></ul><ul><li>DN: dc=ldapabc,dc=org </li></ul><ul><li>objectclass: top </li></ul><ul><li>objectclass: dcObject </li></ul><ul><li>objectclass: o </li></ul><ul><li>dc: ldapabc </li></ul><ul><li>dc: org </li></ul><ul><li>o: ABC’s of LDAP </li></ul><ul><li>description: Organization promoting LDAP </li></ul><ul><li>l: Munich </li></ul>
  56. 56. Object Identifiers (O.I.D.) <ul><li>Object identifiers are not only used for object classes, but also for attribute types. </li></ul><ul><li>It is not only used for LDAP and X.500, but also for other protocols such as SNMP. </li></ul><ul><li>The namespace of all OIDs implements an OID tree. A subtree in the OID tree is an arc </li></ul><ul><ul><li>OID stands for object class person </li></ul></ul><ul><ul><li>2.16.840.1.113730.3.2.2 for object class inetOrgPerson </li></ul></ul><ul><li>You need an OID subtree whenever you need to extend the directory schema – you can get your OID subtree from IANA (Internet Assigned Numbers Authority) </li></ul><ul><ul><li>All attributes and objects defined by IETF begin with 2.5.4, e.g. for attribute “object-Class.” </li></ul></ul><ul><ul><li>You can invent your own OIDs. </li></ul></ul>