← Back to All Articles
Microsoft Defender

Eliminating AD CS (ESC1–ESC8) Vulnerabilities with Defender for Identity Posture

Deploying Defender for Identity AD CS sensors on Enterprise Certificate Authorities to detect and remediate ESC1, ESC6, and ESC8 PKI privilege-escalation paths.

·10 min read·
#Defender for Identity#ADCS#ESC1#ESC8#Identity Posture#M365 E5
Eliminating AD CS (ESC1–ESC8) Vulnerabilities with Defender for Identity Posture

Executive Summary and Active Directory Threat Context

Once organizations hardened Kerberoasting and Golden Ticket controls on Domain Controllers, attackers pivoted sharply toward misconfigured enterprise PKI (Active Directory Certificate Services). A single template allowing ENROLLEE_SUPPLIES_SUBJECT (ESC1) or an HTTP NTLM Web Enrollment portal (ESC8) lets low-privilege accounts mint Domain Admin certificates in minutes. Defender for Identity’s dedicated AD CS sensor closes this blind spot.

From an architectural evolution standpoint, this foundational design connects directly to modern platform controls. Integrating dedicated AD CS telemetry into Defender for Identity during 2023 elevated PKI posture into a core pillar of Defender Identity KQL Threat Hunting and Tier-0 defense.

Sensor Boundaries, Protocol Auditing, and Design Principles

  • Defender for Identity AD CS Sensor runs directly on Issuing CAs to stream certificate issuance telemetry, SAN spoofing attempts, and CA template ACL modifications.
  • Microsoft Secure Score ISPM recommendations automatically audit and highlight exposed ESC1, ESC2, ESC3, ESC4, ESC6, and ESC8 weaknesses.
  • Remediating ESC8 requires removing unneeded AD CS Web Enrollment IIS endpoints or mandating HTTPS paired with Extended Protection for Authentication (EPA).
  • Identity sensors on Domain Controllers and Entra Connect hosts depend on tuned Advanced Windows Audit Policies and strict resource sizing so deep Kerberos/LDAP/NTLM inspection never degrades DC responsiveness.

Prerequisites, Domain Controller Dependencies, and RBAC

  • Licensing: Microsoft Defender for Identity (included in Microsoft 365 E5 / EMS E5).
  • Sensor & RBAC: Local admin deployment rights on Issuing CAs plus MDI gMSA Active Directory permissions.
  • PKI Continuity: Audit legacy SCEP/NDES and automated enrollment dependencies before stripping HTTP certsrv endpoints.

Technical Verification, ADCS/Protocol Posture, and Controls

PowerShell Sensor Health and Hardening Audit

Auditing CA ESC6 flags, Web Enrollment roles, MDI sensor health, and dangerous AD CS template flags via PowerShell:

  • Execution Environment and Prerequisites: Requires ActiveDirectory / RSAT / AD Sync / AD FS management host.
  • Least Privilege and Operation Separation: Run with least-privilege inspection or scoped administrative permissions. All statements above are **read-only (Get-*/Test-*/Search-*)** verification checks making no direct configuration edits; still validate module/network prerequisites in a test cohort first.
  • Security Control Mapped and Boundary Note: Verifies active policy state and guards against silent drift or mis-scoped rollouts without blind production changes.
powershell
# 1. Check whether EDITF_ATTRIBUTESUBJECTALTNAME2 (ESC6) is enabled on the CA
certutil -getreg policy\EditFlags

# 2. Verify whether vulnerable HTTP ADCS-Web-Enrollment feature is installed
Get-WindowsFeature -Name ADCS-Web-Enrollment | Select-Object Name, InstallState

# 3. Verify Defender for Identity sensor running state on the Enterprise CA
Get-Service -Name "AATPSensor" -ErrorAction SilentlyContinue | Select-Object Name, Status, StartType

# 4. Enumerate AD CS templates allowing ENROLLEE_SUPPLIES_SUBJECT (Flag = 1)
$ConfigNC = (Get-ADRootDSE).configurationNamingContext
Get-ADObject -SearchBase "CN=Certificate Templates,CN=Public Key Services,CN=Services,$ConfigNC" -Filter * -Properties msPKI-Certificate-Name-Flag |
  Where-Object { $_.'msPKI-Certificate-Name-Flag' -band 1 } |
  Select-Object Name, 'msPKI-Certificate-Name-Flag'

Identity Threat Telemetry and KQL Verification Query

KQL query in Defender XDR hunting AD CS certificate requests and IdentityDirectoryEvents anomalies:

kql
// Execution Scope: Read-only hunting/audit query (Log Analytics Reader / Security Reader)
// Data Source: Microsoft Defender for Identity -> Defender XDR Advanced Hunting (IdentityDirectoryEvents)
IdentityDirectoryEvents
| where Timestamp > ago(30d)
| where ActionType has "Certificate" or Application == "Active Directory Certificate Services"
| project Timestamp, ActionType, AccountUpn, TargetAccountUpn, DeviceName, AdditionalFields
| summarize CertEvents = count() by ActionType, AccountUpn
| order by CertEvents desc

Critical Architectural Assessment, Production Risks, and Rollback Strategy

  • Leaving EDITF_ATTRIBUTESUBJECTALTNAME2 (ESC6) Set on the CA: Even hardened templates become vulnerable to arbitrary SAN spoofing if the CA globally holds the ESC6 EditFlag.
  • Ignoring Authenticated Users Permissions on Legacy Templates: Verify both Enroll rights and CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT flags across every enabled template.
  • Risks Mitigated vs. Residual Limitations: MDI sensors and ADCS (ESC1/ESC8) remediation detect and disrupt Golden Ticket, DCSync, LDAP reconnaissance, and certificate-template escalation; however, they do not inspect pure cloud-only Entra token replay, legacy apps broken if NTLM/web-enrollment endpoints are removed prematurely, or DCs lacking Windows Advanced Audit policies.
  • New Dependencies and Production Failure Modes: Fidelity depends on configured DC Security audit SACLs, sensor sizing margins on busy Domain Controllers, outbound *.sensorapi.atp.azure.com HTTPS connectivity for v3, and verified ADCS client inventories before locking down ESC8 HTTP endpoints.
  • Rollback and Pilot Validation Procedure: Stage NTLM and weak-protocol cleanup through Windows audit-only logging (8004/4022 events) first; keep GPO rollback snapshots for AD hardening changes and upgrade v2 -> v3 sensors one non-FSMO DC at a time.

Verified Primary Sources & Open-Source Repositories

This architectural guide was cross-corroborated against the official advisories, Microsoft Learn docs, and open-source PowerShell / KQL repositories below.

Multi-Channel Distribution Summary (X & LinkedIn Draft)

Toggle X (Twitter) & LinkedIn sharing drafts
X (Twitter) Draft

Closing AD CS ESC1–ESC8 PKI escalation paths with Defender for Identity CA sensors and PowerShell audits. #DefenderForIdentity #ADCS #ZeroTrust

LinkedIn Draft

Securing Enterprise PKI: Deploying Defender for Identity on Enterprise CAs, auditing ESC6 EditFlags, and locking down HTTP ESC8 Web Enrollment.