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

Event ID 4877: Certificate Services backup completed

Written by an AD CS certification authority when a backup of the CA finishes, with the account that ran it. It closes the backup that 4876 opened; a CA backup can hold the CA's private key, so both belong to a planned backup.

Log source
Windows Security log
Detection value
Context
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
Not read by our detection rules yet

When it is written

A certification authority (CA) running Active Directory Certificate Services writes 4877 to its own Security log when a backup of the CA completes. The start of the same backup is 4876, which also gives the backup type. Windows' event template for 4877 carries only the account that ran the backup (in the event data, not in the message text): neither event says where the backup was written or whether it holds the CA's private key.

Microsoft's backup command copies the CA database and, unless it is told to copy the database only, the CA certificate and private key into a .p12 file next to it. Microsoft's CA administration guidance requires a CA administrator for the backup and asks for the files to be protected as sensitive recovery material. The event needs the Audit Certification Services subcategory on the CA server and the "Back up and restore the CA database" category in the CA's own audit filter.

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

Two settings must both be on, on every CA server:

  1. The Audit Certification Services subcategory, Success and Failure (Microsoft's PKI monitoring guide asks for both).
  2. The Back up and restore the CA database category in the CA's own audit filter: the Auditing tab of the CA's properties in the Certification Authority console, or bit value 2 of the CA's AuditFilter registry value (all seven categories together are 127). Microsoft's procedure restarts Certificate Services after the filter is changed. To read the current value on the CA: certutil -getreg CA\AuditFilter.

Microsoft's audit filter category describes backup and restore commands sent to the CA database. It does not say whether a backup of the CA key alone writes 4876 and 4877, so do not rely on them as the only record of a key export.

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
SubjectUserSidSID of the account that ran the backup. Not shown in the message text; read it from the event data (the XML or the Details tab). Event Viewer resolves it to a name.v0
SubjectUserNameName of the account that ran the backup. Not shown in the message text.v0
SubjectDomainNameDomain of that account, as a NetBIOS name. Not shown in the message text.v0
SubjectLogonIdLogon ID of the session that ran the backup, in hexadecimal. The same value as in the 4876 that started it, and in the logon event (4624) of that session on the CA server. Not shown in the message text.v0

Values to know

SubjectUserName

ValueMeaningSignal
The backup service account or a CA administrator on the backup schedulePlanned backupExpected
Any other account, or a backup outside the scheduleAn unplanned copy of the CAMicrosoft's default backup holds the CA certificate and private key, which let their holder sign certificates as the CA. Find out where the files were written and who can read them.Worth knowing

Volume and noise

Low. One event per backup run, so a scheduled backup gives a regular pattern of the same account at the same time of day, each 4877 shortly after its 4876. Manual backups before a migration, an upgrade or a change to the CA also write it. Microsoft rates the event low.

Keeping it manageable

  • Keep every event: there are few, and the account in it is the only record of who finished the copy.
  • Pair each 4877 with the 4876 of the same account just before it. A 4876 with no 4877 is a backup that did not finish or whose end was not collected; Microsoft documents no separate failure event for a backup.
  • Record the schedule and the accounts of planned backups, including backup software, and review the backups outside them: the copy is complete once 4877 is written, so find out where the files went.
  • Check SubjectLogonId against the logon events (4624) of the CA server to see whether the backup was run on the server itself or over the network.

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>4877</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="SubjectUserSid">S-1-5-21-1004336348-1177238915-682003330-1162</Data>
    <Data Name="SubjectUserName">svc-cabackup</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x7a41c3</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

Does event 4877 say where the CA backup went or whether it holds the private key?

No. Its template carries only the account. Microsoft's backup command includes the CA certificate and private key by default and leaves them out when told to back up the database only; the event does not say which, so ask the account that ran it and check the backup location.

Why is there a 4876 without a 4877?

The backup did not finish, or its end was not collected. Microsoft documents no separate event for a failed backup, so check the backup job and whether the CA's Security log was overwritten.

Why is there no 4877 for our scheduled CA backups?

The CA also needs "Back up and restore the CA database" in its own audit filter, and Certificate Services must restart after the filter changes. A backup tool that does not use the CA's own backup function may not write the event either, so run one backup with your tool and check the CA's Security log.

References