How many Subject Alternative Names (SAN) do the Active Directory Certificate Services support?

Like any software Microsoft Active Directory Certificate Services are also subject to certain limitsimposed by their design.

The question of how many Subject Alternative Names (SANs) can be issued with the Microsoft Certification Authority is not so obvious.

To find this out, let's write ourselves a little test with the PSCertificateEnrollment PowerShell module, which repeatedly requests certificates and gradually increases the number of alternative requestor names.

Import-Module PSCertificateEnrollment
1..1000 | ForEach-Object -Process {
$sans = @(1..$_ | % { "san-test-$_.intra.adcslabor.de" })
New-CertificateRequest -Subject "CN=A Test" -Dns $sans | Get-IssuedCertificate -ConfigString "CA02.intra.adcslabor.de\ADCS Labor Issuing CA 1" -CertificateTemplate "ADCSLaborWebServer"
}

This goes well for a while, but suddenly the certificate applications are rejected.

The last successfully issued certificate contains 127 alternative applicant names.

The certification body reports that a field size has been exceeded for all further certificate requests with more alternative applicant names.

In the event display we find the Event with ID 22 of the source Microsoft-Windows-CertificationAuthority with the same content.

As it turns out, the certification authority is not able to create a database row for the certificate application because the field size has been exceeded.

The certificate extensions are stored in a separate field in the certification authority database. As it turns out, this field is limited to 4096 bytes, which is exceeded with additional SANs.

So we have formulated our question incorrectly: There is no restriction on the Quantity of the alternative applicant names, but for the Total size of all certificate extensionsof which Subject Alternative Names is one of many others.

Dass in meinem Test genau 127 – eine in der IT-Welt andere Schlüssel nahelegende Zahl – SANs möglich waren, war mehr oder weniger Zufall. Die tatsächlich erreichbare Anzahl hängt von der Anzahl der Zeichen und weiterer Zertifikaterweiterungen im Zertifikatantrag ab, wie ein erneuter Test mit deutlich weniger Zeichen zeigt…

Dann speichere ich die Zertifikatanträge einfach nicht in der Datenbank

Von einem Leser habe ich die Anregung erhalten, dass es ja die Option gibt, die Zertifikatanträge nicht in der Zertifizierungsstellen-Datenbank zu speichern.

Diese Option ist in den meisten Fällen natürlich nicht sinnvoll, da entsprechende Zertifikate nicht zurückverfolgt und auch nicht widerrufen werden können.

Damit diese Option funktioniert, muss noch folgende globale Einstellung aktiviert werden:

certutil –setreg DBFlags +DBFLAGS_ENABLEVOLATILEREQUESTS

Nun sind noch einmal deutlich mehr SANs, respektive größere Zertifikaterweiterungen möglich, bevor wir letztendlich in die Limitierungen des MS-WCCE Protokolls laufen.

Das letzte erfolgreich ausgestellte Zertifikat ist ca. 90 Kilobyte groß.

Notes

Ich bin gespannt, ob die Limitierungen der Zertifizierungsstellen-Datenbank auch bei Aussagen zur künftig zu erwartenden Unterstützung von Post-Quanten-Kryptographie mit der Microsoft-Zertifizierungsstelle berücksichtigt wurden, da hier von deutlich größeren Zertifikaten ausgegangen werden kann.

Related links:

External sources

en_USEnglish