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

Event ID 3046: The directory service denied an LDAP modify request for the following object

In enforcement mode of the CVE-2021-42291 checks, a domain controller refused a change to the security descriptor of an existing computer object that relied on owner rights. A blocked attempt to rewrite a computer account's permissions.

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, notes that creators and owners of a computer account could modify its security-sensitive attributes after creating it. Its second protection temporarily removes the implicit rights of the owner when a user without domain administrator rights writes the security descriptor of a computer-derived object with an LDAP modify operation, and checks whether the write would be allowed without them. A domain controller in enforcement mode writes 3046 when it denies such a request: the client included an nTSecurityDescriptor attribute in the modify request but has no explicit permission to write one or more parts of the new security descriptor, judged against the object's existing 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) says what is removed: the owner of a security descriptor is implicitly granted READ_CONTROL and WRITE_DAC, and these rights are blocked when character 29 of dSHeuristics is 1, the requester is a member of neither Domain Admins nor Enterprise Admins, and the object is a computer or a class derived from it.

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 by character 29 of the dSHeuristics attribute on CN=Directory Service,CN=Windows NT,CN=Services in the configuration partition. KB5008383 defines 0 as audit mode (the default after the update, and the value when the character is not set), 1 as enforcement and 2 as disabled, which Microsoft does not recommend. This event appears only at 1; at 0 the same request is allowed and logged as 3049. 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

Microsoft's guidance is to stay in audit mode until the audit events show no unexpected privileges for a sufficient time, then set characters 28 and 29 to 1, keeping every other character of the string (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 existing object whose security descriptor the request tried to change. Microsoft's placeholder still calls it 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 modify request (Microsoft's placeholder reads: the user who attempted the LDAP add). Members of Domain Admins and Enterprise Admins are not checked (MS-ADTS).
Client IP AddressAddress of the computer that sent the request. Microsoft documents no format.

Values to know

User

ValueMeaningSignal
A provisioning or management account that owns the computer objects it handlesA process relying on owner rights to change permissionsGrant it the explicit permission on a dedicated organizational unit, as Microsoft advises.Noise
Any other accountThe owner of a computer object tried to rewrite its permissionsWhat CVE-2021-42291 allowed after creation, blocked here. Check the object and the account's other activity.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 own computer objects, usually because they created them, and rewrite their permissions afterwards: provisioning and deployment processes and 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 3046: the rule matches the event ID alone, and the event is rare once processes have explicit rights.
  • Group by User and Object DN: one account changing the permissions of many computer objects, or of a server it has no reason to manage, is 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 security descriptor changed when event 3046 was logged?

No. 3046 says that the domain controller denied the modify request. In audit mode the same change is allowed and logged as 3049.

Why does an owner lose the right to change the permissions of its own computer object?

Microsoft's fix for CVE-2021-42291 removes the implicit owner rights for this check, because creators and owners could otherwise set security-sensitive values on the account. A user without domain administrator rights now needs an explicit permission, granted by an access control entry, to write the security descriptor.

Which setting produces event 3046?

Character 29 of dSHeuristics at 1 (enforcement) on a forest whose writable domain controllers have the November 9, 2021 or later updates. At 0, the default, the event is 3049 and the change is allowed.

References