How the TameMyCerts Policy Module for Active Directory Certificate Services (ADCS) can help secure scenarios with Microsoft Intune and other Mobile Device Management (MDM) systems
Companies use Mobile Device Management (MDM) products for managing, configuring and updating mobile devices such as smartphones, tablet computers or desktop systems via the Internet (over-the-air, OTA).
Common mobile device management products are:
- Microsoft Intune
- VMware Workspace One (previously known under the brand name AirWatch)
- Ivanti MobileIron UEM
- Jamf Pro
- Baramundi Enterprise Mobility Management
- BlackBerry Enterprise Mobility Suite
- Sophos Mobile Control
- SOTI MobiControl
- Samsung Knox
- IBM MaaS360
TameMyCerts is a policy module to secure the Microsoft certification authority (Active Directory Certificate Services). It extends the functions of the certification authority and enables the extended application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem and is available under a free license. It can be downloaded via GitHub and used free of charge.
TameMyCerts is open source and can be used free of charge. For use in the corporate sector, however, we recommend concluding a maintenance contract. This ensures that you receive qualified support and that the module can be further developed to a high quality in the long term.
How it works
All of these systems use a similar concept in conjunction with a Microsoft certification authority: they act as a middleman between the managed device, the company's directory service and the certification authority. In PKI terms, they perform the role of the Registration Authority (RA) . They all use a type of connector to transfer certificate requests to the Microsoft AD CS certification authority.
All common MDM systems therefore require that the configured certificate template is set up as an offline certificate template, i.e. that the identity contained in the certificate and confirmed by the certification authority is specified by the enrollee, i.e. the MDM system ("Enrollee supplies Subject").

The certification authority therefore has no knowledge whatsoever of the requested certificate content; it issues the certificate requests blindly and must trust the MDM system completely.
Misissuance by the MDM system is not uncommon
Unfortunately, it is not uncommon for certificates to be misissued by the MDM system or with its permissions. Possible reasons could be:
- Misconfiguration of the MDM system.
- Misbehavior of the MDM system. For example, certificates may be requested for devices that are no longer assigned to an existing user. In this case, certificates with empty identities may be requested.
- Compromising the service account used and exploiting its enrollment permissions (see ESC1 attack ).
This opens the door to security and data protection incidents.
The usual installations of MDM systems in conjunction with Microsoft Active Directory Certificate Services are therefore vulnerable to the Swiss cheese model in which small gaps running through the chain of all systems involved can lead to major damage.
Swiss cheese model. Image source (adapted): Wikipedia / Davidmack, licensed under CC BY-SA 3.0 .
Specific example: No valid user is assigned to a managed device
In practice, it happens time and again with MDM systems that no valid user account is assigned to a managed end device.
In a simple case, for example, it would be configured that the Subject Distinguished Name (DN) of a certificate contains a commonName with the variable of the user name.
CN={EnrollmentUser}In this example, the syntax of VMware Workspace One is used, but all common MDM systems work in a similar way.
If this variable is now empty because no valid user account is assigned to the end device, a certificate request with an empty Subject Distinguished Name (DN) may be generated. MDM systems apparently behave differently here:
- Baramundi Enterprise Mobility Management generates an empty sequence in this case and the certification authority will reject the certificate request with the error message "Error Parsing Request The request subject name is invalid or too long. 0x80094001 (-2146877439 CERTSRV_E_BAD_REQUESTSUBJECT)" .
- VMware Workspace One will generate a certificate request with a Subject Distinguished Name (DN), which contains an empty commonName. Such a certificate request is issued by the certification authority. However, the resulting certificate will not contain an identity.
If, on top of that, you are unlucky enough that the application that checks the certificate at logon (e.g. a single sign-on (SSO) system) cannot handle such a case adequately, it may happen that such a certificate is assigned the identity of another, valid user at logon. The data protection and security incident is complete.
The solution: TameMyCerts
The TameMyCerts Policy Module for Microsoft Active Directory Certificate Services can close the gap at the certification authority level by controlling certificate requests by enforcing a fine-grained set of rules.
The possibilities include, among others:
- Enforcing syntax rules for the requested Subject Distinguished Name and Subject Alternative Name .
- Creating a connection between the requested identity in the certificate and the corresponding object in the Active Directory . Applying rules against the associated object, e.g. based on the status (active or deactivated), membership in groups or organizational units and other criteria.
- Modify the requested certificate content before the certificate is issued. Transfer or remove certificate fields, add static values or values from the associated Active Directory object.
Certificate requests that violate the defined rules will be rejected and the incident logged . This means that an alarm can also be set up to follow up potential security incidents.

TameMyCerts has rejected a certificate request that violated the defined rules.
Microsoft Intune uses the Network Device Enrollment Service (NDES) as a connector between Intune and the certification authority. NDES, as well as the certification authority itself, can be extended with policy modules. Microsoft provides a policy module for NDES for Intune, so no further policy module can be added to an NDES instance that has been configured for Intune. However, since TameMyCerts operates at the level of the certification authority and is installed on it, the advantages of both modules can be easily combined.
External sources
- Integration and administration guide for the TameMyCerts policy module for Active Directory Certificate Services
- Extending AD CS attack surface to the cloud with Intune certificates - dirkjanm.io (Dirk-jan Mollema)
- VU#971035 - Simple Certificate Enrollment Protocol (SCEP) does not strongly authenticate certificate requests (Carnegie Mellon University)
- Swiss cheese model (Wikipedia)

