ANAVEM
Languagefr
Windows Certificate Authority management console showing certificate templates and security event logs
Event ID 4872InformationMicrosoft-Windows-Security-AuditingWindows

Windows Event ID 4872 – Microsoft-Windows-Security-Auditing: Certificate Services Template Security Permissions Changed

Event ID 4872 fires when security permissions on a Certificate Authority template are modified. This audit event tracks changes to certificate template access control lists and helps monitor PKI security modifications.

Emanuel DE ALMEIDAEmanuel DE ALMEIDA
18 March 20269 min read 0
Event ID 4872Microsoft-Windows-Security-Auditing 5 methods 9 min
Event Reference

What This Event Means

Event ID 4872 represents a critical security audit point in Windows Certificate Services infrastructure. When this event fires, it indicates that someone has modified the security descriptor of a certificate template, which directly impacts who can enroll for certificates using that template and what level of access they have to the template itself.

The event contains detailed information including the Security ID (SID) of the account that made the change, the name of the certificate template that was modified, the previous security descriptor, and the new security descriptor. This information is essential for security teams to track changes to PKI infrastructure and ensure that only authorized personnel are modifying certificate template permissions.

In Windows Server 2025 and the latest 2026 updates, this event has been enhanced with additional context information and improved formatting for better readability in security information and event management (SIEM) systems. The event helps organizations maintain compliance with security frameworks that require detailed auditing of certificate authority operations, such as Common Criteria evaluations and various industry compliance standards.

Understanding this event is particularly important for organizations that have implemented certificate-based authentication, code signing, or other PKI-dependent security mechanisms. Improper template permissions could allow unauthorized certificate enrollment, leading to potential security breaches or compliance violations.

Applies to

Windows Server 2019Windows Server 2022Windows Server 2025
Analysis

Possible Causes

  • Administrator modifying certificate template permissions through Certificate Templates MMC snap-in
  • PowerShell commands changing template ACLs using PKI module cmdlets
  • Group Policy changes affecting certificate template security settings
  • Automated scripts or applications programmatically modifying template permissions
  • Certificate Services configuration changes during CA maintenance or updates
  • Third-party PKI management tools making template permission adjustments
  • Active Directory replication events affecting certificate template objects
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the specific details of the Event ID 4872 to understand what changed and who made the modification.

  1. Open Event Viewer on the Certificate Authority server
  2. Navigate to Windows LogsSecurity
  3. Filter for Event ID 4872 using the filter option
  4. Double-click the event to view detailed information
  5. Review the following key fields:
    • Subject: Account that made the change
    • Template Name: Certificate template that was modified
    • Old Security Descriptor: Previous permissions
    • New Security Descriptor: Current permissions

Use PowerShell to query multiple events:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4872} -MaxEvents 50 | Format-Table TimeCreated, Id, LevelDisplayName, Message -Wrap
Pro tip: Export events to CSV for detailed analysis: Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4872} | Export-Csv -Path C:\Temp\Event4872.csv -NoTypeInformation
02

Analyze Certificate Template Permissions

Verify the current certificate template permissions and compare them with organizational security policies.

  1. Open Certificate Templates MMC snap-in on the CA server
  2. Right-click the affected template and select Properties
  3. Click the Security tab to review current permissions
  4. Document the current ACL settings for comparison
  5. Use PowerShell to enumerate template permissions:
# Get certificate template information
Get-CATemplate | Where-Object {$_.Name -eq "YourTemplateName"} | Format-List *

# Check template permissions using ADSI
$templateDN = "CN=YourTemplateName,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=com"
$template = [ADSI]"LDAP://$templateDN"
$template.nTSecurityDescriptor

Compare the security descriptor from the event with the current template permissions to identify exactly what changed.

Warning: Always verify template permissions against your organization's PKI security policy before making any changes.
03

Investigate User Account and Authentication Context

Determine if the account that made the change was authorized and investigate the authentication context.

  1. Identify the user account from the event's Subject field
  2. Check if the account has legitimate administrative rights:
# Check group membership for the user
Get-ADUser -Identity "username" -Properties MemberOf | Select-Object -ExpandProperty MemberOf

# Verify Certificate Authority administrative permissions
Get-ADGroupMember -Identity "Cert Publishers" | Where-Object {$_.Name -eq "username"}
Get-ADGroupMember -Identity "Enterprise Admins" | Where-Object {$_.Name -eq "username"}
  1. Review logon events around the same time to understand the authentication context:
# Look for logon events from the same user around the time of the template change
$startTime = (Get-Date).AddHours(-2)
$endTime = (Get-Date).AddHours(2)
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624,4625; StartTime=$startTime; EndTime=$endTime} | Where-Object {$_.Message -like "*username*"}

Cross-reference with change management records to verify if this was a planned modification.

04

Enable Enhanced PKI Auditing and Monitoring

Configure comprehensive auditing to prevent unauthorized template modifications and improve detection capabilities.

  1. Enable advanced audit policies for Certificate Services:
# Enable Certificate Services audit policy
auditpol /set /subcategory:"Certification Services" /success:enable /failure:enable

# Enable Object Access auditing for detailed tracking
auditpol /set /subcategory:"Directory Service Access" /success:enable /failure:enable
  1. Configure Group Policy for enhanced PKI auditing:
    • Open Group Policy Management Console
    • Navigate to Computer ConfigurationPoliciesWindows SettingsSecurity SettingsAdvanced Audit Policy Configuration
    • Enable Audit Certification Services for both success and failure
  2. Set up automated monitoring using PowerShell:
# Create a scheduled task to monitor Event ID 4872
$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-File C:\Scripts\Monitor-CertTemplateChanges.ps1"
$trigger = New-ScheduledTaskTrigger -AtStartup
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount
Register-ScheduledTask -TaskName "Monitor Certificate Template Changes" -Action $action -Trigger $trigger -Principal $principal
Pro tip: Implement SIEM integration to correlate Event ID 4872 with other security events for comprehensive threat detection.
05

Implement Certificate Template Change Control

Establish proper change control procedures and technical controls to prevent unauthorized certificate template modifications.

  1. Create a baseline of all certificate template permissions:
# Export all certificate template configurations
$templates = Get-CATemplate
$baseline = @()
foreach ($template in $templates) {
    $templateInfo = @{
        Name = $template.Name
        DisplayName = $template.DisplayName
        Permissions = (Get-ACL "AD:\CN=$($template.Name),CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,$((Get-ADDomain).DistinguishedName)").Access
    }
    $baseline += $templateInfo
}
$baseline | Export-Clixml -Path "C:\PKI\TemplateBaseline-$(Get-Date -Format 'yyyyMMdd').xml"
  1. Implement template permission monitoring script:
# Monitor template changes and send alerts
$lastCheck = (Get-Date).AddMinutes(-15)
$events = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4872; StartTime=$lastCheck}
if ($events) {
    $alertMessage = "Certificate template permissions changed: $($events.Count) events detected"
    # Send email alert or write to monitoring system
    Write-EventLog -LogName Application -Source "PKI Monitor" -EventId 1001 -Message $alertMessage
}
  1. Configure template security using PowerShell DSC or Group Policy to maintain consistent permissions
  2. Implement approval workflows for template modifications using PowerShell workflows or third-party change management systems
Warning: Always test template permission changes in a lab environment before implementing in production to avoid disrupting certificate enrollment processes.

Overview

Event ID 4872 is a security audit event that fires whenever an administrator modifies the security permissions on a Certificate Authority (CA) certificate template. This event is part of Windows Advanced Audit Policy and specifically tracks changes to certificate template Access Control Lists (ACLs). The event appears in the Security log and provides detailed information about who made the change, which template was affected, and what specific permissions were modified.

This event is crucial for PKI security monitoring in enterprise environments running Active Directory Certificate Services (AD CS). Certificate templates control who can request specific types of certificates and what permissions they have during the enrollment process. Unauthorized changes to these permissions could lead to certificate abuse, privilege escalation, or compromise of the entire PKI infrastructure.

The event fires on Certificate Authority servers when template permissions are modified through the Certificate Templates MMC snap-in, PowerShell commands, or programmatic changes via the Certificate Services APIs. It captures both successful permission changes and provides an audit trail for compliance and security investigations.

Frequently Asked Questions

What does Event ID 4872 specifically track in Windows Certificate Services?+
Event ID 4872 tracks security permission changes on Certificate Authority certificate templates. It fires whenever an administrator modifies the Access Control List (ACL) of a certificate template, capturing details about who made the change, which template was affected, and both the old and new security descriptors. This event is essential for maintaining PKI security and compliance in enterprise environments.
How can I determine if an Event ID 4872 represents an unauthorized change?+
To identify unauthorized changes, cross-reference the event timestamp with your change management records and verify that the user account in the Subject field has legitimate administrative rights. Check the user's group memberships, review concurrent logon events, and compare the permission changes against your organization's PKI security policy. Unexpected changes outside of maintenance windows or from non-administrative accounts should be investigated immediately.
Can Event ID 4872 help with compliance auditing for certificate services?+
Yes, Event ID 4872 is crucial for compliance auditing as it provides a complete audit trail of certificate template permission changes. The event includes detailed information about who made changes, when they occurred, and exactly what permissions were modified. This data helps organizations demonstrate compliance with security frameworks that require detailed PKI auditing, such as Common Criteria evaluations and industry-specific compliance standards.
What should I do if I see frequent Event ID 4872 occurrences without corresponding change requests?+
Frequent unexpected Event ID 4872 events may indicate unauthorized access to your Certificate Authority or automated processes making unplanned changes. Immediately review the user accounts involved, check for compromised administrative credentials, and verify that no unauthorized software or scripts are modifying template permissions. Consider implementing additional access controls, enabling enhanced auditing, and requiring approval workflows for template modifications.
How does Event ID 4872 relate to other Certificate Services security events?+
Event ID 4872 is part of a broader set of Certificate Services audit events. It often correlates with Event ID 4868 (certificate template loaded), Event ID 4870 (certificate services revoked a certificate), and various certificate enrollment events (4886-4888). Analyzing these events together provides comprehensive visibility into PKI operations and helps identify patterns that might indicate security issues or operational problems with your certificate infrastructure.
Documentation

References (2)

Emanuel DE ALMEIDA
Written by

Emanuel DE ALMEIDA

Senior IT Journalist & Cloud Architect

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

You must be logged in to comment.

Loading comments...