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 4898 to its own Security log whenever it loads a template for the first time: at the start of Certificate Services one event for each template the CA issues, and for a template added while the CA is running, at the first enrollment attempt for it. The event carries the template's name, version, schema version, OID and distinguished name, the domain controller the CA read it from, the template content and its security descriptor.
Standalone CAs do not use templates and do not write it. A later change of a loaded template's settings writes 4899, and a change of its permissions writes 4900, both at the first enrollment after the change. The event names no account.
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| Computer | Audit | Note |
|---|---|---|
| Domain controllers | Success if needed and Failure if needed | Microsoft 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 servers | Success if needed and Failure if needed | Microsoft 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. |
| Workstations | Not logged | Microsoft says the AD CS role cannot be installed on a client operating system. |
auditpol /get /subcategory:"Certification Services"auditpol /set /subcategory:"Certification Services" /success:enable /failure:enableauditpol /get /subcategory:"{0CCE9221-69AE-11D9-BED3-505054503030}"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:
- The Audit Certification Services subcategory, Success and Failure (Microsoft's PKI monitoring guide asks for both).
- 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
16of the CA'sAuditFilterregistry value (all seven categories together are127). Microsoft's event table names this category; its monitoring guide calls it "Change CA settings" in the same place. - 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 4899 (template updated) 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.
| Field | What it holds | Since |
|---|---|---|
TemplateInternalName | Internal name of the template (the cn of the template object), shown before the version in the message. | v0 |
TemplateVersion | Version 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 |
TemplateSchemaVersion | Schema version of the template (msPKI-Template-Schema-Version), shown after "Schema V" in the message. | v0 |
TemplateOID | Object identifier of the template (msPKI-Cert-Template-OID). | v0 |
TemplateDSObjectFQDN | Distinguished name of the template object in the configuration partition, below CN=Certificate Templates,CN=Public Key Services,CN=Services. Use it to find the template's 5136 events on the domain controllers. | v0 |
Template ContentTemplateContentTemplate Information | The template's attributes as the CA loaded them, as text (shown as Template Content). Microsoft does not document the layout, so check an event from your own CA before you parse it. | v0 |
Security DescriptorSecurityDescriptorTemplate Information | The template's security descriptor as the CA loaded it (shown as Security Descriptor), which decides who may enroll for the template, edit it or own it. Microsoft does not document the format; check an event from your own CA before you parse it. | v0 |
Domain ControllerDCDNSNameAdditional Information | DNS name of the domain controller the CA read the template from (shown as Domain Controller). | v0 |
Values to know
TemplateInternalName
| Value | Meaning | Signal |
|---|---|---|
A template on the CA's expected list | Ordinary load at service start or first use | Expected |
A template that is not expected on this CA | A template newly published to the CA, or one you did not know it issuesMicrosoft advises alerting on it, and lists the addition of templates the CA does not normally issue among the CA activity to monitor. | Attack signal |
Template Content TemplateContent
| Value | Meaning | Signal |
|---|---|---|
Enrollee supplies subject (SubjectNameEnrolleeSupplies, 0x1 in msPKI-Certificate-Name-Flag) on a template whose certificates authenticate | The requester chooses whom the certificate namesMicrosoft's PKI guide lists templates that allow "supply in request" among the template scenarios to monitor; its Defender for Identity assessments list the option on templates valid for authentication as ESC1. | Attack signal |
An extended key usage that authenticates or acts for others: 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) or any purpose (2.5.29.37.0) | Certificates from the template can be used to sign in or to enroll on behalf of othersReview who may enroll (SecurityDescriptor). | Worth knowing |
Security Descriptor SecurityDescriptor
| Value | Meaning | Signal |
|---|---|---|
Enroll (the Certificate-Enrollment right, 0e10c968-78fb-11d2-90d4-00c04f79dc55) for Domain Users, Domain Computers or Authenticated Users on a template whose certificates authenticate | Everyone in the domain can request such certificatesMicrosoft's Defender for Identity assessments flag templates with an enrollment entry for a built-in unprivileged group. | Attack signal |
Write property, write DACL, write owner or full control for a built-in unprivileged group or another non-administrator | The principal can rewrite the templateMicrosoft's Defender for Identity assessments name such rights for a built-in unprivileged group ESC4. | Attack signal |
Enroll for specific groups with a business reason | Planned enrollment rights | Expected |
Volume and noise
Low. A burst of events at every start of Certificate Services, one per template the CA issues, and a single event when a new template is first used. Microsoft's PKI event table rates the event medium and advises alerting when a template that is not expected on the CA is loaded; Appendix L of its Active Directory monitoring guidance rates it low.
Keeping it manageable
- Keep the events of each start as the baseline of the templates the CA issues, their content and their permissions. Compare later 4899 and 4900 events, and the next start, with it.
- Keep a list of the templates each CA is expected to issue and alert on a
TemplateInternalNameoutside it, as Microsoft advises for this event. - A 4898 outside a restart is the first enrollment for a template newly added to the CA: match it with the change that published the template (it can appear as 4892, a change of the CA's template list, though Microsoft does not document which console actions write that event) and with the enrollment that followed (4886, 4887).
- Read
TemplateContentandSecurityDescriptorof templates whose certificates authenticate: an enrollee-supplied subject or an Enroll right for a broad group is the standing configuration Microsoft's template guidance asks you to review.
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>4898</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.4</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="TemplateContent">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>
<Data Name="SecurityDescriptor">O:S-1-5-21-1004336348-1177238915-682003330-519G:S-1-5-21-1004336348-1177238915-682003330-519D:PAI(OA;;CR;0e10c968-78fb-11d2-90d4-00c04f79dc55;;S-1-5-21-1004336348-1177238915-682003330-1170)(A;;CCDCLCSWRPWPDTLOSDRCWDWO;;;S-1-5-21-1004336348-1177238915-682003330-512)(A;;CCDCLCSWRPWPDTLOSDRCWDWO;;;S-1-5-21-1004336348-1177238915-682003330-519)(A;;LCRPLORC;;;AU)</Data>
</EventData>
</Event>Attacks this event reveals
No detection rule or detection logic in our library reads this event yet. It is documented here because it sits next to the events they read: it explains them, follows from them or is the trace a defender looks for around them (see Related events).
Frequently asked questions
Why does the CA write many 4898 events at once?
At every start of Certificate Services the CA loads each template it issues and writes one 4898 for each. A single 4898 while the CA is running is the first enrollment for a template newly added to the CA.
How do I use 4898 with 4899 and 4900?
4898 records a template as the CA loaded it, with its content and security descriptor. 4899 and 4900 record later changes with the old and the new values. Comparing the 4898 events of one start with those of the previous start can also show a change that no 4899 or 4900 recorded, for example one made while the CA was stopped, since after a restart the CA loads the changed template as new.
Why does our CA never write 4898?
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. Standalone CAs, which do not use templates, never write it.
References
- Securing PKI: Monitoring Public Key Infrastructure (Microsoft)
- Securing PKI: Appendix A: Events to Monitor (Microsoft)
- Audit Certification Services (Microsoft)
- Securing PKI: Appendix B: Certification Authority Audit Filter (Microsoft)
- Defender for Identity: certificates security posture assessments (Microsoft)
- X509CertificateTemplateSubjectNameFlag enumeration (Microsoft)
- Certificate-Enrollment extended right (Microsoft)
- PKI-Certificate-Template class (Microsoft)
- ObjectIdGroupId enumeration (extended key usage OIDs, Microsoft)
- Appendix L: Events to Monitor (Microsoft)