Skip to main content
Version: 0.10

Active Directory users (WIP)

Imports user objects from Active Directory, with the account-hygiene attributes that make a directory export worth having — delegation flags, password policy state and lockouts.

Type nameactive_directory_users
CreatesUsers
Runs onA sensor, or as an isolated integration with an uploaded CSV
Presence flagactive_directory_user_exits
Field prefixactive_directory_user_

What it contributes​

  • Identity — name, display name, given name, surname, SAM account name, UPN, distinguished name, object GUID, SID, SID history, email address
  • Organisation — department, title, description, member of
  • Account state — enabled, locked out, account expiration date, user account control, created, last logon date
  • Password state — password last set, password never expires, password not required, last bad password attempt
  • Delegation — trusted for delegation, trusted to auth for delegation, does not require pre-auth

It writes the shared user fields user_full_name (from the display name), user_email (the email address, or the UPN when the email address is empty), user_department and user_title, but only where the user does not already hold a value from another source. It also adds the account's distinguished_name to what the user already holds, writes updated_at, and keeps the source row in _meta_active_directory_users_scan_result. The last logon date is the sighting it reports for last_seen and first_seen.

Only enabled accounts are imported

A row whose Enabled column is not True is dropped, so disabled accounts never create or update a user. The Enabled column is required: without it no row is imported. Unlike Active Directory, accounts that never logged on are kept. Dates are read in the M/d/yyyy h:mm:ss AM/PM, M/d/yyyy H:mm and d/M/yyyy h:mm:ss AM/PM forms; a date in any other format is left empty.

The delegation and pre-auth flags are the interesting ones

trusted_for_delegation, trusted_to_auth_for_delegation and does_not_require_pre_auth are the attributes attackers look for, and they are rarely set deliberately. Filtering users on them is a five-second hygiene check that most estates fail somewhere.

Data collection​

Like Active Directory, the sensor-side implementation reads a CSV export. Produce it with the RSAT ActiveDirectory module:

Import-Module ActiveDirectory

$props = @(
'AccountExpirationDate','Created','Department','Description','DisplayName',
'DistinguishedName','DoesNotRequirePreAuth','EmailAddress','Enabled','GivenName',
'LastBadPasswordAttempt','LastLogonDate','LockedOut','MemberOf','Name',
'ObjectClass','ObjectGUID','PasswordLastSet','PasswordNeverExpires',
'PasswordNotRequired','SamAccountName','SID','SIDHistory','Surname','Title',
'TrustedForDelegation','TrustedToAuthForDelegation','userAccountControl',
'UserPrincipalName'
)

Get-ADUser -Filter * -Properties $props |
Select-Object $props |
Export-Csv -NoTypeInformation -Encoding UTF8 .\ad-users.csv

Headers must match those property names; unknown ones are skipped without error. Run the export in a session whose regional format writes dates as listed under What it contributes, for example en-US.

Matching​

Each row is matched to an existing user by the first rule that finds one:

  1. SID
  2. Object GUID
  3. Distinguished name
  4. AD name
  5. AD email address, then the shared user_email
  6. The AD name against the shared user_full_name

A row that matches nothing creates a new user, subject to the template's On New Asset Discovered action.

MemberOf is multi-valued

Exported to CSV, a multi-valued attribute serialises as a single string. Group membership therefore arrives as text rather than as a list — usable for search, but not as a structured relationship.

Requirements​

As for Active Directory, collection is from a CSV export you supply — here of Get-ADUser — so the requirements fall mostly on whoever produces that export.

Network access​

FromToProtocolPort
The sensor running the integrationNothing — the run parses a CSV export——

No route from a sensor to a domain controller is needed for the CSV path. The reach that is needed belongs to the machine where you run Get-ADUser — an already domain-joined administrative host, using whatever access it normally has.

There is no direct-collection path today. The URL, Username and Password fields are stored but not used: a run on an instance without Isolated Integration ticked fails on the sensor without collecting anything.

Access in Active Directory​

NeedWhy
An account that can run Get-ADUser against the domainIt produces the export; Authenticated Users is enough in a default domain — see Permissions in Active Directory
The RSAT ActiveDirectory PowerShell module on that hostGet-ADUser ships with it rather than with Windows itself — Data collection has the export command

In this deployment​

NeedWhy
Console access to upload the exportIn Isolated Integration mode the CSV is supplied through the console rather than collected
A registered sensor to selectSensor is a required field, even though only the isolated mode collects anything. See Sensors

Configuration​

Identical to Active Directory: name, URL, username, password, optional cookies, sensor, ignore SSL, and the Isolated Integration checkbox that switches the instance to operator-supplied CSV upload. Tick Isolated Integration: it is the only mode that collects, and the URL, username and password are not used. Password and Cookies are write-only once saved.

Permissions in Active Directory​

Reading user objects needs no privilege beyond Authenticated Users in a default domain. Use a dedicated read-only service account so the reads are attributable.

See also​