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

Event ID 3045: The directory service denied an LDAP add request for the following object

In enforcement mode of the CVE-2021-42291 checks, a domain controller refused to create a computer object whose request carries a security descriptor the requester may not write. A blocked attempt at a permissive new account.

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. Microsoft describes the vulnerability as an LDAP add that creates a computer account with overly permissive access to its security descriptor. A domain controller in enforcement mode writes 3045 when it denies an add request for a computer or computer-derived object because the request includes an nTSecurityDescriptor attribute and the client has no explicit permission to write one or more parts of that new security descriptor, judged against the default merged security descriptor. The event names the object, its class, the user and the client address. Microsoft documents it with the event type Warning, although the request was denied.

The protocol specification (MS-ADTS) explains "explicit": the requester must be granted WRITE_DAC on the default security descriptor by an access control entry, not merely by being its owner. In the add check (character 28 of dSHeuristics at 1) it refuses a supplied security descriptor without that right when implicit owner rights are also blocked, which character 29 controls; members of Domain Admins and Enterprise Admins are not checked, and only computer and its derived classes are.

The event exists only on writable domain controllers with the November 9, 2021 or later updates; LDAP add and modify operations cannot target read-only domain controllers.

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.

Enforcement is set forest-wide in dSHeuristics on CN=Directory Service,CN=Windows NT,CN=Services in the configuration partition: character 28 for the add checks and character 29 for implicit owner rights, each 0 for audit mode (the default after the update), 1 for enforcement and 2 for disabled. KB5008383 does not tie 3045 to one of the two characters and tells administrators to set both to 1 for enforcement; MS-ADTS refuses the security descriptor in the add check only when character 28 is 1 and implicit owner rights are blocked (character 29 at 1). At audit mode the same request is allowed and logged as 3048. 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

When editing the string, keep every other character; in a string of 10 characters or more the 10th must be 1, in one of 20 or more the 20th must be 2.

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 the request would have 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.

Values to know

User

ValueMeaningSignal
A domain join, imaging or provisioning accountA process that sets its own security descriptor on new computer objectsDelegate the missing permission on a dedicated organizational unit, as Microsoft advises.Noise
Any other accountA user who may create computer objects tried to give one a security descriptor of its choiceWhat CVE-2021-42291 allowed, blocked here. Look at what else the account did.Attack signal

Object class

ValueMeaningSignal
computerA computer accountExpected
msDS-GroupManagedServiceAccountA group managed service account, a class derived from computerWorth knowing

Volume and noise

The event comes from accounts that create computer objects with a security descriptor of their own and were not adjusted before enforcement, typically provisioning and deployment processes or third-party products. Microsoft's guidance is to read the event, find the permission the process needs and delegate that limited right on a dedicated organizational unit, not to add the account to Domain Admins.

Keeping it manageable

  • Keep every 3045: the rule matches the event ID alone, and the event is rare once provisioning accounts have the rights they need.
  • Group by User and treat any account that is not a known provisioning process as a finding.
  • Collect the Directory Service log of every writable domain controller: only the one that received the request writes the event.

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Was the computer object created when event 3045 was logged?

No. 3045 says that the domain controller denied the add request. The audit mode event for the same situation is 3048, after which the object exists with the security descriptor that was asked for.

What is the difference between 3044 and 3045?

Both are denied add requests for computer objects. 3044 is about attributes the requester may not write; 3045 is about a security descriptor (nTSecurityDescriptor) included in the request that the requester has no explicit permission to write.

Which dSHeuristics character makes event 3045 appear?

KB5008383 does not say which one, and tells administrators to set characters 28 and 29 to 1 for enforcement. The protocol specification refuses the security descriptor only when the add check is enforced (character 28 at 1) and implicit owner rights are blocked (character 29 at 1).

References