4.6
In progress
Directory Services
Summary
A directory service is a central database of users, computers, groups and other resources that applications query for identity information. Most directories, including Active Directory, are accessed with the Lightweight Directory Access Protocol (LDAP) and name objects with distinguished names.
In plain words
A directory service is the central phonebook of users, computers and groups. Most speak LDAP, and each object has a distinguished name (DN) built from parts like CN, OU, O, C and DC.
Detailed explanation
- Directory service: A hierarchical database that stores identity and resource objects and their attributes.
- Lightweight Directory Access Protocol (LDAP): The standard protocol for querying and updating directories, on TCP port 389; LDAPS uses TLS on port 636.
- Distinguished name (DN): The unique path to an object, written from the object up to the root of the directory.
- Relative distinguished name (RDN): The part of a DN that names the object within its container.
Common attributes
- CN (common name): The object's name.
- OU (organizational unit): A container for organizing objects and applying policy.
- O (organization): The organization name.
- C (country): A two-letter country code.
- DC (domain component): One part of a DNS domain name.
- Simple bind: An LDAP sign-in that sends credentials in clear text unless the connection uses TLS.
Important terms
taken from the text above- Directory service
- A hierarchical database that stores identity and resource objects and their attributes.
- Lightweight Directory Access Protocol (LDAP)
- The standard protocol for querying and updating directories, on TCP port 389; LDAPS uses TLS on port 636.
- Distinguished name (DN)
- The unique path to an object, written from the object up to the root of the directory.
- Relative distinguished name (RDN)
- The part of a DN that names the object within its container.
- CN (common name)
- The object's name.
- OU (organizational unit)
- A container for organizing objects and applying policy.
- O (organization)
- The organization name.
- C (country)
- A two-letter country code.
- DC (domain component)
- One part of a DNS domain name.
- Simple bind
- An LDAP sign-in that sends credentials in clear text unless the connection uses TLS.
Examples & real-world scenarios
- Active Directory storing all company accounts.
- DN: CN=WIDGETWEB, OU=Marketing, O=Widget, C=UK, DC=widget, DC=foo.
- The schema defining which attributes each object can have.
Scenario
An app needs to check whether a user belongs to the 'Finance' group. It queries the directory over LDAP (ideally LDAPS) instead of keeping its own user list.
Common mistakes
- Mixing up the certificate CN (Common Name) and the directory DN. They're related naming ideas, used differently.
- Forgetting that plain LDAP isn't encrypted.
Practical skills
- Read the parts of a distinguished name.
What I should remember
- LDAP: Port 389; LDAPS on port 636 adds TLS.
- Distinguished name: The unique path to a directory object.
- OU: A container used to organize objects and link policies.
- Simple bind: Must be protected with TLS.