[Certificate Fundamentals Part 9] Private PKI and the Cloud: Designing and Protecting AD CS, ACM and Private CA, TLS Termination at Load Balancers, and vSphere

Certificate Fundamentals Part 9 Private PKI and the Cloud: Designing and Protecting AD CS, ACM and Private CA, TLS Termination at Load Balancers, and vSphere Certificates and PKI

“We can just put the private CA on the domain controller for now, right?”
“The servers behind the ALB are still on self-signed certificates, but they work, so it’s fine.”

Private PKI and certificates in the cloud have pitfalls that differ from public CAs. With a private CA, a single wrong setting can let an ordinary user become a domain admin, which makes it the entry point of an attack, and some cloud load balancers do not verify certificates at all.

In Part 8 we looked at automation with ACME. Part 9 covers designing and protecting private PKI (AD CS), cloud certificate services (ACM, Private CA, Azure), TLS termination at load balancers, and vSphere certificates.


AD CS design: two tiers

The basic form when building private PKI with AD CS (Active Directory Certificate Services) is a two-tier structure of an offline root CA and an online issuing CA.

Diagram showing a standalone root CA not joined to the domain, stored powered off and started only a few times a year, signing the issuing CA, an enterprise CA in the AD domain, which issues to PCs, servers, and users through templates and auto-enrollment, while the CRL and CA certificate stay retrievable over the web
  • Root CA: Build it as a standalone CA that is not joined to the domain, and after it signs the issuing CA’s certificate, power it off and store it. If the root CA’s private key leaks, every certificate in the organization can no longer be trusted, and you have to rebuild and redistribute to every device
  • Issuing CA: Let a domain-joined enterprise CA handle day-to-day issuance. An enterprise CA integrates with AD and can use certificate templates and auto-enrollment

A single-tier structure in which the root CA issues directly is convenient, but it keeps the root key on the network at all times, so it is for test environments. A three-tier structure is an option for large organizations that want separate policies by site or purpose.


Where to publish CRLs and AIA, and validity periods

ItemRoot CA (offline)Issuing CA (online)Notes
CA certificate validityExample: 20 yearsExample: 10 yearsA CA cannot issue a certificate that outlasts its own expiration. Renewing at half the period is recommended
CRL validityExample: 6 months to 1 year. Do not use delta CRLsDefault: base CRL 1 week, delta CRL 1 dayOnce the next update (NextUpdate) passes, validation of the certificates below fails
CRL publicationStart the CA, issue by hand, and copy to the web server by handIssued automatically and published to the web server and ADPut the root’s CRL renewal on the annual work schedule
CDP and AIA URLsPut HTTP (for example http://pki.corp.example.com/) firstSame, HTTP first. LDAP is for AD-joined devicesDecide before issuing. Certificates already issued keep the old URL even if you change it later
Renewing the CA certificate (re-signing)Re-sign with the same key, or recreate with a new keyCarry the renewal request to the root and have it signedA root with a new key must be redistributed to every device
C:\> certutil -setreg CA\CRLPeriodUnits 52       # Root CA: set the CRL validity to 52 weeks
C:\> certutil -setreg CA\CRLPeriod "Weeks"
C:\> certutil -setreg CA\CRLDeltaPeriodUnits 0   # Do not use delta CRLs
C:\> net stop certsvc & net start certsvc
C:\> certutil -CRL                               # Issue the CRL (output to the CertEnroll folder)

What is easy to overlook with an offline root CA is renewing the root’s CRL. If the CRL of a root CA that you keep powered off passes its expiration (NextUpdate), validation of every certificate below it fails. Be sure to put it on the annual work schedule. Microsoft recommends not using delta CRLs on an offline root CA, and providing an HTTP CDP for devices other than Windows. OCSP (an online responder) is optional (Part 5).


Why not to put an issuing CA on a DC

This is the answer to “just put the private CA on the DC” from the opening. Do not set up an issuing CA on a domain controller (DC). Microsoft also does not recommend running a CA on a DC.

Diagram showing that when a CA and IIS (web enrollment) share a DC, the DC cannot be demoted until the CA is removed, CA administrators need sign-in rights on the DC, and the DC itself becomes the target of NTLM relay (ESC8), whereas the recommendation is a dedicated issuing CA protected as Tier 0, with the web server that distributes the CRL and AIA on a separate machine
  • Reason 1: operational freedom: A DC with a CA cannot be demoted, and you have to remove the CA role first. Every time you replace a DC you must migrate the CA, and the name of the server hosting the CA cannot be changed (if you change it, issued certificates stop working)
  • Reason 2: separation of privileges: CA administrators would get sign-in rights on the DC, so you cannot separate PKI staff from domain administrators
  • Reason 3: a target for attack: If you add web enrollment (IIS) to a DC, the DC itself becomes the target of NTLM relay attacks (ESC8, below)

However, protect the issuing CA at the same level of importance as a DC. If an issuing CA is taken over, an attacker can issue certificates for any user, including domain administrators, which is the same as taking over a DC. In Microsoft’s tiering it is treated as Tier 0 (the most critical assets).

The recommended configuration is to put the issuing CA on a dedicated member server and keep the web server that distributes CRLs separate. Distribute the root certificate with GPO, and store the CA’s key in an HSM or in an encrypted backup. You separate them for operations and privileges. The level of protection is the same as for a DC.


Certificate templates and auto-enrollment

A template is a mold for the certificates to be issued. It determines the purpose (EKU), key type and length, validity period, how the subject is built, and who can apply. Copy the default templates and give them their own names before use.

Diagram showing an administrator creating a template and allowing a group to auto-enroll, then enabling auto-enrollment with a GPO, after which PCs and servers send a CSR, the issuing CA issues according to the template, the certificate goes into the certificate store, and the process repeats automatically as expiration approaches
  • Build the subject from “Build from this Active Directory information” by default. Use “Supply in the request” (the applicant can specify the name) only where needed, such as for web servers, and require CA administrator approval (a countermeasure against ESC1)
  • Auto-enrollment: In the template’s security settings, allow Read, Enroll, and Autoenroll for the target group, and enable auto-enrollment with GPO
Computer Configuration > Policies > Windows Settings > Security Settings
  > Public Key Policies > Certificate Services Client - Auto-Enrollment
  (Configuration Model: Enabled / check "Renew expired certificates, update pending certificates, and remove revoked certificates" and "Update certificates that use certificate templates")
PS> certutil -pulse                               # Run auto-enrollment right away
PS> Get-ChildItem Cert:\LocalMachine\My | Format-Table Subject, NotAfter, Thumbprint
PS> Get-Certificate -Template CorpWebServer -DnsName app01.corp.example.com `
      -CertStoreLocation Cert:\LocalMachine\My    # When applying manually

Certificates issued by auto-enrollment renew automatically as expiration approaches, which prevents expiration incidents. People only do the setup; issuance and renewal run between the devices and the CA. Linux machines and appliances cannot use auto-enrollment, so consider ACME and similar approaches (Part 8).


AD CS vulnerabilities (ESC1 to ESC8 and others)

AD CS is known for the fact that configuration mistakes lead directly to domain takeover.

Diagram of the ESC1 flow: an ordinary employee, A, sends a CSR with SAN = administrator, and with a template where the applicant can specify the name, the certificate can be used for client authentication, and Domain Users can enroll, a certificate in the administrator's name is issued as is, and through PKINIT the attacker obtains the administrator's Kerberos ticket from the DC and takes over the domain
No.Configuration mistakeWhen abusedCountermeasure
ESC1A template where the applicant can specify the SAN, which can be used for client authentication, and which ordinary users can enroll inObtain a certificate in an administrator’s name and sign in as the administratorBuild the subject from AD. Require approval. Narrow enrollment permissions
ESC2, ESC3A template whose purpose is “any purpose” or has no purpose specified, or an enrollment agent templateA certificate usable for anything, applying on behalf of other peopleMinimize the purpose. Set restrictions on enrollment agents
ESC4, ESC5Write permissions on templates or PKI objects (the CA’s computer, containers)Rewrite a template into the ESC1 formInventory ACLs and allow only Tier 0 administrators
ESC6The CA flag EDITF_ATTRIBUTESUBJECTALTNAME2The SAN can be specified with any templateRemove the flag
ESC7Broad permissions for CA management (ManageCA, Manage Certificates)Change CA settings, approve pending requestsKeep CA administrators to a minimum
ESC8Web enrollment (HTTP) accepts NTLM authenticationRelay a DC’s NTLM authentication and obtain the DC’s certificateHTTPS and Extended Protection for Authentication (EPA), disable NTLM, remove web enrollment if not needed
ESC9 to ESC16Disabled SID extension, weak mapping, relay to RPC, version 1 templates (ESC15: CVE-2024-49019), and so onSame as aboveApply updates and use strong mapping

ESC1 in particular needs attention. If there is even one template with all three conditions, “the applicant can specify the name,” “it can be used for client authentication,” and “ordinary users can enroll,” an ordinary user can become an administrator.

ESC is a classification of attacks that SpecterOps organized in its 2021 paper “Certified Pre-Owned,” and numbers have kept being added since. They can be detected with tools such as Certipy and Locksmith and with Microsoft Defender for Identity. Run checks only in environments you manage and have permission to test.


Certifried and strong certificate mapping

Certifried (CVE-2022-26923), fixed in May 2022, was a vulnerability in which an ordinary user could set the DNS name of a computer account they could create to match a DC’s, and obtain a certificate in the DC’s name.

Diagram contrasting weak mapping, where a certificate whose computer DNS name an attacker set to dc01 is authenticated by the KDC as DC01 on the name alone, with strong mapping (KB5014754), where the SID extension is checked against DC01's SID and rejected because it does not match, and the timeline from compatibility mode in May 2022 to full enforcement in September 2025
  • The cause was that the DC’s KDC (the Kerberos authentication service) tied an account to a certificate by name alone (weak mapping)
  • Microsoft introduced an extension that puts the applicant’s SID in the certificate, and strong mapping, which verifies with the SID or an explicit mapping (such as issuer and serial number) (KB5014754)
  • Enforcement mode became the default in February 2025, and the September 2025 update removed the way to go back to compatibility mode

For authentication that relies on old certificates without a SID or on certificates from other companies’ CAs (smart cards, 802.1X, VPN, and so on), you need to reissue them or set up explicit mappings. Today, authentication does not succeed with a certificate that has neither a SID nor an explicit mapping.


Operating AD CS safely, and Windows Server 2025

Diagram showing five items to check: CA flags (ESC6), the list and permissions of templates (ESC1 to 4), audit logs (4886 request, 4887 issuance), HTTPS plus EPA for web enrollment (ESC8), and backup and restore of the key and database, along with a CA using ML-DSA (for testing) in Windows Server 2025 from the May 2026 update

In periodic checks, review the CA flags (ESC6), the templates being issued, and the permissions on templates and the CA.

C:\> certutil -getreg policy\EditFlags     # EDITF_ATTRIBUTESUBJECTALTNAME2 must not be present
C:\> certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2
C:\> certutil -CATemplates                 # List of templates being issued
C:\> certutil -setreg CA\AuditFilter 127   # Enable CA auditing (request 4886, issuance 4887, and so on)
  • Remove unused templates from issuance. Copy version 1 templates (such as the default “Web Server”) to make them version 2 or later (a countermeasure against ESC15)
  • Require HTTPS and Extended Protection for web enrollment (/certsrv), and remove it if it is not used (a countermeasure against ESC8)
  • Back up the CA’s key and database regularly, and try the restore procedure (certutil -backup, Backup-CARoleService)

The key is to have all three: checking the settings, a way to notice (audit logs), and a way to recover (backups).

On Windows Server 2025, with the May 2026 security update (KB5087539) and later, AD CS can create CAs and templates with the post-quantum signature algorithm ML-DSA (FIPS 204) (phase 1; ML-KEM and composite signatures are planned for the future). Clients need Windows 11 24H2 or 25H2 with updates from October 2025 or later, and support in other operating systems and browsers is limited, so it is for testing for now. Also, Windows Server 2025 cannot use RSA certificates shorter than 2048 bits for TLS server authentication.


ACM (AWS Certificate Manager)

From here we turn to the cloud. First, AWS ACM.

Diagram showing three ways to use an ACM certificate validated with a Route 53 CNAME: place it free on AWS services such as ALB, CloudFront, and API Gateway with automatic renewal; export it for a fee and use it on EC2 or on premises; and issue and renew it with ACME from July 2026
ItemDetails (as of September 2026)Notes
Issuer and costAmazon Trust Services. Public certificates used with AWS services are freeIf you use CAA, allow amazon.com and others
Validity and renewal198 days (for certificates issued or renewed on or after February 18, 2026). Renews automatically 45 days before expirationChanged from 395 days to match shorter validity periods (Part 6)
Domain validationDNS validation (CNAME), email validation, HTTP validation (CloudFront)Deleting the DNS validation CNAME stops automatic renewal. Email validation needs approval at every renewal
Where it can be placedELB, CloudFront (issued in us-east-1), API Gateway, and so onThe private key cannot be taken out and is managed inside AWS
Exportable public certificatesSince June 2025. You can take them out with the private key and use them on EC2 or on premises ($7 per FQDN for the 198-day version, $79 for a wildcard)You protect the exported key and redeploy after renewal yourself
ACME supportSince July 2026. You can issue and renew with ACME clients such as certbot and cert-managerCheck the ACM pricing page for the cost
Imported certificatesCertificates from other CAs can be used with ELB and othersNot renewed automatically. Monitor the expiration yourself

When ACM cannot renew before expiration, notifications go out through AWS Health and EventBridge from 30 days before (for an overview of ACM, see Part 9 of the earlier series Cloud Fundamentals). Where you place the certificate determines how the key is handled. If you place it on AWS services, the key never leaves AWS.

The easily overlooked pitfalls are that deleting the DNS validation CNAME stops automatic renewal, and that imported certificates are not renewed automatically.


AWS Private CA and the Azure equivalents

RoleAWSAzureDifferences and notes
Issuing and auto-renewing public certificatesACMManaged certificates for App Service and Front DoorAzure has no general-purpose service equivalent to ACM
Storing certificates and keysACM (import)Key Vault (certificates)Key Vault can renew automatically in cooperation with DigiCert and GlobalSign
Private CAAWS Private CA (general-purpose mode $400 per CA per month, short-lived certificate mode $50 per CA per month)No general-purpose CA service. For devices, Microsoft Cloud PKI in Intune; otherwise AD CS on a VMShort-lived certificate mode issues only certificates valid for up to 7 days
Auto-enrollment for AD devicesPrivate CA Connector for ADMicrosoft Cloud PKI (distributed with Intune SCEP)In both, distributing the root is needed separately
Termination at a load balancerALB and NLB (ACM certificates)Application Gateway and Front Door (Key Vault certificates)The idea is the same
Diagram mapping the certificate services of AWS and Azure by role (public certificates, storage, private CA, AD devices, and termination at a load balancer), showing that only the private CA does not map one to one

AWS centers on ACM and Private CA, and Azure on Key Vault. Only the private CA does not map one to one. AWS Private CA can build a hierarchy of a root and subordinate CAs, and there is also a per-certificate charge ($0.75 per certificate up to 1,000 certificates per month in general-purpose mode). It suits internal web servers, mTLS between containers (Part 7), and certificates for IoT devices. If you move from AD CS, Connector for AD lets you carry over auto-enrollment.


TLS termination and re-encryption at load balancers

MethodWhere the certificate and key areWhat the load balancer can doSuited for
Termination (the LB decrypts, and HTTP goes on to the servers)One public certificate on the LBRouting by path and host name, session persistence with cookies, WAFThe network between the LB and the web servers is trusted
Termination plus re-encryptionA public certificate on the LB, an internal certificate on the web serversSame as above. The path behind the LB is also encryptedPolicy requires “encryption on the whole path”
Passthrough (forward as TCP)A public certificate and key on each web serverOnly TCP load distribution (the content cannot be seen)End-to-end encryption is required, mail using STARTTLS, and so on
Diagram showing three methods: termination, in which the LB decrypts and sends HTTP onward; re-encryption, in which the LB decrypts and encrypts again with a certificate from the private CA; and passthrough, in which TCP is forwarded as is and the same key is needed on every web server
  • Count certificates by name, not by number of servers. With passthrough, the same key is multiplied by the number of web servers
  • With re-encryption, check whether the LB verifies the web server’s certificate. AWS’s ALB does not verify the target’s certificate, so communication works even with a self-signed or expired certificate

The “it works even with self-signed certificates behind the ALB” from the opening is exactly this. It works because the ALB is not verifying, not because it is safe. The more places the key is kept, the greater the risk of leakage and the effort of renewal.


How vSphere certificates work

Finally, vSphere certificates, which infrastructure engineers often run into.

Diagram showing that when you connect with the vSphere Client, you see the Machine SSL certificate (port 443) in the VECS inside vCenter Server, signed by vCenter's built-in VMCA (root valid 10 years), and that ESXi automatically receives a 1,825-day certificate when it is added
  • vCenter Server has a built-in CA called VMCA (VMware Certificate Authority). In vSphere 7 and later the PSC was merged into vCenter, so today this means vCenter’s VMCA
  • What users see in the browser is the Machine SSL certificate used on port 443
  • When ESXi is added to vCenter, it automatically receives a certificate signed by VMCA. The validity period is 1,825 days (5 years) by default. The VMCA root is valid for 10 years by default, and certificates signed by VMCA do not outlast the root’s expiration
  • With vCenter 8.0 Update 3h and later, the VMCA Machine SSL certificate is automatically renewed 5 days before expiration

By default the issuer is VMCA for everything, so you need to distribute the VMCA root to make it trusted.

Ways to use VMCA

MethodCertificates you get from a private CAManagement effortSuited for
Use VMCA as is (default)None. Distribute the VMCA root to administrators’ devicesMinimal. Adding and renewing ESXi is automaticSmall environments used only by administrators
HybridOnly vCenter’s Machine SSL: one web server certificate from the private CASmall. ESXi stays on VMCAPolicy does not allow creating a CA below the private CA, and you want to remove the vSphere Client warning
Make VMCA an intermediate CAOne certificate for a “subordinate certification authority” (a web server certificate will not work)Small. From then on VMCA issues automatically in the private CA’s chainMedium to large environments that want to align with the private PKI. Do it before adding ESXi
CustomAs many as vCenter plus the number of ESXi hosts (example: 1 + 8 certificates)Large. Issuing and renewing are manual work for every hostOnly when policy does not allow using VMCA
Diagram showing the number of certificates obtained from a private CA: 0 for the default, 1 for hybrid, 1 for making VMCA an intermediate CA, and 9 for custom with vCenter and 8 ESXi hosts, and that this number is the amount of manual work

Broadcom does not recommend a single method; it says that “hybrid is common for small environments and an intermediate CA for large ones, and custom is often not worth the effort.” Wildcard certificates cannot be used. Check the procedure by version in Broadcom TechDocs. The number of certificates you get from the private CA is the amount of manual work. In the exercise in Part 11 (question 5), you think through how to choose.


Think about it

  1. How many tiers is your internal AD CS, and where is the root CA’s private key? When will the root CA’s CRL next expire?
  2. Among the templates being issued, is there one that has all three: “the applicant can specify the name,” “it can be used for client authentication,” and “ordinary users can enroll”?
  3. Behind your internal load balancers, in how many places is the private key of a public certificate kept? Can you reduce that to one?

Hint: For question 1, look at NextUpdate in certutil -dump RootCA.crl. For question 2, think about “Certificate templates and auto-enrollment” and “ESC1.” For question 3, think about the three methods in “TLS termination and re-encryption at load balancers.”


Summary

  • AD CS has two tiers: an offline root CA plus an enterprise issuing CA. Do not forget renewing the root’s CRL
  • Do not put the issuing CA on a DC, but protect it as Tier 0 with the same weight as a DC
  • Build the template subject from AD. Do not create a template that meets all three ESC1 conditions
  • Strong certificate mapping was fully enforced in September 2025. Watch for old certificates without a SID
  • ACM uses 198 days and renews automatically 45 days before. Do not delete the DNS validation CNAME. Imported certificates are not renewed automatically
  • ALB does not verify the target’s certificate. For vSphere, hybrid or an intermediate CA is realistic

Next time, we summarize the steps for isolating the cause when a certificate error occurs.


The Certificate Fundamentals series (11 parts)

All 11 parts with a reading guide: Certificate Fundamentals

  1. Why Do We Need Certificates?
  2. Cryptography basics
  3. Trying it with openssl and PowerShell
  4. Inside an X.509 certificate
  5. PKI and how trust works
  6. Certificate types and issuance
  7. How TLS works
  8. Lifecycle and automation
  9. Private PKI and the cloud (this article)
  10. Certificate troubleshooting
  11. Certificate design exercises

This series is the English edition of 【証明書入門】, originally written in Japanese.

コメント

Copied title and URL