Active Directory Certificate Services (AD CS) quietly issues credentials that can log on as any user or computer in the forest, and a single misconfigured certificate template can turn an ordinary domain account into a Domain Admin. Many enterprise CAs were installed years ago for Wi-Fi, VPN or smart cards and their templates never reviewed. Since 2021, public research has catalogued the misconfiguration classes (ESC1, ESC8, ESC15 and others) that make AD CS one of the shortest routes to tier zero, and Microsoft has changed how domain controllers map certificates to accounts. This guide is for directory, PKI and detection engineers who need to find and fix those weaknesses, harden the CA itself, complete the move to strong certificate mapping and detect abuse. For the wider directory programme see the Active Directory and Entra ID Hardening Guide.
Key takeaways
- A certificate is a credential. A client authentication certificate from a CA in the NTAuth store can obtain Kerberos tickets as the identity it names, and survives password resets.
- Templates are the attack surface. A template that lets the requester supply the subject, carries an authentication EKU and is enrollable by Domain Users is ESC1, one of the most direct paths to Domain Admin.
- The CA is tier zero. Whoever holds an enterprise CA's private key can forge a "golden certificate" for any account, so the CA server, its key and its administrators deserve domain controller level protection.
- Strong mapping is now enforced. KB5014754 moved domain controllers to Full Enforcement in February 2025, and the registry key that allowed a fallback stopped being supported with the September 2025 updates. Certificates without a strong mapping now fail.
- Turn on CA auditing first. Events 4886, 4887, 4899 and 4900 only appear when the CA audit filter is set, and without them there is no record of who requested what.
How AD CS becomes an authentication authority
Microsoft describes AD CS as "a Windows Server role for issuing and managing public key infrastructure (PKI) certificates used in secure communication and authentication protocols." Three design facts make it an identity system.
- Templates live in the directory: only an enterprise CA can issue from certificate templates, and the templates are stored in Active Directory Domain Services "for use by every CA in the forest."
- The NTAuth store decides trust for logon: the object
CN=NTAuthCertificates,CN=Public Key Services,CN=Services,CN=Configurationholds CA certificates in itscACertificateattribute. Publishing a CA there means, in Microsoft's words, that "issued certificates from these CA's can be used for authentication." Domain-joined enterprise CAs publish themselves automatically. - Kerberos accepts certificates: a certificate with a client authentication or smart card logon purpose can be used for PKINIT to obtain a ticket-granting ticket for whichever account the domain controller maps it to.
| AD CS component | What it does | Why defenders care |
|---|---|---|
| Enterprise CA (Certification Authority role service) | Issues certificates from templates published in AD | Its private key can sign any certificate; CA permissions (Manage CA, Manage Certificates) control approval and configuration |
| Certificate templates | Define subject name source, EKUs, enrolment permissions, issuance requirements | Most escalation classes are template settings or template ACLs |
| NTAuth store | Lists CAs trusted to issue logon certificates | An unexpected CA here is a domain persistence mechanism |
| AD CS Web Enrollment and Certificate Enrollment Web Service | HTTP interfaces for requesting certificates | Vulnerable to NTLM relay (ESC8) if they accept NTLM without HTTPS and Extended Protection |
For certificate inventory, renewal and lifecycle tooling beyond AD CS see the Machine Identity, PKI and Certificate Lifecycle Guide.
The ESC misconfiguration classes
The 2021 research paper "Certified Pre-Owned" gave AD CS weaknesses a shared vocabulary: ESC (domain escalation) classes, THEFT classes for stealing existing certificates, and PERSIST classes for keeping access. Later research extended the numbering, and Microsoft Defender for Identity now ships posture assessments named after the ESC classes, so the labels are safe to use in change tickets. Each class below is a condition to find and fix.
| Class | Condition to find | Fix |
|---|---|---|
| ESC1 | Template with "Supply in the request" (Enrollee Supplies Subject), an authentication EKU such as Client Authentication, and enrolment rights for unprivileged groups | Turn off Supply in the request, or remove authentication EKUs, or narrow enrolment, or require CA certificate manager approval, or unpublish |
| ESC2 | Template with Any Purpose EKU or no EKU, enrollable by unprivileged users | Restrict enrolment; add manager approval and signature requirements |
| ESC3 | Enrollment Agent (Certificate Request Agent) template enrollable by unprivileged groups | Remove the EKU or the broad rights, require approval, or apply enrolment agent restrictions on the CA |
| ESC4 | Template ACL or owner lets unprivileged groups modify the template (Full Control, Write DACL, ownership) | Set a privileged, monitored owner; remove write rights from built-in groups |
| ESC6 | CA flag EDITF_ATTRIBUTESUBJECTALTNAME2 on, so any request can carry a subject alternative name | Turn the flag off; it affects every template the CA publishes |
| ESC7 | CA ACL grants Manage CA or Manage Certificates to unprivileged groups | Remove those rights; keep CA officers in a small, monitored group |
| ESC8 | HTTP enrolment endpoints accept NTLM without HTTPS or Extended Protection for Authentication | Apply KB5005413: HTTPS only, EPA Required, or remove the role service |
| ESC11 | RPC enrolment interface does not require packet privacy (IF_ENFORCEENCRYPTICERTREQUEST off) | Turn the flag on after testing older clients |
| ESC15 | Version 1 template with Supply in the request, on a CA without the CVE-2024-49019 fix | Patch the CA, remove unprivileged enrolment, disable Supply in the request (replace the template) |
ESC1: enrollee supplies subject
Subject alternative name abuse is the core of ESC1. When a template has the Enrollee Supplies Subject flag set, the CA copies the name the requester asks for into the certificate instead of building it from the requester's directory object. If the template also carries an authentication EKU and Domain Users or Authenticated Users can enrol, any account can obtain a certificate naming a Domain Admin, and the domain controller will issue that admin a ticket. Microsoft's assessment warns that this allows impersonation of any account, including domain admins. Legitimate uses exist, typically web server templates where the subject cannot come from AD: keep them, but without authentication EKUs, with enrolment limited to named server owners and with manager approval.
ESC8: AD CS Web Enrollment and NTLM relay
AD CS Web Enrollment and the Certificate Enrollment Web Service authenticate over HTTP. If they accept NTLM without channel binding, an attacker who coerces a privileged machine, such as a domain controller, into authenticating can relay that authentication and obtain a certificate for it. Microsoft's KB5005413 lists the mitigations: enable Extended Protection for Authentication with "Required", enable Require SSL so only HTTPS is accepted, set extendedProtectionPolicy to Always for the enrolment web service, and optionally restrict incoming NTLM on AD CS servers. If nobody uses the web interfaces, remove the role service.
ESC15: version 1 templates and application policies
Version 1 templates are installed by default and Microsoft notes that "the only property that can be modified on a version 1 template is the set of assigned permissions." ESC15 affected version 1 templates that let the requester supply the subject: on an unpatched CA a requester could also add arbitrary application policies, so a certificate from a template meant for servers could carry client authentication. Microsoft fixed this as CVE-2024-49019 (published 12 November 2024, CVSS 7.8). Patch every CA, then duplicate any still-needed version 1 template into a version 2 or later template you can configure, unpublish the original, and remove enrolment rights for unprivileged groups.
Theft, persistence and the golden certificate
MITRE ATT&CK covers this activity as T1649 Steal or Forge Authentication Certificates.
- AD CS certificate theft: user and machine certificates with exportable private keys can be copied from certificate stores, files and backups. Prefer non-exportable keys for authentication templates, use TPM key attestation where supported (the CA verifies the key is protected by a trusted TPM), and keep certificate files and PFX backups out of shares and repositories.
- AD CS account persistence: a certificate enrolled for a compromised account stays valid until it expires or is revoked. Resetting the password does nothing to it. Incident response for any account compromise must include listing certificates issued to that account in the CA database and revoking them.
- AD CS domain persistence: an attacker with enough rights can add a rogue CA certificate to NTAuth, loosen a template, or grant themselves CA officer rights to approve their own requests later.
- Golden certificate: with a stolen enterprise CA private key, an attacker can sign certificates offline for any identity. Forged certificates never pass through the CA, so they are absent from the CA database and from event 4887. ATT&CK lists forged certificates as a persistence route. The realistic remedy is to retire the compromised CA certificate, remove it from NTAuth and the trusted root stores, and re-issue from a new key. Prevention depends on key protection.
Microsoft's PKI guidance recommends a hardware security module for all production CAs and warns that "marking a software-based key as 'not exportable' is not considered a security feature." By default a software CA key can be exported by anyone with local administrator rights on the CA. The Mimecast certificate compromise showed in a different setting how a stolen authentication certificate grants access that outlives every password change.
Strong certificate mapping and KB5014754
KB5014754 closed CVE-2022-26923, CVE-2022-26931 and CVE-2022-34691, which let certificates be mapped to the wrong account through name spoofing (for example, machine names without the trailing dollar sign and UPN or sAMAccountName collisions). From the May 2022 updates, enterprise CAs add a non-critical SID security extension (OID 1.3.6.1.4.1.311.25.2) to certificates issued from online templates, and domain controllers check it.
| Date | Change (per Microsoft KB5014754) |
|---|---|
| 10 May 2022 | Domain controllers enter Compatibility mode and log audit events for weak mappings |
| 11 April 2023 | Disabled mode (StrongCertificateBindingEnforcement = 0) is ignored |
| 13 February 2024 | On Windows Server 2019 and later, Active Directory Users and Computers defaults to X509IssuerSerialNumber mappings |
| 11 February 2025 | Domain controllers without an explicit setting move to Full Enforcement (value 2) |
| 9 September 2025 | The StrongCertificateBindingEnforcement registry key is no longer supported, so rolling back to Compatibility mode is no longer possible |
- Strong mappings: the SID extension, or an explicit
altSecurityIdentitiesvalue of type X509IssuerSerialNumber (Microsoft's recommendation), X509SKI or X509SHA1PublicKey. - Weak mappings: X509IssuerSubject, X509SubjectOnly and X509RFC822. Microsoft states that "all mapping types based on usernames and email addresses are considered weak."
- Events to watch: in the System log, source Kdcsvc, event 39 means a certificate could not be mapped in a strong way, 40 means the certificate predated the account (Compatibility mode only) and 41 means the SID in the certificate does not match the mapped account. Event 41 deserves an alert in its own right.
- Third-party CAs: the SID extension is added only by Microsoft enterprise CAs. Certificates from other CAs used for smart card or device logon need explicit strong mappings. See the Smart Card and PIV/CAC Authentication Guide.
- Template opt-out: bit 0x00080000 in
msPKI-Enrollment-Flagstops the CA adding the SID extension; treat it as a finding unless documented.
Hardening the enterprise CA and its templates
Enterprise CA hardening
- Tier zero placement: administer CAs only from privileged access workstations with tier zero accounts, restrict local administrators, and keep backup operators for CA servers in the same tier.
- Key protection: keep the root CA offline, protect issuing CA keys in an HSM, and require more than one person for HSM key operations. Microsoft's guidance is that "no single person can access a quorum of objects."
- Role separation: separate CA Administrator (Manage CA) from Certificate Manager (Manage Certificates) and remove both rights from any built-in or broad group (ESC7).
- NTAuth hygiene: NTAuth should contain only CAs you intend to trust for logon. Review its
cACertificatevalues on a schedule and alert on changes.
Certificate template enforcement
- Unpublish what you do not use: it is reversible and the quickest risk reduction.
- Name from Active Directory: prefer "Build from this Active Directory information" over Supply in the request for any template with an authentication EKU.
- Issuance requirements: where requesters must supply names, require CA certificate manager approval or an authorised signature so a human or enrolment agent checks the request.
- Enrolment rights: grant Enroll and Autoenroll to named groups, not Domain Users, Domain Computers or Authenticated Users, unless the template genuinely serves every account and builds the subject from AD.
- Template ownership and ACLs: owners and write permissions belong to the PKI team's admin group only (ESC4).
Decoy certificate template
A decoy certificate template is a deception control: a published template with an attractive name and an apparently risky configuration that no legitimate process uses. Configure it so it cannot actually issue (for example, require CA certificate manager approval so requests stay pending) and alert on any request against it: no legitimate user has a reason to try, so an attempt is a strong reconnaissance signal. See the Deception Technology Guide.
Implementing the clean-up
- Turn on visibility. Enable the Audit Certification Services subcategory on CA servers and set the CA audit filter to cover issue and manage requests and changes to CA security settings and configuration. Forward events centrally first.
- Inventory. List every CA and published template with its EKUs, subject name source, schema version, enrolment ACL, owner and issuance requirements, plus NTAuth contents and web enrolment services. Defender for Identity's ESC6, ESC7, ESC8, ESC11 and ESC15 assessments need a sensor on the AD CS server.
- Measure real use. From the CA database and 4887 events, find which templates issued certificates in the last 12 months; unused ones are candidates to unpublish.
- Fix the critical classes first. ESC1, ESC4, ESC6, ESC7 and ESC8 give the fastest paths to Domain Admin. Patch every CA for CVE-2024-49019 in the same window.
- Change safely. Duplicate a template, tighten the copy, pilot it with one application owner, then supersede the old template, keeping it unpublished until the pilot ring renews successfully.
- Close strong mapping gaps. Review Kdcsvc events 39 and 40 history, re-issue certificates that lack the SID extension, and add X509IssuerSerialNumber mappings for third-party CA certificates.
- Harden the CA with role separation now and HSM-backed keys at the next renewal.
- Roll back by republishing the original template or reverting CA flags. There is no longer a registry rollback for strong mapping enforcement.
Choosing between options
| Decision | Option A | Option B | Choose A when |
|---|---|---|---|
| Template with requester-supplied names | Keep, with manager approval | Remove authentication EKUs | Requests are rare and someone can genuinely check each one; otherwise B is safer |
| HTTP enrolment | Remove the role service | HTTPS plus EPA Required | No non-domain clients depend on it |
| CA hierarchy | Offline root plus issuing CA | Single-tier enterprise root | You can run the offline root ceremony; a single online root's key compromise means rebuilding everything |
Small organisations with one CA can unpublish unused templates, fix ESC1 and ESC8 and enable auditing in a day. Large organisations with several forests need a template owner register, change control for template edits and periodic NTAuth and CA ACL reviews under tier zero governance.
Detection and measurement
CA security events depend on the CA audit filter. Microsoft's PKI monitoring appendix lists these as the most useful:
| Event | Source | What it tells you |
|---|---|---|
| 4886 / 4887 / 4888 | CA Security log | Request received, issued, denied; 4887 includes requester and subject, so a requester different from the subject on an authentication template is a strong ESC1 signal |
| 4882 | CA Security log | CA security permissions changed (possible ESC7 set-up) |
| 4885 | CA Security log | Audit filter changed (possible attempt to blind monitoring) |
| 4896 | CA Security log | Rows deleted from the CA database (possible cleanup after misuse) |
| 4898 / 4899 / 4900 | CA Security log | Template loaded, template updated, template security updated (ESC4) |
| 4657 on EditFlags | Registry auditing | Alert if EDITF_ATTRIBUTESUBJECTALTNAME2 is enabled (ESC6) |
| 39 / 40 / 41 | Kdcsvc, DC System log | Weak or mismatched certificate mappings |
| 4768 | DC Security log | Kerberos TGT requests; certificate fields show PKINIT logons for correlation with issued serials |
Two correlations catch what single events miss: certificate logons by privileged accounts that rarely use certificates, and PKINIT logons whose certificate serial is in no CA database (a forged certificate). See the ITDR Guide for wider identity detection.
- Templates with ESC conditions: count of published templates meeting any ESC1 to ESC15 condition; target zero.
- Published but unused templates: templates with no issuance in 12 months; trend down.
- Broad enrolment: percentage of templates with authentication EKUs enrollable by Domain Users, Domain Computers or Authenticated Users.
- Mapping health: Kdcsvc 39 and 41 events per week; target zero after remediation.
- Audit coverage: CAs forwarding 4886 to 4900 events; target all.
Common failure patterns
- Default templates never reviewed: version 1 templates such as Web Server and User stay published with broad rights for a decade.
- Password reset treated as containment: responders reset a compromised admin's password but never revoke its certificates.
- CA run as an ordinary server: managed from standard admin accounts and backed up to general storage with an exportable key.
- Auditing off by default: nobody set the CA audit filter, so the investigation has no record of which certificates were issued.
- Strong mapping postponed: teams kept Compatibility mode until the registry key stopped being honoured, then discovered third-party smart card certificates without strong mappings during an outage.
Framework mapping
| Framework | Reference | AD CS control |
|---|---|---|
| MITRE ATT&CK | T1649 Steal or Forge Authentication Certificates | Template remediation, key protection, CA auditing; mitigations M1015, M1047, M1042, M1041 |
| NIST SP 800-53 Rev. 5 | SC-17, IA-5(2), AC-6, CM-6, AU-6 | PKI certificate policy, public key authentication, least privilege on templates and CA, secure configuration, audit review |
| NIST CSF 2.0 | PR.AA-01, PR.PS-01, DE.CM-09 | Credential management, configuration management, monitoring of computing hardware and software |
| CIS Controls v8.1 | 4.1, 5.4, 8.2 | Secure configuration process, restricted admin privileges, audit log collection |
| ISO/IEC 27001:2022 Annex A | A.8.24, A.8.2, A.8.9, A.8.15 | Use of cryptography, privileged access rights, configuration management, logging |
The Five Eyes guidance "Detecting and Mitigating Active Directory Compromises", led by ASD's ACSC with CISA, NSA and partners, covers 17 common Active Directory compromise techniques and is a useful companion for tier zero programmes.
Practitioner checklist
- Enable the CA audit filter and Audit Certification Services on every CA, and forward events 4882 to 4900 centrally.
- Flag every published template meeting an ESC condition; fix or unpublish it.
- Patch all CAs for CVE-2024-49019 and replace needed version 1 templates with configurable copies.
- Confirm
EDITF_ATTRIBUTESUBJECTALTNAME2is off andIF_ENFORCEENCRYPTICERTREQUESTis on. - Remove AD CS Web Enrollment or enforce HTTPS and EPA Required per KB5005413.
- Treat CA administrators as tier zero and remove CA officer rights from broad groups.
- Review NTAuth contents and alert on any change to the NTAuthCertificates object.
- Clear Kdcsvc 39 and 41 events and strongly map third-party CA certificates.
- Add certificate revocation for the affected account to every account-compromise runbook.
- Plan HSM-backed keys and an offline root for the next CA renewal.
Standards and references
- Microsoft: KB5014754 Certificate-based authentication changes on Windows domain controllers
- Microsoft: KB5005413 Mitigating NTLM Relay Attacks on Active Directory Certificate Services
- Microsoft Learn: Defender for Identity certificates security posture assessments
- Microsoft Learn: Certificate template concepts in Windows Server
- Microsoft Learn: Securing PKI, Appendix A Events to Monitor
- Microsoft Learn: Import third-party CA certificates into the Enterprise NTAuth store
- MITRE ATT&CK: T1649 Steal or Forge Authentication Certificates
- CISA: Detecting and Mitigating Active Directory Compromises
Related NHI Mgmt Group resources: Active Directory and Entra ID Hardening Guide · Machine Identity, PKI and Certificate Lifecycle Guide · Kerberos Security Guide · ITDR Guide