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

Event ID 3049: The directory service detected an LDAP modify 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 rewrite the security descriptor of an existing computer object using only owner rights, and logged it. The change was made. 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, notes that creators and owners of a computer account could modify its security-sensitive attributes after creating it. Its second protection 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. In audit mode, the default after the update, a domain controller writes 3049 when such a write would have been blocked: the client has no explicit permission to write one or more parts of the new security descriptor. The request is allowed to proceed, so the change was made. The event names the object, its class, the user and the client address.

Microsoft's event text for 3049 says that the attribute was included "in the add request", although the event is about a modify request; the enforcement twin 3046 says modify. The protocol specification (MS-ADTS) describes what is removed: the implicit READ_CONTROL and WRITE_DAC of the owner, for requesters outside Domain Admins and Enterprise Admins, on computer and derived classes.

The event exists only on writable domain controllers with the November 9, 2021 or later updates; domain controllers without the update log nothing for these requests and 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 29 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 change is denied and logged as 3046; at 2 the check and its events are off (event 3055 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

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 was changed. 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 permissionsGive it the explicit permission on a dedicated organizational unit before you enforce.Noise
Any other accountThe owner of a computer object rewrote its permissions, and succeededWhat CVE-2021-42291 allowed after creation. Read the object's security descriptor now.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 change their permissions afterwards: provisioning and deployment processes and third-party products. Microsoft wants these found before enforcement and fixed by delegating the missing permission on a dedicated organizational unit.

Keeping it manageable

  • Keep every 3049: the rule matches the event ID alone, and each event is a change that was made.
  • Read the security descriptor of the object named in the event and look for entries that grant the creator or another account rights over security-sensitive attributes.
  • 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.

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Was the change in event 3049 blocked?

No. It is an audit event: the domain controller allowed the change because the check is in audit-only mode. Event 3046 is the denial, in enforcement mode.

Why does the text of event 3049 mention an add request?

Microsoft's published text for 3049 says that the attribute was included in the add request, although the first sentence and the scenario are about a modify request. The enforcement event 3046 uses modify throughout. Treat 3049 as a modify of an existing object.

How do I see what the change was?

The event does not include the new security descriptor. Read it on the object named in the event, or in event 5136 if an audit entry on the object records changes to its security descriptor.

References