Active Directory LDAP Filters

Active Directory is a standards-compliant directory service and the standard access protocol used to query Active Directory is the LDAP (Lightweight Directory Access Protocol) protocol.

 

Active Directory is also the primary enterprise store for vital IT resources (user accounts, security groups, computer accounts and group policies) that play a central role in enterprise wide security, IT management and security audit and compliance reporting.

 

IT personnel often need to generate Active Directory based security reports that document the state of these IT resources, and to do so they can either user a set of Active Directory Reporting Tools that automate the generation of these reports, or a variety of LDAP clients, such as dsquery (provided by Microsoft) to generate these reports.

 

When IT admins choose to use LDAP tools, they are required to write LDAP filters which specify the parameters to use based on which the LDAP queries return this data. While most organizations choose to use automated tools because they are almost always more reliable and efficient to use, many IT admins also choose to create their own LDAP filters.

 

For organizations and IT personnel who wish to write their own scripts to generate custom reports, there are many helpful resources out there that can provide information on common LDAP filters.


What is delegation of administration in Active Directory?

An IT infrastructure is typically comprised of many IT assets such as user accounts, computers, files and databases, applications and services all of which need to be administered. In such IT infrastructures, it is not possible for a handful of administrators to adequately administer all aspects of the IT infrastructure.

 

Thus, in most IT infrastructures, administrative responsibilities for managing the various IT assets that together comprise the IT infrastructure are distributed (or delegated) amongst an adequate and typically greater number of less-privileged administrators, who are then responsible for managing smaller specific portions of the IT infrastructure.

 

Delegation of administration is the act of distributing and delegating an administrative task for various aspects of IT management amongst an adequate number of administrators.

 

The act of delegating administration involves granting one or more users or Active Directory security groups the necessary Active Directory security permissions as appropriate so as to able to allow the delegated administrator to carry out these tasks.

 

In the interest of security, after delegating an administrative task, IT personnel should always also verify delegation in Active Directory, so as to be sure that the task was delegated accurately. The process of verifying a delegation in Active Directory is rather complicated but with the right Active Directory Reporting Tool, IT personnel can accomplish this task efficiently and reliably.

 

Done right, Active Directory's powerful administrative delegation capabilities let organizations securely, efficiently and cost-effectively delegate administrative authority for identity and access management in their IT infrastructures thereby reducing cost and enhancing security.

 

Source - Active Directory Security Technical Reference


A Guide to the Active Directory Security Model

Active Directory's security model secures and protects every object stored in Active Directory, including domain user accounts and domain computer accounts, domain security groups and group policies. The Active Directory Security model allows administrators to specify who has what access to which object to a high degree of control. It also allows administrators to specify access for an entire group of users so as to simply security management.

 

The following is an overview of how Active Directory's security model protects stored content –

  1. Each object is protected by a component known as a Security Descriptor

  2. Each security descriptor contains amongs other compronents, an Access Control List (ACL)

  3. Each ACL contains one or more Access Control Entries (ACEs)

  4. Each ACE allows or denies specific security permissions to some security principal

  5. Security groups can be specified and be part of security groups

  6. ACEs can be explicit or inherited; explicit ACEs override inherited ACEs

  7. Access is specified in the form of low–level technical permissions

  8. These low-level permissions can be standard permissions, or special permissions such as extended rights or validated writes

  9. Active Directory's current object visibility mode impacts list access requests

  10. The access check takes into account the object's ACL and the user's token and determines resultant access for user on the object

In this manner, Active Directory's security model secures and protects Active Directory content.


How to Generate True Last Logon Security Reports in Active Directory

As an IT administrator you may need to determine the last time a user used their Active Directory domain user account to logon. For instance, last logon values are required to generate and furnish a list of stale domain user accounts.

 

Active Directory stores the last logon time of a domain user account in a specific attribute on the user object called lastLogon, but this is not a replicated attribute, so IT administrators need to query each DC in the domain for the local lastLogon value on the user's account, then compare each of these values to determine the latest one, and report that as the user's true last logon time. The actual last user logon value is also commonly referred to as True Last Logon. There are two steps to determining the true last logon time of a domain user account. The first step involves obtaining the value from each DC in the domain, and the second step involves comparing these values (taking into account Integer8 syntax) to arrive at the true last logon value for the user.

In order to read the lastLogon attribute, you must have appropriate Active Directory security permissions as well, because without it you will not be able to read the value of this attribute. Fortunately, the security descriptor is replicated so you don't need to worry about the permissions being replicated.

 

There are many Active Directory Reporting Tools that can help IT administrators automatically generate True Last Logon reports. Some of these tools are also available in Free Editions, and can help IT admins instantly fulfill their Active Directory security reporting needs for audit and compliance.

 

True Last Logon reports are essential for security, and can help organizations identity and clean up stale/inactive domain user accounts in their Active Directory. Automated tools provide an advantage over many queries or over semi-automated PowerShell scripts.


How to identify and list recently Deleted Objects in Active Directory?

IT admins often need to be able to identify recently deleted objects in their Active Directory deployments. In certain cases, this might be to uncover accidental deletions, and in other cases, this might be to generate a list of all recently deleted objects for audit or compliance purposes.

 

An Active Directory object comes into existence either when Active Directory is installed, or when it is created by an IT administrator or an application. When it is no longer needed, an object can be deleted by an IT administrator or an application. When an object is deleted, it is first logically deleted for a specific interval of time to allow replication of the deletion to occur, and after this time has elapsed it is physically deleted.

 

IT administrators thus often have a need to be able to identify and list recently deleted objects in Active Directory, and there are more than one ways in which IT administrators can enumerate Deleted Objects in Active Directory

 

IT administrators who wish to query Active Directory to obtain a list of deleted objects should use the Object Identifier Control (1.2.840.113556.1.4.417) also known as the Show Deleted Object control. IT administrators can also choose to use 3rd party automated Active Directory reporting tools that provide instant and reliable reports which document all objects have been deleted in the last few days, often based on their class as well.

 

It always helps to know if there were any accidental deletions, or if any objects were recently deleted by another IT administrator, so IT administrators should always keep an eye out for deleted objects, and ensure that any accidental deletions are undone.

 

 


Helpful IT Reporting Stuff

Organizations often need to generate a variety of reports ranging from enterprise-wide IT management overviews down to resource specific reports that document the current state and security of individual IT resources.

This blog covers numerous aspects of IT reporting, ranging from common IT reports to helpful IT reporting tools for identity, resource and access management in the enterprise.