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

Event ID 4899: A Certificate Services template was updated

Written by an AD CS enterprise CA when a certificate template it has loaded was changed in Active Directory and someone then enrolls for it, with the old and the new template content. Logged at that enrollment, not at the change.

Log source
Windows Security log
Detection value
Supporting
Volume
Low (estimate)
Last updated
Audit subcategory
Audit Certification Services (Object Access, Success and Failure)
Logged on
Certification authority servers only
Event versions
0
Detects
1 attack (1 rule)
MITRE ATT&CK
1 technique in 1 tactic
Threat groups
2 groups that MITRE ATT&CK records using these techniques
Fields the rules read
The event ID and the provider only

When it is written

Certificate templates are objects in Active Directory, and an enterprise certification authority (CA) loads the templates it issues. Microsoft documents that the CA writes 4899 to its own Security log when a template it has loaded has an attribute updated and an enrollment is then attempted for that template. The event is therefore written at the first enrollment after the change, not when the template is edited, and a template changed back before anyone enrolls leaves no 4899. It carries the template's name, version, schema version, OID and distinguished name, the domain controller the CA read it from, and the template content before and after the change.

The event names no account: the edit itself is a directory change, which domain controllers record as 5136 when the Certificate Templates container has a matching auditing entry. Standalone CAs do not use templates and do not write it. A change of the template's permissions writes 4900 instead.

How to turn it on

Advanced audit policy subcategory Audit Certification Services, Success and Failure. Set it in a Group Policy object linked to the computers that write the event:

Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > Audit Policies > Object Access > Audit Certification Services
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersSuccess if needed and Failure if neededMicrosoft marks every column "IF" (the same in its general and stronger baselines). Enable the subcategory when the server has the Active Directory Certificate Services role installed and you need to monitor AD CS events.
Member serversSuccess if needed and Failure if neededMicrosoft marks every column "IF" (the same in its general and stronger baselines). Enable the subcategory when the server has the Active Directory Certificate Services role installed and you need to monitor AD CS events.
WorkstationsNot loggedMicrosoft says the AD CS role cannot be installed on a client operating system.
Check the current setting
auditpol /get /subcategory:"Certification Services"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"Certification Services" /success:enable /failure:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9221-69AE-11D9-BED3-505054503030}"
Based on vendor documentation.

Run the commands in an elevated prompt on a computer that writes the event. Subcategory settings take effect only when the security option Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings is enabled (the default), and a Group Policy object that sets advanced audit policy replaces local changes at its next refresh. Microsoft's advanced audit policy reference

Three settings must all be on, on every enterprise CA server:

  1. The Audit Certification Services subcategory, Success and Failure (Microsoft's PKI monitoring guide asks for both).
  2. The Change CA security settings category in the CA's own audit filter: the Auditing tab of the CA's properties in the Certification Authority console, or bit value 16 of the CA's AuditFilter registry value (all seven categories together are 127). Microsoft's event table names this category; its monitoring guide calls it "Change CA settings" in the same place.
  3. The policy module flag EDITF_AUDITCERTTEMPLATELOAD, which Microsoft's monitoring guide sets with certutil -setreg policy\EditFlags +EDITF_AUDITCERTTEMPLATELOAD. Restart Certificate Services afterwards, as for the audit filter.

The same settings produce 4898 (the CA loaded a template) and 4900 (template security updated).

Fields

In Event Viewer order. The field names are those of the event XML, from the event template that ships with Windows.

FieldWhat it holdsSince
TemplateInternalNameInternal name of the template (the cn of the template object), shown before the version in the message.v0
TemplateVersionVersion of the template, shown after "v" in the message. A template object keeps its major version in the revision attribute and its minor version in msPKI-Template-Minor-Revision.v0
TemplateSchemaVersionSchema version of the template (msPKI-Template-Schema-Version), shown after "Schema V" in the message.v0
TemplateOIDObject identifier of the template (msPKI-Cert-Template-OID).v0
TemplateDSObjectFQDNDistinguished name of the template object in the configuration partition, below CN=Certificate Templates,CN=Public Key Services,CN=Services. Use it to find the 5136 events of the change.v0
Old Template ContentOldTemplateContentTemplate Change InformationThe template's attributes as the CA had loaded them before the change (shown as Old Template Content). Compare it with NewTemplateContent to see what changed.v0
New Template ContentNewTemplateContentTemplate Change InformationThe template's attributes after the change, as text (shown as New Template Content). Microsoft does not document the layout, so check an event from your own CA before you parse it.v0
Domain ControllerDCDNSNameAdditional InformationDNS name of the domain controller the CA read the template from (shown as Domain Controller).v0

Values to know

New Template Content NewTemplateContent

ValueMeaningSignal
Enrollee supplies subject (SubjectNameEnrolleeSupplies, 0x1 in msPKI-Certificate-Name-Flag)The requester chooses the subject of the certificateOn a template whose certificates authenticate, the requester can name another account. Microsoft's PKI guide lists templates that allow "supply in request" among the changes to monitor.Attack signal
A new extended key usage: client authentication (1.3.6.1.5.5.7.3.2), smart card logon (1.3.6.1.4.1.311.20.2.2), certificate request agent (1.3.6.1.4.1.311.20.2.1), code signing (1.3.6.1.5.5.7.3.3) or any purpose (2.5.29.37.0)The certificates gain a sensitive useAttack signal
Manager approval removed (EnrollmentPendAllRequests, 0x2 in msPKI-Enrollment-Flag) or fewer authorized signatures (msPKI-RA-Signature)Requests are no longer reviewed before issuanceAttack signal
A new minor version, validity period or key sizeRoutine template maintenanceExpected

TemplateInternalName

ValueMeaningSignal
A template whose certificates authenticate (user, smart card logon, domain controller) or act for others (enrollment agent)Changes here affect sign-in or enrollment on behalf of othersReview these first.Attack signal
Other templatesServer, encryption or signing templatesWorth knowing

Volume and noise

Low. One event per changed template, at the first enrollment after the change. Template maintenance by PKI administrators (a new minor version, a longer validity period, new enrollment permissions handled by 4900) is the usual source. Microsoft rates the event medium.

Keeping it manageable

  • Keep every event: the volume is low and the rule matches on the event ID alone.
  • Compare OldTemplateContent with NewTemplateContent and raise the priority for the changes Microsoft's PKI guide names: new extended key usages (code signing, enrollment agent, smart card logon), or a template that now lets the enrollee supply the subject.
  • Match each event with the 5136 events for the same template object (TemplateDSObjectFQDN) on the domain controllers, which give the account and the time of the change.

Sample event

Version 0, with made-up values.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" />
    <EventID>4899</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
    <EventRecordID>1048576</EventRecordID>
    <Correlation />
    <Execution ProcessID="712" ThreadID="2408" />
    <Channel>Security</Channel>
    <Computer>CA01.corp.example.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="TemplateInternalName">CorpWebServer</Data>
    <Data Name="TemplateVersion">100.5</Data>
    <Data Name="TemplateSchemaVersion">2</Data>
    <Data Name="TemplateOID">1.3.6.1.4.1.311.21.8.4718251.2013977.12519542.9831145.8806221.240.1846272.6034531</Data>
    <Data Name="TemplateDSObjectFQDN">CN=CorpWebServer,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=corp,DC=example,DC=com</Data>
    <Data Name="DCDNSName">DC01.corp.example.com</Data>
    <Data Name="NewTemplateContent">pKIExpirationPeriod = 2 Years
pKIExtendedKeyUsage = 1.3.6.1.5.5.7.3.1 Server Authentication
msPKI-Certificate-Name-Flag = 0x1
msPKI-Template-Minor-Revision = 5</Data>
    <Data Name="OldTemplateContent">pKIExpirationPeriod = 1 Years
pKIExtendedKeyUsage = 1.3.6.1.5.5.7.3.1 Server Authentication
msPKI-Certificate-Name-Flag = 0x1
msPKI-Template-Minor-Revision = 4</Data>
  </EventData>
</Event>

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Why is event 4899 written long after the template was changed?

Microsoft documents that the CA writes it when a template it has loaded was updated and an enrollment is then attempted for that template. The event marks the first use of the changed template on that CA, which can be days after the edit, and a change that is reverted before anyone enrolls produces no 4899 at all.

Does 4899 show who changed the template?

No. The event has no account fields. The template is an Active Directory object, so the domain controllers record the change as 5136 with the account, provided the Certificate Templates container has an auditing entry. TemplateDSObjectFQDN gives the object to search for.

Why does our CA never write 4899?

The event needs the Audit Certification Services subcategory, the "Change CA security settings" category in the CA's audit filter and the policy module flag EDITF_AUDITCERTTEMPLATELOAD, then a restart of Certificate Services. It is written only on enterprise CAs, and only when a changed template is used for an enrollment.

What is the difference between 4899 and 4900?

4899 records a change of the template's attributes (its settings), 4900 a change of its security descriptor (who may enroll in it, edit it or own it). Both come at the first enrollment after the change.

References