Implementing Two-Tier PKI on Windows Server 2022 – Part 3

3 Oct 2024 | PKI, Microsoft

Configuring Root and Subordinate Certificates Deployment via Group Policy on Windows Server 2022

In the first two parts, we successfully set up our Two-Tier PKI infrastructure on Windows Server 2022. In this third part, we’ll configure the deployment of root and subordinate certificates via Group Policy.

First, ensure the root certificate from RootCA (RootCA_Pwoks-RootCA-CA.crt) is located in C:\CertData and C:\Windows\System32\certsrv\CertEnroll. Similarly, the subordinate CA certificate from SUBCA (RootCA_Pwoks-RootCA-CA.crt) should be in C:\Windows\System32\certsrv\CertEnroll.

Next, create a new folder named C:\Certs on the SubCA server. Copy RootCA_Pwoks-RootCA-CA.crt and SubCA.pwoks.local_pwoks-SUBCA-CA.crt to this folder. Rename RootCA_Pwoks-RootCA-CA.crt to RootCA.crt and SubCA.pwoks.local_pwoks-SUBCA-CA.crt to SUBCA.crt for easier understanding.

Before renaming Certs

After Renaming Certs

Then, copy the contents of C:\Certs from SUBCA to the domain controller DC. Create a C:\Certs folder on DC and copy the contents from SUBCA. On DC, double-click both certificates in C:\Certs to verify that RootCA is valid until 2034 (10 years) and SUBCA is valid until 2029 (5 years).

Copy Certs to DC

If you have multiple domain controllers, replicate the C:\Certs directory on each one and deploy the certificates accordingly.

On DC, open Active Directory Users and Computers and create two new OUs: Servers and DomainPCs.

Add the DomainPCs OU to Active Directory Users and Computers. Install a Windows 11 VM named Client, add it to the domain, and move it from the Computers OU to the DomainPCs OU for testing.

Create OU Groups in DC

Distribute RootCA and Subordinate CA certificates to domain PCs using Group Policy

To deploy the certificates via Group Policy, open Group Policy Management on DC by typing gpmc.msc in the search bar. Find the DomainPCs OU, right-click, and select “Create a GPO in this domain, and Link it here…”.

Create a GPO for DomainPCs

Name the new GPO PKICerts and click OK. Expand the DomainPCs OU, right-click on PKICerts, and select Edit.

Edit PKICerts GPO

In the Group Policy Management Editor, expand Computer Configuration – Policies – Windows Settings – Security Settings, and Public Key Policies. Right-click on Trusted Root Certification Authorities and select Import.

Import to Trusted RootCA

In the Certificate Import Wizard, browse to C:\Certs and select RootCA.crt.

Select RootCA

Ensure Trusted Root Certification Authorities is selected, then click Next and Finish. Right-click on Intermediate Certification Authorities and select Import.

Import to Intermediate CAs

Select SUBCA.crt, ensure Intermediate Certification Authorities is selected, then click Next and Finish.

Select SubCA

To verify the certificate deployment, open CMD as an administrator on Client. And Run

gpupdate.exe /force

Open MMC, add the Local Computer Certificates snap-in, and verify that RootCA is in Trusted Root Certification Authorities.

Verify RootCa Certs are in Trusted

and SUBCA is in Intermediate Certification Authorities. Duplicate certificates may appear, which is normal.

Verify SubCA is in Intermediate

Deploy the Root Certificate to the Domain Controller

We can do this in two ways. One method is to link the PKICerts policy we created to the Domain Controllers OU. However, we will use the second method, which involves manually installing RootCA.crt and SubCA.crt.

Open C:\Certs on DC, double-click on RootCA.crt, and select Install Certificate.

Install RootCA on to DC

Choose Local Machine, then select “Place all certificates in the following store” and choose Trusted Root Certification Authorities.

RootCA Certs Location

Click Next and Finish. This completes the necessary steps for this part.

Optional – Enable Access to Certs for Linux, Android, and iOS Machines

This step is optional but useful if you have Linux, Android, or iOS devices in your environment.

We will perform this part on the SubCA server, which already has everything in place and the certificates in the C:\Certs folder. We need to create a new virtual directory in IIS.

On the SubCA server, start IIS Manager, right-click on Default Web Site, and select Add Virtual Directory.

Add New Virtual Directory to SubCA

Create an alias named Certs and point it to the C:\Certs directory as the physical path.

Alias for Certs

Click on the Certs directory under Default Web Site, select Directory Browsing, and enable it. Restart IIS for good measure. Now, if you go to the Linux client you installed and added to the domain, you can access the certificates by entering http://subca.pwoks.local/certs. This is very useful.

With these steps, we have streamlined the deployment of RootCA and SubCA certificates across the domain and different platforms, making our infrastructure more resilient and our lives easier.

Categories

Recent Posts

Implementing Two-Tier PKI on Windows Server 2022 – Part 6

Implementing Two-Tier PKI on Windows Server 2022 – Part 6

Implementing Two-Tier PKI on Windows Server 2022 – Part 6 Active Directory Certificate Services offers numerous predefined templates for various uses. We’ll explore some of these templates, customize them, and discuss best practices. Key Points for Certificate...

Implementing Two-Tier PKI on Windows Server 2022 – Part 6

Implementing Two-Tier PKI on Windows Server 2022 – Part 5

In part five, we will cover Private Key Archive and Recovery. Backup is crucial, and we should implement it in this architecture. We will also explore Certificate Templates to enable Private Key Archival. Let’s begin. If there’s anything unclear, please refer to the...

Implementing Two-Tier PKI on Windows Server 2022 – Part 6

Implementing Two-Tier PKI on Windows Server 2022 – Part 4

In the first and second parts, we deployed PKI, and in the third part, we made these certificates available on our domain via group policy. Now, we will configure the Online Responder Role, which is crucial for the revocation of certificates. This guide will show you...

Implementing Two-Tier PKI on Windows Server 2022 – Part 6

Implementing Two-Tier PKI on Windows Server 2022 – Part 2

In Part 1 of our guide on implementing a Two-Tier PKI on Windows Server 2022, we introduced the basics of PKI, set up the lab configuration, and established the offline Root CA. Now, in Part 2, we’ll dive deeper into configuring the Subordinate CA. Introduction Before...

Share This