Skip to main content

Active Directory Schema Reference

Access Analyzer stores Active Directory scan data in the access_analyzer ClickHouse database. The tables below are created when you set up an Active Directory source group and run a scan. Use this reference when querying scan data directly or integrating Access Analyzer data with external tools.

note

All tables use the ReplacingMergeTree engine. Duplicate rows with the same primary key are deduplicated at merge time. Query the _latest views to return only the most recent version of each record.

Metadata columns

All tables include the following columns populated by Access Analyzer during each scan:

ColumnTypeDescription
scan_idStringIdentifier of the source group that produced this record.
scan_execution_idStringIdentifier of the specific scan run.
scanned_atDateTimeTimestamp when the record was written.

Tables

Active Directory User

Stores one row per user object discovered in an Active Directory scan.

Primary key: object_guid

Core identity fields

ColumnTypeDescription
object_guidUUIDGlobally unique identifier for the user object.
object_sidStringSecurity identifier (SID) of the user.
distinguished_nameStringFull distinguished name (DN) of the user in the directory.
canonical_nameNullable(String)Optional. Canonical form of the distinguished name.
sam_account_nameStringPre-Windows 2000 logon name (sAMAccountName).
user_principal_nameNullable(String)Optional. User principal name (UPN) in user@domain format.
display_nameNullable(String)Optional. Display name shown in directory listings.
given_nameNullable(String)Optional. First name of the user.
surnameNullable(String)Optional. Last name of the user.
enabledBoolWhether the user account is enabled.
when_createdNullable(DateTime)Optional. Timestamp when the account was created in the directory.
when_changedNullable(DateTime)Optional. Timestamp of the most recent change to the account.
descriptionNullable(String)Optional. Description field set on the user object.
admin_countNullable(Int32)Optional. Value of the adminCount attribute; non-zero values indicate the account is or was protected by AdminSDHolder.
primary_group_idNullable(Int32)Optional. Relative identifier (RID) of the user's primary group.
domain_nameNullable(String)Optional. NetBIOS or DNS name of the domain.
domain_canonical_nameNullable(String)Optional. Canonical (DNS) name of the domain.
cnNullable(String)Optional. Common name (CN) attribute of the user object.

Contact information

ColumnTypeDescription
mailNullable(String)Optional. Email address.
telephone_numberNullable(String)Optional. Office telephone number.
mobileNullable(String)Optional. Mobile telephone number.
officeNullable(String)Optional. Office location.
street_addressNullable(String)Optional. Street address.
cityNullable(String)Optional. City.
stateNullable(String)Optional. State or province.
postal_codeNullable(String)Optional. Postal or ZIP code.
countryNullable(String)Optional. Country or region.

Organizational information

ColumnTypeDescription
job_titleNullable(String)Optional. Job title.
departmentNullable(String)Optional. Department.
companyNullable(String)Optional. Company or organization name.
manager_dnNullable(String)Optional. Distinguished name of the user's manager.
employee_idNullable(String)Optional. Employee identifier.

Security information

ColumnTypeDescription
user_account_controlNullable(Int32)Optional. Bitmask value of the userAccountControl attribute controlling account behavior and flags.
password_last_setNullable(DateTime)Optional. Timestamp when the password was last changed.
password_never_expiresNullable(Bool)Optional. Whether the password is set to never expire.
account_expiresNullable(String)Optional. Expiration date of the account, stored as a string representation of the directory value.
logon_hoursNullable(String)Optional. Bitmask string representing the hours during which the user is permitted to log on.
logon_workstationsArray(String)List of workstations the user is permitted to log on to; empty array indicates no restriction.
smartcard_requiredNullable(Bool)Optional. Whether the account requires a smart card to log on.
mfa_enforcedNullable(Bool)Optional. Whether multi-factor authentication is enforced for this account.
is_deletedBooleanWhether the user object has been soft-deleted. Rows where is_deleted = 1 are excluded from the active_directory_user_latest view.

Activity information

ColumnTypeDescription
last_logonNullable(DateTime)Optional. Most recent logon timestamp from the domain controller that serviced the last logon. Not replicated across domain controllers.
last_logon_timestampNullable(DateTime)Optional. Replicated logon timestamp (lastLogonTimestamp); updated at intervals and may lag behind the actual last logon by up to 14 days.
bad_pwd_countNullable(Int32)Optional. Number of consecutive failed logon attempts.
bad_password_timeNullable(DateTime)Optional. Timestamp of the last failed logon attempt.
lockout_timeNullable(DateTime)Optional. Timestamp when the account was locked out; NULL or zero indicates the account isn't locked.
last_logoffNullable(DateTime)Optional. Timestamp of the last logoff.

Delegation information

ColumnTypeDescription
ms_ds_allowed_to_act_on_behalf_ofArray(String)List of security descriptors for accounts permitted to delegate to this account using resource-based constrained delegation.
ms_ds_allowed_to_delegate_toArray(String)List of SPNs this account is permitted to delegate to using constrained delegation.
ms_ds_supported_encryption_typesNullable(Int32)Optional. Bitmask of Kerberos encryption types supported by this account.
service_principal_nameArray(String)List of service principal names (SPNs) registered to this account.
legacy_exchange_dnNullable(String)Optional. Legacy Exchange distinguished name, used for mail routing compatibility.
ms_ds_user_account_control_computerNullable(Int32)Optional. Computer-specific userAccountControl flags stored on the user object in hybrid environments.

Relations

Related tableJoin columnDescription
active_directory_group_membershipobject_sid via foreign_sidResolves groups that include this user when the user was added by SID from a foreign domain.
active_directory_group_membershipdistinguished_name via member_dnResolves groups that include this user when the user was added by DN.
active_directory_user_custom_attributeobject_guidReturns custom attribute values collected for this user.
active_directory_effective_group_membershipobject_guid via member_object_guidReturns all groups this user belongs to, including nested memberships.

Active Directory Group

Stores one row per group object discovered in an Active Directory scan.

Primary key: object_guid

ColumnTypeDescription
object_guidUUIDGlobally unique identifier for the group object.
object_sidStringSecurity identifier (SID) of the group.
distinguished_nameStringFull distinguished name (DN) of the group in the directory.
sam_account_nameNullable(String)Optional. Pre-Windows 2000 name of the group.
nameNullable(String)Optional. Display name of the group.
group_scopeNullable(String)Optional. Scope of the group: DomainLocal, Global, or Universal.
group_typeNullable(String)Optional. Type of the group: Security or Distribution.
admin_countNullable(Int32)Optional. Value of the adminCount attribute; non-zero values indicate the group is or was protected by AdminSDHolder.
primary_group_idNullable(Int32)Optional. Relative identifier (RID) associated with this group when it is used as a primary group.
domain_nameNullable(String)Optional. NetBIOS or DNS name of the domain.
domain_canonical_nameNullable(String)Optional. Canonical (DNS) name of the domain.
cnNullable(String)Optional. Common name (CN) attribute of the group object.
mailNullable(String)Optional. Email address associated with the group.
is_deletedBooleanWhether the group object has been soft-deleted. Rows where is_deleted = 1 are excluded from the active_directory_group_latest view.

Relations

Related tableJoin columnDescription
active_directory_group_membershipdistinguished_name via group_dnLists the direct members of this group.
active_directory_effective_group_membershipobject_guid via group_object_guidLists all effective members of this group, including nested members.

Active Directory Group Membership

Stores one row per direct membership relationship between a group and a member object (user or group). Nesting isn't flattened in this table; use active_directory_effective_group_membership for flattened membership.

Primary key: (group_dn, member_dn)

ColumnTypeDescription
group_dnStringDistinguished name (DN) of the group.
member_dnStringDistinguished name (DN) of the member object.
foreign_sidNullable(String)Optional. SID of the member when the member is from a foreign (trusted) domain and a DN isn't available.

Relations

Related tableJoin columnDescription
active_directory_groupgroup_dn = distinguished_nameResolves the group record for this membership row.
active_directory_usermember_dn = distinguished_nameResolves the user record for this membership row when the member is a user.
active_directory_groupmember_dn = distinguished_nameResolves the group record for this membership row when the member is a nested group.
active_directory_userforeign_sid = object_sidResolves a foreign-domain user by SID when foreign_sid is set.
active_directory_groupforeign_sid = object_sidResolves a foreign-domain group by SID when foreign_sid is set.

Active Directory User Custom Attribute

Stores custom Active Directory attribute values collected for user objects during a scan. Each row represents one attribute key-value pair for one user. An attribute with no value produces a row with attr_value = NULL.

Primary key: (object_guid, attr_name)

ColumnTypeDescription
object_guidUUIDGlobally unique identifier of the user object. Joins to active_directory_user.object_guid.
attr_nameStringLDAP attribute name, as configured in the source group settings.
attr_valueNullable(String)Optional. String representation of the attribute value.

Relations

Related tableJoin columnDescription
active_directory_userobject_guidReturns the full user record for this custom attribute row.

Active Directory Effective Group Membership

Stores the fully flattened, transitively resolved group membership graph. This table is populated by the active_directory_effective_group_membership_mv materialized view, which refreshes on a schedule after each scan. Each row represents one effective membership relationship at a given nesting depth.

Engine: MergeTree (not ReplacingMergeTree). The table is rebuilt on each refresh rather than deduplicated by version.

Primary key: (group_object_guid, member_object_guid)

ColumnTypeDescription
group_object_guidUUIDGlobally unique identifier of the group. Joins to active_directory_group.object_guid.
member_object_guidUUIDGlobally unique identifier of the effective member (user or group). Joins to active_directory_user.object_guid or active_directory_group.object_guid.
nesting_levelInt32Depth of the membership relationship. A value of 0 indicates direct membership; higher values indicate the number of intermediate groups.

Relations

Related tableJoin columnDescription
active_directory_groupgroup_object_guid = object_guidResolves the group name and attributes for this membership row.
active_directory_usermember_object_guid = object_guidResolves the user record when the effective member is a user.
active_directory_groupmember_object_guid = object_guidResolves the group record when the effective member is a nested group.

Views

Access Analyzer creates views that simplify common queries. Use views in preference to querying base tables directly.

Deduplication views

These views apply FINAL to the underlying ReplacingMergeTree tables to return only the most recent version of each record. Use these as the starting point for any query against Active Directory data.

ViewBase tableDescription
active_directory_user_latestactive_directory_userReturns the most recent version of each user record, deduplicated by object_guid, excluding soft-deleted users (is_deleted = 1).
active_directory_group_latestactive_directory_groupReturns the most recent version of each group record, deduplicated by object_guid, excluding soft-deleted groups (is_deleted = 1).
active_directory_group_membership_latestactive_directory_group_membershipReturns the most recent version of each group membership row, deduplicated by (group_dn, member_dn).
active_directory_user_custom_attribute_latestactive_directory_user_custom_attributeReturns the most recent version of each custom attribute row, deduplicated by (object_guid, attr_name).

Resolution views

These views resolve raw membership data into UUID-keyed relationships.

ViewDescription
active_directory_group_membership_resolvedJoins active_directory_group_membership_latest to the user and group tables to produce a resolved membership graph keyed by (group_object_guid, member_object_guid). Handles both same-domain members (matched by DN) and foreign-domain members (matched by SID). Excludes deleted objects. Used as the source for active_directory_effective_group_membership_mv.

Risk views

These views surface specific account and group hygiene conditions. Each view returns rows in a common shape: risk_type, entity_id, entity_name, domain, detection_timestamp, and additional_context. The active_directory_risks_summary view aggregates all risk views into a single result set enriched with catalog metadata.

ViewDescription
active_directory_empty_groupsGroups that have no effective members.
active_directory_single_member_groupsGroups that have exactly one effective member.
active_directory_large_groupsGroups that have more than 500 effective members.
active_directory_duplicate_groups_mvGroups whose effective membership set is identical to that of at least one other group.
active_directory_circular_nesting_mvGroups involved in circular nesting or with a nesting depth of 10 or more.
active_directory_stale_usersEnabled user accounts with no logon activity in the past 90 to 365 days.
active_directory_very_stale_usersEnabled user accounts with no logon activity for more than 365 days.
active_directory_isolated_usersEnabled user accounts that belong to no groups.
active_directory_no_logon_usersEnabled user accounts with no recorded logon timestamp.
active_directory_password_never_expiresEnabled user accounts configured with a non-expiring password.
active_directory_password_not_requiredEnabled user accounts where the PASSWD_NOTREQD flag is set in user_account_control.
active_directory_old_passwordsEnabled user accounts whose password has not changed in more than 90 days.
active_directory_dc_logon_rightsEnabled users who are effective members of privileged groups that grant domain controller logon rights (for example, Domain Admins, Enterprise Admins).
active_directory_risks_summary_mvUnion of all individual risk views. Returns one row per detected risk.
active_directory_risks_summaryEnriches active_directory_risks_summary_mv with risk level, category, and description from the active_directory_risk_catalog reference table. Use this view to query all risks with their human-readable metadata.
active_directory_risks_by_domainAggregates risk counts by domain and risk type, sourced from active_directory_risks_summary_mv.
active_directory_group_member_countsReturns the total effective member count for each group. Intermediate view used by the group risk views.