Limits of Microsoft Active Directory Certificate Services
Active Directory Certificate Services have existed (albeit under a different name) in their basic form since Windows NT 4.0. The Active Directory-based architecture used today was introduced with Windows 2000 Server. AD CS is very well integrated into the Windows ecosystem and continues to enjoy great popularity worldwide in companies and government agencies of all sizes.
People like to point out the many possibilities offered by Active Directory Certificate Services. Rarely, however, is it pointed out what is not possible with them. In fact, the product has by now reached its limits in many places.
What these are will be explained in more detail below in order to better decide whether AD CS can be the right solution for planned projects.
General
The product is not open source, so (further) development takes place behind closed doors and is not transparent to the outside world. The product documentation is partly outdated, incomplete and distributed over many different media (including books, articles only available via archives, and individual blogs).
As of today (2022), there is no known active further development of the product by Microsoft anymore (in the recent Windows Server 2022 release, exactly nothing was changed at all in AD CS. Security updates are only incorporated half-heartedly ). In some cases, not even bugs known for years are fixed.
As a result, many restrictions and workarounds are now necessary, so the product's future viability is questionable at the very least.
There is currently also no replacement or follow-on product available or announced by Microsoft as a cloud service in Microsoft Azure.
Currently, there is also no known plan for dealing with the issue of post-quantum cryptography (composite/hybrid certificates) in conjunction with AD CS, and crypto-agility is limited due to the dependency on the crypto libraries in the Windows operating system. Modern algorithms like EdDSA (especially interesting for IoT use cases, others are already further along here ) are not usable with AD CS.
Microsoft-affiliated author Roger A. Grimes writes in his book "Cryptography Apocalypse " that Microsoft has at least successfully tested AD CS with (experimental) quantum-resistant algorithms, so that these could be used (i.e., presumably, integrated into a new version of the product) as soon as it is required (and the standardization process is completed).
Certification Authority
Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.
Design
From the point of view of PKI technology, it is possible to run multiple certification authorities on the same server without any problems. Vendors like MTG , Nexus or PrimeKey are already successfully demonstrating this, and the same applies to open source projects such as OpenSSL or OpenXPKI .
However, because of the binding to the Kerberos identity of the certification authority server, Active Directory Certificate Services requires that a complete Windows Server instance be run for each logical certification authority.
Likewise, at least one certification authority per Active Directory forest is required (note: there are third-party solutions to address this problem).
Consequently, the same applies to various combinations of hash algorithms (e.g. SHA-1 for legacy applications in parallel to a hierarchy using modern algorithms) and key types (RSA, ECC) .
In large companies, it is common for certification authorities to be divided and restricted per intended use , and also that there are multiple Active Directory environments as well as certification authority hierarchies, which inevitably leads to an unnecessarily large number of certification authority servers, all of which need to be managed, hardened, updated, maintained, and ultimately paid for.
This is very annoying not only, but especially for offline certification authorities, since a separate server is needed for each of these as well, and these servers generate a particularly high relative workload due to the lack of central management, despite the low certificate volume.
But even the configuration of online certification authorities (where it makes sense) can only be done centrally with a lot of effort (for example with PowerShell Desired State Configuration (DSC). Although there are corresponding projects which, however, only partially cover the required functionality so far).
A generation change between multiple hierarchies is also subject to the same constraint and creates an unnecessarily large number of servers during the transition.
The operation of Windows servers should not really be the main occupation of PKI operators. The overhead generated by the outdated architecture (operating system, management components, antivirus, scripts) increases enormously very quickly and, in addition to a high system load, also generates corresponding costs and an avoidable negative ecological footprint.
The "Key Storage Provider " interface used is not designed for use with network appliances. For example, if one uses a network hardware security module (HSM) and the connection to it is briefly interrupted, the certification authority service is no longer able to use the certification authority's private key, certificate requests fail accordingly and CRLs can no longer be issued until the certification authority service is restarted.
Separation of certification authority (CA) and registration authority (RA)
There is no clean separation of certification authority and registration authority:
- Requesting certificates via RPC/DCOM is only possible directly against the certification authority, so an online certification authority must be exposed to all clients on the network, which can pose an increased security risk.
- The decision whether or not to issue a certificate is made directly at the certification authority, not at an upstream Registration Authority.
- The Network Device Enrollment Service (NDES) is often referred to as a Registration Authority, but it does not meet the criteria for one. It cannot sufficiently check and prefilter certificate requests. NDES is more of a protocol conversion than a true RA. Such certificate requests could, however, (mostly) be intercepted on the certification authority side via a self-developed policy module such as TameMyCerts .
- The same applies to Certification Authority Web Enrollment (CAWE) .
- The Certificate Enrollment Web Services (CEP and CES) also do not fulfill the criteria for a Registration Authority, since certificate requests are passed on unchecked and are only evaluated by the certification authority's policy module, i.e. directly by the certification authority, i.e. this is also more of a protocol conversion than a proper Registration Authority.
There is no support for implementing true high availability (see the section on the certification authority database). This means that the product is not actually "enterprise-ready".
Installation routine
The hard-coded default settings during installation or role configuration...
- ...require Enterprise Administrator permissions to install the certification authority (see also the section on certificate templates). In the case of the certification authority, the permission can be delegated, for NDES there is an unofficial workaround , but in the case of CEP/CES, there is no chance, so its use in security-conscious corporate environments may be limited or not possible at all.
- ...allow any installed certification authority to issue logon certificates for Active Directory by adding the certification authority certificate to the NTAuthCertificates object. Although this can be changed afterwards, it contradicts the Secure by Design, Secure by Default principle.
- ...bind the default certificate templates for issuance immediately after installation, unless this is explicitly prevented during installation, so that there is a great risk of unwanted/unmanaged certificates being issued immediately after installation (at this point, no configuration of, for example, CDP/AIA and no functional test has yet taken place).
- ...also open the Windows firewall in the default setting for the remote administration interfaces of the certification authority , which unnecessarily increases the attack surface.
Active Directory Integration and Certificate Templates
Certificate templates are stored in Active Directory. In large environments, these often have to be created by manual request from another team, which prevents automation and slows down processes.
There is no method officially supported by Microsoft for scripting, i.e. automating, the creation and editing of certificate templates. Even though there are unofficial ways, even from (former) Microsoft employees themselves , Microsoft takes the position that this procedure has not been tested and therefore cannot receive product support.
Individual AIA/CDP addresses cannot be defined via certificate template settings. The configuration always applies globally to all certificates issued by a certification authority, although this could technically be broken down to the respective certificate types. If a distinction is required here, an additional certification authority must be established (see section "Design").
Certification authorities that are not integrated into Active Directory ("standalone") have no possibility at all to define certificate profiles analogous to the certificate templates stored in Active Directory.
LDAP CRLs can be at most 10 MB in size (due to a limitation in Active Directory).
The administration of the certification authorities is bound to the Active Directory accounts of the respective forest. In large enterprise environments that have multiple Active Directory forests (if only because there is also a test and staging environment), PKI administrators are thus forced to use multiple user accounts for different environments (unless a trust relationship is established between the environments) and the certification authorities cannot be managed centrally (i.e. across multiple Active Directory forest boundaries) (if - as is usually the case - no trust relationship is established).
For authentication and certificate requests across a trust relationship, the trust must be mutual.
Since certification authority servers are members of Active Directory, they can also be compromised through it in a variety of ways (Group Policies, logons of unauthorized accounts with administrator privileges, compromised service accounts).
The same applies to CRL publication and to requesting the OCSP response signing certificates. These are authenticated with the Active Directory mechanisms, so that the (often Internet-connected) security-critical CRL/OCSP servers are usually located in the same Active Directory forest as the certification authorities and are often administered with the same accounts. This increases the risk that a compromise of a CRL/OCSP server will spread to the certification authorities.
In addition, for the OCSP responder (if one wants to use the automatic request and renewal of the OCSP response signing certificate), a separate (sensibly highly available) instance of the Online Responder must be implemented in each Active Directory forest.
Requesting certificates via RPC/DCOM , with and without autoenrollment, reduces the identification of the requester to its Kerberos identity (its Windows logon). Since this is usually done only by entering a user name and password, the identification of a certificate's requester by the certification authority is ultimately no stronger than verifying knowledge of a user name/password combination.
The high level of integration and the corresponding marketing through the product name, which also contains "Active Directory", mislead many administrators into thinking that PKI equals Active Directory.
Certification Authority Database
The number of subject alternative names that can be issued is limited: certificate extensions can have a maximum total size of 4 KB (due to a limitation of the certification authority database)
The certification authority database can manage a maximum of 2,147,483,647 certificates (32-bit or 4-byte signed integer, database schema limitation). Effectively, however, the certification authority database becomes increasingly sluggish in queries with increasing size, so that it is hardly suitable (if at all) for more than a few million certificates.
With regard to data protection, it should be noted that there is also no automatic housekeeping for expired certificates (to meet the requirement for deletion of personal data when the purpose of collection ceases to apply). Such a project can only be implemented by script.
The certification authority database (Microsoft JET Blue Engine ) is implemented monolithically per server, it cannot be consolidated across multiple certification authorities and must be run directly on the respective certification authority servers.
The certification authority database allows database queries only with the provided proprietary interfaces , and even then only to a limited extent; these do not scale well with large amounts of data and require workarounds to be used in a meaningful way. Too many queries running simultaneously against the certification authority database can even block certificate and CRL issuance .
It does not allow searching for empty fields (e.g. an empty Common Name). The only possibility here is to read out all records and search for such entries with Windows PowerShell, for example. However, as the size of the database increases, such exports become slower and more time-consuming, so that in some cases they can no longer be realized with built-in tools at all.
Undefined Relative Distinguished Names (RDNs) , if allowed and used, are not indexed in the certification authority database.
It also does not store/index any identities contained in subject alternative names; these are only accessible by reading out the certification authority database and programmatically evaluating the raw certificate data obtained this way . The same applies to the new proprietary certificate extension added in May 2022 , which is supposed to increase security, but is passed through undetected in offline certificate templates.
The certification authority database does not allow advanced database queries as would be the case with a relational database system such as an SQL server.
The certification authority database does not allow the storage or linking of meta information (e.g., the certificate holder's email address or data required for billing the service) for manual certificate requests, nor the extension of the database schema in general.
The certification authority database does not allow database replication for true clustering (in the existing cluster implementation, only one cluster node can and may access the database files via the file system at a time, otherwise data corruption occurs very quickly, which is diametrically opposed to the intended high availability).
Certification Authority Service
Changes to the configuration of a certification authority require a restart of the service with a corresponding interruption of availability (see also the topic of clustering).
Policy module
The supplied Windows Default policy module does not allow rules to be defined for manual certificate requests. This very often leads to errors when issuing certificates (forgotten attributes, syntax errors are not detected, multiple CNs are possible, incorrect issuances with security implications, etc.).
The functional scope of the certification authority's policy module is not directly extensible. At least there are code samples for developing your own policy modules.
With TameMyCerts , a policy module is now available under an open source license that significantly extends the functionality of the Windows Default Policy Module while retaining the basic functionality provided by the original module.
Interfaces
As of today, Active Directory Certificate Services does not provide support for the following interfaces:
- Enrollment over Secure Transport (EST)
- Automatic Certificate Management Environment (ACME) (but there are 3rd party solutions from different Providers )
- Certificate Management Protocol (CMP)
- REST - or SOAP -based interfaces for requesting certificates are also nowhere to be found
Thus, in most cases, the only reasonably usable interface for requesting certificates is RPC/DCOM or MS-WCCE – a proprietary interface that was designed over 20 years ago for on-premises infrastructures and is nowhere near optimized for a cloud-native world. The interface is also limited to Active Directory authentication methods and forces certification authorities into the Active Directory ecosystem.
The existing protocol conversion interfaces also suffer from quite a few limitations.
Network Device Enrollment Service (NDES)
The implementation of the Simple Certificate Enrollment Protocol (SCEP) known as Network Device Enrollment Service (NDES) suffers from the following limitations:
- It is not possible to define policies for requesting certificates (e.g. allowed certificate content) (however, an API for your own implementation of a policy module is available, but no code samples or stubs are available for it from Microsoft).
- For each combination of certification authority, certificate template and (NDES) password policy, the installation of a separate Windows Server instance is necessary. In larger environments, the number of servers to be operated will therefore grow unnecessarily - just as with certification authorities. It is very irritating that Microsoft, with Intune, also subjects itself and its customers to this restriction .
- NDES is generally not reasonably configurable for high availability because there is no replication mechanism for the issued one-time passwords.
- As far as the interfaces for the Registration Authority certificates it uses are concerned, NDES still lives in the Cryptographic Service Provider (CSP) world, so inevitably no elliptic curves are supported for them.
- NDES unnecessarily requires that the installation be done with Enterprise Administrator privileges. In security-conscious enterprise environments, this permission is (rightly) not given out, so the role cannot be used (or only via a workaround , which, however, officially forfeits product support).
- The Registration Authority certificates required for operation are, in Microsoft's product documentation not used at all .
Certificate Enrollment Web Services (CEP/CES)
The Certificate Enrollment Web Services (CEP/CES) suffer from the following limitations:
- Due to a bug that has not been fixed to this day , they do not support version 4 certificate templates.
- During installation, CES requires (hard-coded and therefore not delegable) that the user is a member of "Enterprise Admins", which is a no-go for security-conscious enterprise environments.
Certification Authority Web Enrollment (CAWE)
A usable web-based user self-service is also not available. Certification Authority Web Enrollment (CAWE) suffers from the following limitations:
- It is hopelessly outdated and has not been actively developed for almost 20 years now.
- It does not support version 3 (or newer) templates.
- It does not support the definition of policies for the certificate content (but this can be mitigated with the TameMyCerts Policy Module ).
- Installation directly on the certification authority is not recommended for security reasons; installation on a separate server requires Kerberos delegation to be set up, which can drastically increase the risk from Kerberoasting.
Validation Authority
The Online Responder (OCSP) in turn relies on CRLs and not directly on the certification authority database. However, there are workarounds , which entail further maintenance effort.
There is no support for the Server-Based Certificate Validation Protocol (SCVP) .
Certificate Management
Microsoft still sells the FIM/MIM Certificate Management product, but this is still at home in the Cryptographic Service Provider (CSP) world and, according to current knowledge, will no longer receive any new functions. Newly adopting FIM/MIM CM in 2021 is therefore a dead end.
External sources
- Simple Certificate Enrollment Protocol (SCEP) does not strongly authenticate certificate requests (Carnegie Mellon University)
- ActiveDirectoryCSDsc (GitHub)
- Create Certificate Template in ADCS for PowerShell CMS Encryption (GitHub)
- Configure infrastructure to support SCEP with Intune (Microsoft)
- It's time to say goodbye to Microsoft PKI (Webinar series from KeyFactor)
