Performing a functional test for the Certificate Enrollment Policy Web Service (CEP)

After installing a Certificate Enrollment Policy Web Service (CEP), or after more extensive maintenance work, an extensive functional test should be performed to ensure that all components are working as desired.

The Certificate Enrollment Web Services (Certificate Enrollment Policy Web Service, CEP, and Certificate Enrollment Web Service, CES) enable the automatic request and renewal of certificates from a certification authority via a web-based interface. This eliminates the need to contact the certification authority directly via Remote Procedure Call (RPC). For a more detailed description, see the article "Basics: Requesting certificates via Certificate Enrollment Web Services (CEP, CES) ".

Procedure

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.

A functional test of the Certificate Enrollment Policy Web Service includes the following steps:

  • Ensure that the Certificate Enrollment Policy Web Service starts
  • Check the Event Viewer of the Certificate Enrollment Policy Web Service
  • Verify the connection to the Certificate Enrollment Policy Web Service
  • Create a certificate enrollment policy
  • Query certificate templates via the Certificate Enrollment Policy Web Service
  • Request a certificate with CEP

Details: Ensure that the Certificate Enrollment Policy Web Service starts

Since the Certificate Enrollment Policy Web Service is implemented as a module within the Internet Information Server (IIS) service, it is not possible to check the service startup via the management console for services (services.msc). Instead, a corresponding event with no. 1 is logged in the Event Viewer.

However, this is only generated the first time it is called by a requester, so the step "Verify the connection to the Certificate Enrollment Policy Web Service" described below must be performed first for this purpose.

Event Properties, event 1 EnrollmentPolicyWebService: "The Certificate Enrollment Policy Web Service has started." by user INTRA\gMSA_CEP$

Details: Check the Event Viewer of the Certificate Enrollment Policy Web Service

First, the Windows Event Viewer on the Certificate Enrollment Policy Web Service should be examined for any relevant events that might indicate an error. For this purpose, there is a predefined view in the Event Viewer under "Custom Views" - "Server Roles" - "Active Directory Certificate Services", which has already defined the required filters on the Event Viewer.

Event Viewer, "Active Directory Certificate Services" view: event 5 "The Certificate Enrollment Policy Web Service has been stopped."

Details: Verify the connection to the Certificate Enrollment Policy Web Service

Kerberos authentication can be tested with the following command line command.

certutil -ping -kerberos -config "https://{Servername}/ADPolicyProvider_CEP_Kerberos/service.svc/CEP" CEP

Command prompt: certutil -ping -kerberos -config with the CEP URL ends with "CertUtil: -ping command completed successfully."

Authentication with username and password can be tested with the following command line command.

certutil -username {Domäne}\{Benutzername} -p {Passwort} -ping -config "https://{Servername}/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP" CEP

Command prompt: certutil -username INTRA\rudi -ping -config with the CEP URL ends with "CertUtil: -ping command completed successfully."

Authentication with a client certificate can be tested with the following command line command.

certutil -ClientCertificate {Thumbprint} -ping -config "https://{ServerName}/ADPolicyProvider_CEP_Certificate/service.svc/CEP" CEP

Command prompt: certutil -ClientCertificate -ping -config with the CEP URL ADPolicyProvider_CEP_Certificate completes successfully

If you encounter problems with this step, the following articles may be helpful:

Details: Create a certificate enrollment policy

Now a certificate enrollment policy can be configured. The procedure is described in the article "Configuring a certificate enrollment policy (enrollment policy) for the Certificate Enrollment Web Services (CEP, CES)".

Dialog "Certificate Enrollment Policy Server": the URI "was validated successfully." (highlighted), authentication type "Windows integrated"

If you encounter problems with this step, the following articles may be helpful:

Details: Query certificate templates via the Certificate Enrollment Policy Web Service

If a certificate enrollment policy has been configured for the current user as described previously, it can now be used to query the certificate templates via the Certificate Enrollment Policy Web Service.

certutil -template -policyserver *

This is cached information that is generated only after a query has been made with the Microsoft Management Console (MMC).

Command prompt: certutil -template -policyserver * lists 8 templates from the policy server "Fabrikam CEP Kerberos (Default)"

Request a certificate with CEP

For this, a Certificate Enrollment Web Service (CES) must also first be installed in the network. A description of the procedure can be found in the article "Installing a Certificate Enrollment Web Service (CES)".

A certificate enrollment policy can then be set up and a certificate can be requested via the web services.

If you encounter problems with this step, the following articles may be helpful:

Other possible errors that can occur at this point and are caused by the Certificate Enrollment Web Service (CES) are described in the article "Performing a functional test for the Certificate Enrollment Web Service (CES)".

Follow-up tasks

If a certificate enrollment policy was set up manually for testing, it can now be removed again. The procedure for this is described in the article "Deleting a manually configured certificate enrollment policy (enrollment policy) ".