ANAVEM
Languagefr
Windows security monitoring dashboard showing certificate services and PKI audit events
Event ID 4867InformationSecurity-AuditingWindows

Windows Event ID 4867 – Security-Auditing: Certificate Services Template Security Descriptor Modified

Event ID 4867 fires when security permissions on a certificate template are modified in Active Directory Certificate Services, indicating changes to who can request or manage certificates.

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

What This Event Means

Event ID 4867 is generated by the Windows Security Auditing subsystem when modifications occur to the security descriptor of certificate templates stored in Active Directory. Certificate templates define the properties and permissions for certificate enrollment, including which users or groups can request certificates, the certificate validity period, key usage, and cryptographic parameters.

The security descriptor contains Access Control Lists (ACLs) that specify permissions such as Read, Enroll, Write, and Full Control for different security principals. When these permissions change through administrative actions, Windows logs Event ID 4867 to provide an audit trail of who made the change, when it occurred, and which template was affected.

This event is particularly significant in enterprise environments where certificate-based authentication is used for user logon, device authentication, secure email, or code signing. Unauthorized modifications to template permissions could allow attackers to request certificates they shouldn't have access to, potentially leading to impersonation attacks or unauthorized access to secured resources.

The event data includes the template name, the security principal making the change, the process used to make the modification, and details about the old and new security descriptors. This information enables security teams to correlate template changes with administrative activities and detect suspicious modifications that might indicate compromise or policy 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 scripts using PKI cmdlets to update template security descriptors
  • Group Policy changes affecting certificate template permissions
  • Direct LDAP modifications to certificate template objects in Active Directory
  • Automated certificate management tools updating template configurations
  • Migration or synchronization processes affecting certificate template permissions
  • Security principal changes (user/group deletions) triggering permission inheritance updates
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the specific details of Event ID 4867 to understand what template was modified and by whom.

  1. Open Event Viewer on the domain controller or CA server
  2. Navigate to Windows LogsSecurity
  3. Filter for Event ID 4867 using the filter option
  4. Double-click the event to view detailed information including:
    • Subject: User account that made the change
    • Template Name: Certificate template that was modified
    • Old Security Descriptor: Previous permissions
    • New Security Descriptor: Updated permissions
  5. Note the timestamp and correlate with any scheduled maintenance or administrative activities

Use PowerShell to query multiple events efficiently:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4867} -MaxEvents 50 | Select-Object TimeCreated, Id, @{Name='User';Expression={$_.Properties[1].Value}}, @{Name='Template';Expression={$_.Properties[4].Value}}
02

Verify Certificate Template Permissions

Check the current permissions on the affected certificate template to understand the impact of the changes.

  1. Open Certificate Authority console on the CA server
  2. Right-click Certificate Templates and select Manage
  3. Locate the template mentioned in Event ID 4867
  4. Right-click the template and select Properties
  5. Click the Security tab to review current permissions
  6. Document who has Enroll, Read, Write, and Full Control permissions
  7. Compare with your organization's PKI security policy

Use PowerShell to audit template permissions programmatically:

Import-Module ActiveDirectory
$templateName = "WebServer" # Replace with actual template name
$template = Get-ADObject -Filter "Name -eq '$templateName'" -SearchBase "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,$((Get-ADDomain).DistinguishedName)" -Properties nTSecurityDescriptor
$template.nTSecurityDescriptor.Access | Format-Table IdentityReference, AccessControlType, ActiveDirectoryRights -AutoSize
03

Analyze Security Descriptor Changes

Compare the old and new security descriptors to understand exactly what permissions were modified.

  1. Extract the security descriptor information from Event ID 4867
  2. Use the Security Descriptor Definition Language (SDDL) format shown in the event
  3. Convert SDDL strings to readable format for analysis

PowerShell script to decode SDDL from the event:

# Extract SDDL from Event 4867
$event = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4867} -MaxEvents 1
$oldSDDL = $event.Properties[5].Value
$newSDDL = $event.Properties[6].Value

# Convert SDDL to readable format
$oldSD = New-Object System.Security.AccessControl.DirectorySecurity
$oldSD.SetSecurityDescriptorSddlForm($oldSDDL)
$newSD = New-Object System.Security.AccessControl.DirectorySecurity
$newSD.SetSecurityDescriptorSddlForm($newSDDL)

Write-Host "Old Permissions:" -ForegroundColor Yellow
$oldSD.Access | Format-Table IdentityReference, AccessControlType, ActiveDirectoryRights
Write-Host "New Permissions:" -ForegroundColor Green
$newSD.Access | Format-Table IdentityReference, AccessControlType, ActiveDirectoryRights

This analysis helps identify whether permissions were added, removed, or modified for specific security principals.

04

Correlate with Administrative Activities

Cross-reference the template modification with other system events and administrative logs to establish context.

  1. Check Event ID 4624 (successful logon) around the same time for the user account
  2. Review Event ID 4648 (explicit credential use) if the change was made using different credentials
  3. Examine Certificate Services operational logs for related events
  4. Query Group Policy logs if the change might be policy-driven

PowerShell query to correlate events within a time window:

# Get Event 4867 timestamp and user
$templateEvent = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4867} -MaxEvents 1
$eventTime = $templateEvent.TimeCreated
$userName = $templateEvent.Properties[1].Value

# Look for related logon events within 1 hour
$startTime = $eventTime.AddHours(-1)
$endTime = $eventTime.AddHours(1)

$relatedEvents = Get-WinEvent -FilterHashtable @{
    LogName='Security'
    Id=4624,4648,4672
    StartTime=$startTime
    EndTime=$endTime
} | Where-Object {$_.Message -like "*$userName*"}

$relatedEvents | Select-Object TimeCreated, Id, LevelDisplayName, Message | Format-Table -Wrap

Also check Certificate Services logs:

Get-WinEvent -LogName "Microsoft-Windows-CertificateServicesClient-Lifecycle-System/Operational" -StartTime $startTime -EndTime $endTime | Select-Object TimeCreated, Id, LevelDisplayName, Message
05

Implement Monitoring and Alerting

Set up proactive monitoring to detect unauthorized certificate template modifications in real-time.

  1. Create a custom Event Viewer view for Event ID 4867
  2. Configure Windows Event Forwarding to centralize PKI audit events
  3. Set up automated alerts for critical template modifications

PowerShell script to create a scheduled task for monitoring:

# Create monitoring script
$monitorScript = @'
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4867; StartTime=(Get-Date).AddMinutes(-5)} | ForEach-Object {
    $templateName = $_.Properties[4].Value
    $user = $_.Properties[1].Value
    $timestamp = $_.TimeCreated
    
    # Send alert for critical templates
    if ($templateName -in @("Administrator", "DomainController", "WebServer")) {
        $subject = "ALERT: Critical Certificate Template Modified"
        $body = "Template: $templateName`nUser: $user`nTime: $timestamp"
        # Add your alerting mechanism here (email, SIEM, etc.)
        Write-EventLog -LogName Application -Source "PKI Monitor" -EventId 1001 -EntryType Warning -Message $body
    }
}
'@

# Save script and create scheduled task
$monitorScript | Out-File -FilePath "C:\Scripts\PKIMonitor.ps1" -Encoding UTF8

$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-ExecutionPolicy Bypass -File C:\Scripts\PKIMonitor.ps1"
$trigger = New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Minutes 5) -RepetitionDuration (New-TimeSpan -Days 365) -Once -At (Get-Date)
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount

Register-ScheduledTask -TaskName "PKI Template Monitor" -Action $action -Trigger $trigger -Principal $principal -Description "Monitor certificate template security changes"

Pro tip: Configure Event Forwarding to send Event ID 4867 to a central SIEM or log management system for enterprise-wide PKI monitoring and correlation with other security events.

Overview

Event ID 4867 fires when the security descriptor of a certificate template is modified in Active Directory Certificate Services (AD CS). This event captures changes to permissions that control who can enroll for certificates, manage templates, or perform administrative actions on certificate templates. The event appears in the Security log on domain controllers and Certificate Authority servers when administrators modify template permissions through the Certificate Templates console, PowerShell cmdlets, or direct LDAP modifications.

This audit event is crucial for PKI security monitoring as certificate template permissions directly impact who can obtain certificates for authentication, encryption, or code signing. Unauthorized changes to template security descriptors can lead to privilege escalation, unauthorized certificate issuance, or compromise of the entire PKI infrastructure. The event provides detailed information about the modified template, the user making the change, and the specific security descriptor modifications.

Organizations with mature PKI deployments rely on Event ID 4867 to track template permission changes, ensure compliance with security policies, and detect potential insider threats or misconfigurations that could weaken certificate-based security controls.

Frequently Asked Questions

What does Event ID 4867 indicate about certificate template security?+
Event ID 4867 indicates that the security descriptor (permissions) of a certificate template has been modified. This includes changes to who can enroll for certificates using that template, manage the template, or perform administrative actions. The event captures both the old and new security descriptors, allowing administrators to see exactly what permissions were changed, added, or removed.
Should I be concerned about frequent Event ID 4867 occurrences?+
Frequent Event ID 4867 events warrant investigation, especially if they're unexpected. While legitimate administrative activities can generate these events during PKI maintenance or policy updates, frequent modifications could indicate misconfigurations, automated processes gone wrong, or potential security issues. Establish a baseline of normal template modification patterns and investigate deviations, particularly changes to critical templates like Administrator, Domain Controller, or code signing templates.
How can I determine if Event ID 4867 represents unauthorized changes?+
To identify unauthorized changes, correlate Event ID 4867 with your change management processes and administrative schedules. Check if the modification was performed by an authorized administrator during approved maintenance windows. Review the specific permissions that were changed - additions of Enroll rights to unexpected users or groups are particularly concerning. Cross-reference with logon events (4624, 4648) to verify the administrative session context and ensure the changes align with documented PKI policies.
Can Event ID 4867 help detect PKI-based attacks?+
Yes, Event ID 4867 is valuable for detecting PKI-based attacks, particularly those involving privilege escalation through certificate template manipulation. Attackers might modify template permissions to grant themselves enrollment rights for high-privilege certificates. Monitor for unexpected changes to sensitive templates, especially those used for domain controller authentication, administrator certificates, or code signing. Rapid successive modifications or changes made outside business hours should trigger immediate investigation.
What information does Event ID 4867 provide for forensic analysis?+
Event ID 4867 provides comprehensive forensic data including the exact timestamp of the modification, the user account that made the change, the process used to make the modification, the affected certificate template name, and both the old and new security descriptors in SDDL format. This allows forensic analysts to reconstruct the timeline of template changes, identify the scope of permission modifications, and correlate with other security events to build a complete picture of administrative or potentially malicious activities affecting the PKI 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...