Chapter 3 of 8

Certificate templates

The object that decides who may enrol, what the subject may contain, and what the certificate can do.

About 13 minutes of reading

By the end of this chapter you can

  • Explain what a template controls
  • Distinguish Read, Enroll and Autoenroll permissions
  • Identify the settings that make a template dangerous
  • Apply manager approval and subject restrictions

01A template is a policy object

An enterprise CA cannot issue arbitrary certificates. Every certificate is based on a template, and the template decides almost everything: who may request it, what goes into the subject, which key usages apply, how long the certificate lasts and whether an administrator must approve it.

02The three permissions people confuse

PermissionAllowsRisk if too broad
ReadSee the template exists and its settingsLow, but enables discovery of weak templates
EnrollRequest a certificate from the templateDirect: the requester gets a certificate
AutoenrollReceive certificates automatically by policySilent issuance at scale after a template change
Write / Full ControlModify the template itselfSevere: can convert a safe template into an abusable one

Write access to a template object is one of the most valuable permissions in an AD environment, because it lets an attacker change the rules rather than find a way around them. This is the condition behind ESC4.

03Settings that decide safety

SettingSafe choiceWhy
Subject name sourceBuilt from AD informationPrevents a requester choosing another identity
Supply in the requestDisabledThe core condition behind ESC1
Extended Key UsageExactly what is neededClient Authentication on a broad template creates credentials
Any Purpose / no EKUAvoidTurns a convenience template into a wildcard
Manager approvalEnabled for sensitive templatesTurns issuance into an explicit decision
Enrolment agentRestricted to dedicated accountsOtherwise anyone can request on behalf of anyone
Key archivalOnly for encryption templatesArchived signing keys are a liability
Validity periodShort for TLS, longer only with justificationBounds the lifetime of a leaked key

04A safe template review

  1. 1

    List published templates

    Unpublished templates cannot be requested, which is a cheap way to reduce surface.

  2. 2

    Map effective permissions

    Include nested groups; an apparently narrow ACL can still include Everyone through a group chain.

  3. 3

    Check subject behaviour

    Is the subject built from AD, or supplied by the requester?

  4. 4

    Check EKU and application policies

    Does this certificate authenticate, sign code, or only encrypt?

  5. 5

    Check approval and validity

    Are sensitive requests reviewed, and is the lifetime proportionate?

  6. 6

    Record the decision

    Note owner, justification and review date, so the next person understands the intent.

Why is 'Supply in the request' dangerous?

It lets the requester put any name in the subject or SAN, so with an authentication EKU the certificate can represent another identity.

A template is safe but has Write permission for Domain Users. What is the risk?

Any user can change the template into an unsafe one — the ESC4 pattern.

What to remember

  • Templates decide enrolment rights, subject source, EKU, approval and lifetime
  • Read, Enroll and Autoenroll are different levels with different risk
  • Write access to a template can turn a safe configuration into an abusable one
  • Review permissions, subject behaviour, EKU, approval and validity together