1. Resources
  2. Detection rules
  3. AD CS Certificate Database Entries Deleted

AD CS Certificate Database Entries Deleted detection rules

After issuing a certificate that should not exist, an attacker with CA administrator rights deletes its rows from the CA database so it is not found or revoked. The CA logs event 4896 with the table and the number of rows deleted.

Platform
Active Directory
Severity
Medium
Log source
Windows Security event log
Last updated
MITRE ATT&CK technique
T1070Indicator Removal
Tactic
Stealth
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
CA administrator rights on the certification authority, or local administrator rights on the CA server.
Impact
The record of a malicious certificate disappears from the CA database, which makes it harder to revoke, and the attacker keeps its access until it expires.
Response
Remove the CA administrator rights of the account that deleted the rows and disable it, then revoke every certificate that is missing from the database without a cleanup record.
Mitigation
Restrict CA administrator rights to PKI administrators, and keep a copy of issued certificates outside the CA so that deleted entries can be reconstructed.
Event ID
4896

How the attack works

A certification authority keeps a database of every request it received and every certificate it issued, with the requester, the template, the serial number and the status. Administrators use that database to see what the CA has issued and to revoke a certificate, and it is the record an investigation of certificate abuse starts from.

An attacker who has used the CA to obtain a certificate for impersonation, and who holds administrative rights on the CA, can delete the rows that belong to that request. The certificate itself keeps working, because it is still signed by a CA the domain trusts. It simply no longer appears among the issued certificates, where a responder would look for it and revoke it.

When "Audit Certification Services" is enabled and the CA's audit filter includes "Issue and manage certificate requests", the CA server writes event 4896 (one or more rows have been deleted from the certificate database) to its Security log, with the table, the filter that selected the rows and the number of rows deleted. Microsoft's PKI guidance rates the event as high and notes that it may indicate an attacker covering their tracks after issuing certificates. Administrators also delete rows on purpose, to remove expired certificates and old failed or pending requests from a large database.

What an attacker needs

  • CA administrator rights on the certification authority, or local administrator rights on the CA server.

Impact

Evidence of a malicious certificate is removed from the place where it would be found, and the certificate is harder to revoke because the CA no longer lists it. The attacker keeps the access the certificate gives until it expires.

Detection rules

Rows Deleted From the Certification Authority Database

Detects event 4896, which an AD CS certification authority writes to its Security log when one or more rows have been deleted from the certificate database. The database is the CA's record of requests and issued certificates, so deleting rows removes the trace of a certificate without making the certificate invalid. Microsoft's PKI guidance rates the event as high and notes that it may indicate an attacker covering their tracks after issuing certificates. The event gives the table, the filter and the number of rows deleted. Logged on the CA server; requires Audit Certification Services and the "Issue and manage certificate requests" category in the CA's audit filter.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: Rows Deleted From the Certification Authority Database
id: 42d7ce06-09ba-4d39-ae8d-892ddbe5938c
status: experimental
description: >-
  Detects event 4896, which an AD CS certification authority writes to its
  Security log when one or more rows have been deleted from the certificate
  database. The database is the CA's record of requests and issued
  certificates, so deleting rows removes the trace of a certificate without
  making the certificate invalid. Microsoft's PKI guidance rates the event as
  high and notes that it may indicate an attacker covering their tracks after
  issuing certificates. The event gives the table, the filter and the number of
  rows deleted. Logged on the CA server; requires Audit Certification Services
  and the "Issue and manage certificate requests" category in the CA's audit
  filter.
references:
  - https://attack.mitre.org/techniques/T1070/
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/audit-certification-services
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn786423(v=ws.11)
  - https://learn.microsoft.com/en-us/windows-server/identity/ad-cs/secure-delegate-audit-certification-authority
author: Forestall
date: 2026-11-14
tags:
  - attack.stealth
  - attack.t1070
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4896
  condition: selection
falsepositives:
  - Planned cleanup of the CA database by PKI administrators, which removes expired certificates and old failed or pending requests. It deletes many rows at once and has a change record. Confirm the change instead of excluding the event.
level: high

False positives

  • Planned cleanup of the CA database by PKI administrators, which removes expired certificates and old failed or pending requests. It deletes many rows at once and has a change record. Confirm the change instead of excluding the event.

Triage

  • Read Table ID, Filter and Rows Deleted in the event. Cleanup removes many rows selected by a date. A deletion of one row or a few rows selected by request ID points at specific certificates.
  • Identify the CA server that logged the event and who was logged on to it or connected to it at that time (event 4624 on the CA server). Is there a change record for a database cleanup?
  • Look at the certificates issued shortly before the deletion (events 4886 and 4887), above all those issued to privileged accounts or with a subject the requester supplied, and compare them with what the CA database still lists.
  • If a deleted certificate cannot be accounted for, recover its serial number from the forwarded events or a database backup and revoke it, then review how the account obtained CA administrator rights.

Response

Once the attack is confirmed:

  1. Remove the CA administrator rights of the account that deleted the rows, disable the account, and remove any local administrator rights it holds on the CA server.
  2. Preserve the CA database, its log files and the Security log of the CA server before any further cleanup runs, so that what remains can still be compared.
  3. Extend the check from the alert to the whole time the account held CA administrator rights. Compare the forwarded 4886 and 4887 events and the latest database backup with the database, and revoke every certificate that is missing without a cleanup record.
  4. Search domain controllers for sign-ins with a certificate (event 4768 with the certificate issuer and serial number filled in) that use a serial number the CA database no longer lists, and investigate the accounts that signed in this way.
  5. Confirm afterwards that the CA's audit filter still includes every category and that the Security log of the CA server reaches a system the CA administrators cannot change.

Mitigation

  • Restrict CA administrator rights to PKI administrators and treat CA servers as Tier 0.
  • Enable "Audit Certification Services" on CA servers, select every category in the CA's audit filter and forward the CA's Security log to a system the CA administrators cannot change.
  • Keep CA database backups, and keep a copy of issued certificates outside the CA (forwarded events 4886 and 4887), so that deleted entries can be reconstructed.
  • Run database cleanup only as a planned, recorded change, so that any other deletion stands out.

Frequently asked questions

Does deleting a row from the CA database revoke the certificate?

No. The certificate keeps working, because it is still signed by a CA the domain trusts. The deletion only removes it from the list of issued certificates, which is where an administrator would look for it and revoke it. That is the reason an attacker deletes the row.

How do I tell planned database cleanup from an attacker covering their tracks?

Read Table ID, Filter and Rows Deleted in event 4896. Planned cleanup removes many rows selected by a date, such as expired certificates and old failed or pending requests, and has a change record. A deletion of one row or a few rows selected by request ID points at specific certificates and needs an explanation.

Why does our CA never log event 4896?

The event needs the audit subcategory Audit Certification Services on the CA server and the category "Issue and manage certificate requests" in the CA's own audit filter. It is written to the Security log of the CA server, not of a domain controller. An account with CA administrator rights can also narrow the audit filter first, which the CA records as event 4885.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.