1. Resources
  2. Detection sources
  3. Event ID 3047

Event ID 3047: The directory service detected an LDAP add request for the following object that normally would have been blocked

Audit mode of the CVE-2021-42291 checks: a domain controller let a user create a computer object with attributes the user may not write, and logged it. The object exists with those settings. The default state of an updated forest.

Log source
Directory Service log
Detection value
Supporting
Volume
Low (estimate)
Last updated
Log
Directory Service log (Microsoft-Windows-ActiveDirectory_DomainService, on by default)
Logged on
Domain controllers only
Event versions
Not published
Detects
1 attack (1 rule)
MITRE ATT&CK
1 technique in 2 tactics
Threat groups
6 groups that MITRE ATT&CK records using these techniques
Fields the rules read
The event ID and the provider only

When it is written

KB5008383, released with the November 9, 2021 updates for CVE-2021-42291, adds authorization checks for users who create computer objects without having domain administrator rights. In audit mode, the default after the update, a domain controller writes 3047 when an LDAP add request for a computer or computer-derived object includes one or more attributes that the client may not write, judged against the default merged security descriptor. The request is allowed to proceed, so the object now exists with the attributes that were asked for. The event names the object, its class, the user, the client address and the security descriptor that was attempted.

The protocol specification (MS-ADTS) gives the scope of the check: members of Domain Admins and Enterprise Admins are not checked, only classes that are computer or derive from it are, and the attributes the class requires and the password attributes are left out of the comparison. Microsoft says that logged events indicate a user might have excessive privileges to create computer accounts with arbitrary security-sensitive attributes, and asks administrators to report unexpected cases.

The event exists only on writable domain controllers with the November 9, 2021 or later updates; Microsoft notes that domain controllers without the update log nothing for these requests and that read-only domain controllers cannot receive them.

How to turn it on

Microsoft-Windows-ActiveDirectory_DomainService writes the event to the Directory Service log (Event Viewer > Applications and Services Logs > Directory Service), which is on by default. Microsoft

The log needs nothing to be turned on: a domain controller writes it from the moment it is promoted. What Active Directory writes there depends on its diagnostic logging levels, one REG_DWORD value per category under HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics (for example 16 LDAP Interface Events), each from 0 (None) to 5 (Internal). Microsoft's default for every category is 0, which it describes as recording only critical and error events; several warning and information events of this library are nonetheless documented as written at that level (the CVE-2021-42291 events, the daily LDAP summaries). Some events, such as the per-client LDAP signing and channel binding events, are written only at level 2 or higher of their category; their pages say so.

Microsoft recommends keeping the levels at 0 unless you investigate an issue, notes that a higher level adds detail and events, and advises against 3 or more because it costs resources and can slow the server. The levels are set per domain controller, so set them on every domain controller whose events you need. AD LDS instances write the same kind of events to their own instance log, which this library does not cover.

Show the diagnostic logging levels of this domain controller
reg query "HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics"
Based on vendor documentation.
Show the log's settings (size and retention)
wevtutil gl "Directory Service"
Based on vendor documentation.

Audit mode is the state of character 28 of the dSHeuristics attribute on CN=Directory Service,CN=Windows NT,CN=Services in the configuration partition when it is 0 or not set, the default after the update. At 1 (enforcement) the same request is denied and logged as 3044; at 2 the check and its events are off (event 3052 announces it). Read the current string (read only, Active Directory module):

Get-ADObject -Identity ("CN=Directory Service,CN=Windows NT,CN=Services," + (Get-ADRootDSE).configurationNamingContext) -Properties dSHeuristics | Select-Object -ExpandProperty dSHeuristics

KB5008383 describes audit mode as a stage: once it detects no unexpected privileges for a sufficient time, Microsoft recommends switching to enforcement by setting characters 28 and 29 to 1.

Fields

The template of this event is not part of client Windows and Microsoft does not publish its XML field names, so the fields are named by the labels of Microsoft’s documentation.

FieldWhat it holds
Object DNDistinguished name of the object that was created (Microsoft's placeholder: the created object's DN).
Object classobjectClass of that object: computer or a class derived from it, the only classes the check covers according to MS-ADTS.
UserAccount that sent the add request. Members of Domain Admins and Enterprise Admins are not checked (MS-ADTS), so they do not appear here.
Client IP AddressAddress of the computer that sent the request. Microsoft documents no format.
Security descThe security descriptor that was attempted, as Microsoft's placeholder puts it. Microsoft does not document its format.

Values to know

User

ValueMeaningSignal
A domain join, imaging or provisioning accountA process creating computer accounts with more than it may writeDelegate the missing permission on a dedicated organizational unit before you enforce, as Microsoft advises.Noise
Any other accountA user who may create computer objects set attributes beyond that right, and succeededRead the new object in the directory and compare it with a computer account created the normal way.Attack signal

Object class

ValueMeaningSignal
computerA computer accountExpected
msDS-GroupManagedServiceAccountA group managed service account, a class derived from computerThe check covers every class derived from computer.Worth knowing

Volume and noise

The event comes from accounts that create computer objects with more than their permissions allow: domain join, imaging and provisioning tools and third-party products. These are the cases Microsoft wants found before enforcement, by reading the event and delegating the missing permission on a dedicated organizational unit rather than granting domain administrator rights.

Keeping it manageable

  • Keep every 3047: the rule matches the event ID alone, and each event is a request that succeeded.
  • Group by User: a known provisioning account that repeats the event needs its permission delegated before you enforce; any other account needs an investigation of the object it created.
  • Move the forest to enforcement once the list is clean. The events then become 3044, and a request that reaches the domain controller is refused instead of logged.

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Was the request in event 3047 blocked?

No. 3047 is an audit event: the domain controller detected a request that would have been blocked and allowed it because the check is in audit-only mode. The object was created. Event 3044 is the one that reports a denied request, in enforcement mode.

Is event 3047 normal?

It is expected in an updated forest that has not moved to enforcement, but Microsoft reads each event as a sign that a user might have excessive privileges to create computer accounts with arbitrary security-sensitive attributes. Every event deserves an explanation.

When can I move from audit mode to enforcement?

Microsoft's guidance is to wait until audit mode shows no unexpected privileges for a sufficient length of time, then set characters 28 and 29 of dSHeuristics to 1. Fix the provisioning accounts that the audit events name first.

References