thalese-security microsoftadcs andocspgo.thalesesecurity.com/rs/480-lwa-970/...and_ocsp... · ocsp...
TRANSCRIPT
Thales e-Security
Microsoft AD CS and OCSPIntegration Guide for Microsoft Windows Server 2012 and 2012 R2
www. t ha les-esecur it y . com
Version: 1.3
Date: 09 November 2015
Copyright 2015 Thales UK Limited. All rights reserved.
Copyright in this document is the property of Thales UK Limited. It is not to be reproduced, modified,adapted, published, translated in any material form (including storage in any medium by electronicmeans whether or not transiently or incidentally) in whole or in part nor disclosed to any third partywithout the prior written permission of Thales UK Limited neither shall it be used otherwise than for thepurpose for which it is supplied.
Words and logos marked with ® or ™ are trademarks of Thales UK Limited or its affiliates in the EUand other countries.
Information in this document is subject to change without notice.
Thales UK Limited makes no warranty of any kind with regard to this information, including, but notlimited to, the implied warranties of merchantability and fitness for a particular purpose. Thales UKLimited shall not be liable for errors contained herein or for incidental or consequential damagesconcerned with the furnishing, performance or use of this material.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 2
ContentsChapter 1: Introduction 5
Product configurations 5
Supported Thales nShield functionality 6
Requirements 6
This guide 6
More information 6
Chapter 2: Procedures 7
Installing the HSM 7
Installing the software and creating or sharing the security world 7
Installing and configuring AD CS 7
Verifying that the CA service has started successfully 9
Installing and configuring AD CS onWindows Server Core 10
Verifying that the CA service has started successfully 11
Installing and configuring AD CS via PowerShell 11
Configuring auto-enrollment group policy for a domain 13
Configuring the Thales nShield HSM with Certificate Services 14
Configuring Certificate Services with a new key 14
Configuring Certificate Services using an existing private key 14
Configuring Certificate Enrollment to use CA templates 15
Setting up key use counting 16
Key use counter overview 16
Installing Certificate Services with key use counting 16
CA Backup, migrate and restore 17
Backing up, migrating and restoring CA using an existing certificate and its associated privatekey 18
Backing up, migrating and restoring the CA using an existing private key 20
Installing the OCSP 21
Configuring the CA to issue an OCSP Response Signing Certificate 23
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 3
Configuring certificate templates for your environment 23
Configuring the CA to support theOnline Responder service 24
Requesting a certificate from OCSP Response Signing template 24
Verifying that the signing certificate is properly configured 25
Modifying the Online Responder service to use an Thales HSM 25
Setting up a revocation configuration 25
Verifying that OCSP works correctly 26
Generating a certificate request 26
Removing information about the certificate's CRL 27
Retrieving information about the certificate's AIA, CRLs, and OCSP 28
Verifying the OCSP Server is Active 29
Uninstalling AD CS and OCSP 29
Chapter 3: Troubleshooting 30
Internet addresses 31
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 4
Chapter 1: Introduction
Chapter 1: IntroductionMicrosoft Active Directory Certificate Services (AD CS) provides the functionality for creating andinstalling a Certificate Authority (CA). The CA acts as a trusted third-party that certifies the identity ofclients to anyone who receives a digitally signed message. The CA may issue, revoke, and managedigital certificates.
The Online Responder is a Microsoft Windows Service that implements the Online Certificate StatusProtocol (OCSP) by decoding revocation status requests for specific certificates. The service providesup-to-date validation of certificates, and sends back a signed response containing the requestedcertificate status information. OCSP is used to provide real-time information about a certificate'sstatus.
The CA and OCSP use the Thales nShield Hardware Security Module (HSM) to protect their privatekeys.
Note: Throughout this guide, the term HSM refers to nShield® Solo™ modules (formerly known asnShield PCI and PCIe), nShield Connect™, and nShield Edge™ products.
They also use the HSM for important operations such as key generation, certificate signing, and CRLsigning. The Thales HSM can can be configured to protect the private keys and meet FederalInformation Processing Standards (FIPS) 140-2 level 2 or level 3.
Product configurationsWe have successfully tested Thales HSM integration with AD CS in the following configurations:
Operatingsystem
AD CSversion
OCSPversion
ThalesSecurityWorldSoftwareversion
nShieldSolosupport
nShieldConnectsupport
nShieldEdgesupport
MicrosoftWindowsServer 2012R2 (Standard,Datacenterand ServerCoreeditions)
6.2 1.0 12.00 Yes Yes Yes
MicrosoftWindowsServer 2012(Standard,Datacenterand ServerCoreeditions)
6.2 1.0 11.61 Yes Yes Yes
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 5
Supported Thales nShield functionality
Supported Thales nShield functionalitySoft cards — Key management Yes FIPS 140-2 level 3 YesKey recovery Yes Module-only key Yes K-of-N card set YesLoad balancing Yes Key import Yes Fail over Yes
Note: CA failover clustering is only supported with network attached HSMs (nShield Connect).
RequirementsBefore installing the software, we recommend that you familiarize yourself with the Microsoft AD CSand OCSP documentation and setup processes, and that you have the Thales nShield documentationavailable. We also recommend that you have an agreed organizational Certificate PracticesStatement and a Security Policy/Procedure in place covering administration of the PKI and HSM.
In particular, these documents should specify the following aspects of HSM administration:
l The number and quorum of Administrator Cards in the Administrator Card Set (ACS), and thepolicy for managing these cards
l Whether the application keys are protected by the module or an OCSl The number and quorum of Operator Cards in the OCS, and the policy for managing these cardsl Whether the security world should be compliant with FIPS 140-2 level 3l Key attributes such as the key size and time-outl Whether there is any need for auditing key usagel Whether to use the Thales Cryptographic Service Providers for Microsoft Cryptographic API: NextGeneration (CNG) or CryptoAPI (CAPI)
l Whether to initialize the nShield Security World as Recoverable; this is highly recommended.
Note: We recommend that you use CNG for full access to available features and better integrationwith Windows Server 2012 andWindows Server 2012 R2.
This guideThis guide describes how to configure AD CS and OCSP with the Thales nShield Hardware SecurityModule (HSM), and set up a root CA. We have tested the instructions, which provide astraightforward integration process. There may be other untested ways to achieve interoperability.This guide might not cover every step of the hardware and software setup process.
This guide assumes that you are familiar with the Thales HSM documentation and the setup process forAD CS and OCSP. For more information about installing the AD CS and OCSP, refer to the Microsoftdocumentation.
More informationl For more information about OS support, contact your Microsoft sales representative or ThalesSupport.
l For more information about contacting Thales, see Addresses at the end of this guide.l Additional documentation produced to support your Thales product is in the document directory ofthe CD-ROM or DVD-ROM for that product.
l For more information about HSM administration, refer to the User Guide for the HSM.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 6
Chapter 2: Procedures
Chapter 2: ProceduresInstalling the HSMInstall the HSM using the instructions in the Hardware Installation Guide for the HSM. We recommendthat you install the HSM before configuring the Security World Software, and before installing andconfiguring AD CS and OCSP.
If you already have an HSM installed and a security world configured, proceed to Installing andconfiguring AD CS on page 7.
Installing the software and creating or sharing the security worldTo install the Security World Software and create the security world:
1. Install the latest version of the Security World Software as described in the User Guide for theHSM.Note: We recommend that you always uninstall any existing Security World Software before
installing the new Security World Software.2. Initialize a security world as described in the User Guide for the HSM.
Note: You can also use the CSP Install Wizard or the CNG Configuration Wizard to create aSecurity World for nShield Solo and nShield Edge HSMs. For nShield Connect, werecommend that you use the front panel user interface to create the Security World.
3. Register the Cryptographic Service Providers that you intend to use.Note: For CAPI on 64-bit Windows, both 32-bit and 64-bit CSP Install Wizards are available. If
you intend to use the CAPI CSPs from both 32-bit and 64-bit applications, or if you areunsure, run both wizards. The CNG Configuration Wizard registers the CNG Providersfor use by both 32-bit and 64-bit applications where relevant. For detailed information onregistering the CAPI CSPs or CNG Providers, refer to the User Guide for the HSM.
4. If you are installing OCSP on a different server to the CA, install the Security World Software onboth servers (as described in the User Guide for the HSMs) and share the Security World bycopying the %NFAST_KMDATA%\local directory from the CA server to the OCSP server. See theUser Guide for more information.Note: You can also have the security world files in a shared network location which can be
accessed by both the CA and OCSP server.
Installing and configuring AD CSTo install and configure Microsoft AD CS:
1. Click Start > Server Manager to open Server Manager.2. Click Manage, then click Add Roles & Features. The Before you begin window opens. Click
Next.3. On the Select installation type window, ensure the default selection of Role or Feature Based
Installation is selected and click Next.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 7
Installing and configuring AD CS
4. On Server selection, select a server from the server pool and click Next.5. On the Select server roles window, select the Active Directory Certificate Services role.6. When prompted to install Remote Server Administration Tools click Add Features, then click
Next.7. On the Select features window, click Next.8. On the Active Directory Certificate Services window, click Next.9. On the Select role services window, the Certification Authority role is selected by default. Click
Next.10. On the Confirm installation selections window, verify the information and click Install.11. When the installation is complete, click Configure Active Directory Certificate Services on the
destination server link.12. On the Credentials window, ensure that Administrator's credentials is displayed in the
Credentials box. If not, click Change and specify the appropriate credentials. Click Next.13. On the Role Services window, select Certification Authority. This is the only available selection
when the certification authority role is installed on the server. Click Next.14. On the Setup Type window, select the appropriate CA setup type for your requirements. Click
Next.15. On the CA Type window, Root CA is selected by default. Click Next.16. On the Private Key window, leave the default selection to Create a new private key selected.
Click Next.17. On the Cryptography for CA window, select the appropriate Thales cryptographic provider
along with the key type, key length and suitable hash algorithm:l RSA # nCipher Security World Key Storage Providerl ECDSA_P256 # Security World Key Storage Providerl ECDSA_P384 # Security World Key Storage Providerl ECDSA_P521 # Security World Key Storage ProviderClick Next.
18. On the CA Name window, give the appropriate CA name and click Next.19. On the Validity Period window, enter the number of years for the certificate to be valid and click
Next20. On the CA Database window, leave the default locations for the database and database log
files. Click Next.21. On the Confirmation window, click Configure.22. If you select nCipher cryptographic service provider on the Cryptography for CA window, the
nCipher key storage provider-create a key wizard prompts you to create a new key. Click Nextand On. Select a way to protect the new key. Click Next. Follow the subsequent instructions andclose the wizard.The Progress window opens during the configuration processing, then the Results windowopens. Click Close. If the Installation progress window is still open, click Close on that windowalso.
23. Verify that the CA service has started successfully by running the following command on thecommand line. Use Windows key + R to open the Run dialog, and type cmd to open the commandprompt. Run the command:
>sc query certsvc
If CA is not started automatically then you need to enable Interactive Services Detection services.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 8
Chapter 2: Procedures
To improve security, Windows Server 2012 andWindows Server 2012 R2 do not allow InteractiveServices Detection services to display a window on your desktop. If your CA private key is protectedby an OCS, Certificate Services may need to display dialogs prompting you to insert Operator Cardsor enter pass phrases. In this case, the Interactive services dialog detection window opens and youmust select View the message.
To enable Interactive Services Detection services using the Windows registry:
1. Go to Run and type regedit.2. Go to HKEY_LOCAL_MACHINE > System > CurrentControlSet > Control > Windows3. Change the NoInteractiveService value from 1 to 0 and click OK.4. Go to Services and verify that Interactive Services Detection service is started manually.5. Restart the machine and start the CA.6. After installing AD CS, you must register nFast Server as a dependency of the CA service. This
ensures that the CNG or CAPI CSPs are available for use before the CA starts up. Register nFastServer by running the command:
>ncsvcdep.exe -a certsvc
By default, the ncsvcdep.exe utility is installed in the %NFAST_HOME%\bin directory.
Verifying that the CA service has started successfullyTo verify that the CA service has started, open a command prompt and run the command:
>sc query certsvc
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 9
Installing and configuring AD CS on Windows Server Core
Installing and configuring AD CS on Windows Server CoreTo install the Certificate Server on Windows Server Core:
1. Join domain by running the command:
netdom join %computername% /domain:<full DNS domain name> /userd:<domain user>
/password:*
2. Restart the machine after joining the domain by running the command:
>shutdown /r /t 0
3. Enable WOW64 if you are working with 32-bit applications:
Start /w ocsetup ServerCore-WOW64
shutdown /r /t 0
4. Run PowerShell as admin user.5. Install CA binaries via PowerShell, by running the command:
Add-windowsfeature ADCS-Cert-Authority
6. Configure CA via Powershell, by running the command:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –
caTypeEnterpriseRootCA
–CryptoProviderName ECDSA_P256#HSM_KSP_NAME –KeyLength 256 –HashAlgorithm SHA256
Example:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caCommonName "Fips-
128-Module-CA-1"
–caTypeEnterpriseRootCA –CryptoProviderName "RSA#nCipher Security World Key Storage
Provider"
–KeyLength 2048 –HashAlgorithm SHA256
7. When the confirmation message appears, type A and press Enter.
Note: Use Module Only Protection or 1/N OCS without passphrase as a key protection method forWindows Server Core.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 10
Chapter 2: Procedures
Verifying that the CA service has started successfullyTo verify that the CA service has started, open a command prompt and run the command:
>sc query certsvc
Installing and configuring AD CS via PowerShellThis procedure installs the Certificate Server binaries via the Server Manager Powershell (PS) cmdlets,and then configures the Certificate Server via the new PS deployment cmdlets.
To install and configure Microsoft Active Directory Certificate Services using PowerShell:
1. Run PowerShell as admin user.2. Run the command:
Add-windowsfeature ADCS-Cert-Authority
Note: This command only installs CA binaries.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 11
Installing and configuring AD CS via PowerShell
3. Configure CA. There are three parameter sets for the CA PowerShell deployment cmdlet:a. Using new certificate and private key :
1. Run the following command in PowerShell:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caCommonName
"<CA-Name>" –caType
EnterpriseRootCA –CryptoProviderName "<Key Storage Provider Name>" –KeyLength
<2048> –HashAlgorithm <SHA256>
Example:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caCommonName
"Fips-128-Module-CA-1"
–caType EnterpriseRootCA –CryptoProviderName "RSA#nCipher Security World Key
Storage Provider"
–KeyLength 2048 –HashAlgorithm SHA256
2. When the confirmation message appears, type A and press Enter.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 12
Chapter 2: Procedures
b. Using existing private key:1. Run the following command in PowerShell:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caType
EnterpriseRootCA –CryptoProviderName
ECDSA_P256#HSM_KSP_NAME –KeyContainerName NAME_OF_KEY –hashAlgorithm SHA256
Example:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –catype
EnterpriseRootCA –CryptoProviderName
"RSA#nCipher Security World Key Storage Provider" –KeyContainerName "Fips-128-
Module-CA-1" –hashAlgorithm SHA256
2. When the confirmation message appears, type A and press Enter.c. Using existing certificate and private key:
1. Using a certificate already present on local machine in MY store, run the command:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caType
EnterpriseRootCA –certificateID
[cert hash | cert serial number]
Example:
Install-AdcsCertificationAuthority –AllowAdministratorInteraction –caType
EnterpriseRootCA –certificateID
"49177ae638cc948241947879ae66d315"
2. When the confirmation message appears, type A and pressEnter.
Configuring auto-enrollment group policy for a domainTo complete the integration procedures, you must configure auto-enrollment as a group policy:
1. On the domain controller, click Start > Administrative Tools > Group Policy Management.2. Go to Forest, select your Domain and expand it.3. Double-click Group Policy Objects in the forest and domain containing the Default Domain Policy
Group Policy object (GPO) that you want to edit.4. Right-click the Default Domain Policy GPO, and then click Edit.5. In the Group Policy Management Editor, click Computer Configuration > Policies > Windows
Settings > Security Settings > Public Key Policies.6. Double-click Certificate Services Client - Auto-Enrollment.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 13
Configuring the Thales nShield HSM with Certificate Services
7. In Configuration Model, click Enabled to enable auto-enrollment. Select the following checkboxes:n Renew expired certificates, update pending certificates, remove and revoke certificates.n Update certificates that use certificate template.
8. Click Apply and OK to accept your changes and close the Editor.
Configuring the Thales nShield HSM with Certificate Services
Configuring Certificate Services with a new keyTo install the Certificate Server using the Thales HSM Key Storage Provider (KSP):
1. Install and configure the Thales HSM hardware and software as described in the section Installingthe software and creating or sharing the security world on page 7.
2. Install Microsoft Active Directory Certificate Services as described in the section Installing andconfiguring AD CS on page 7, with the following settings:n In the Private Key window, click Create a new private key and click Next.n Continue the CA setup as described in the section Installing and configuring AD CS on page7.
Configuring Certificate Services using an existing private keyTo install the Certificate Server using the Thales HSM KSP with an existing HSM private key:
1. Install and configure the Thales HSM hardware and software as described in the section Installingthe software and creating or sharing the security world on page 7.
2. Install Microsoft Active Directory Certificate Services as described in the section Installing andconfiguring AD CS on page 7.
3. In the Private Key window, select Use existing private key and then Select an existing privatekey on this computer. Click Next.
4. In the Select Existing Key window, click Change.5. In the Change Cryptographic Provider window, select the CSP that contains the created key.
Delete the contents of the field CA common name, and click Search. The search finds theexisting private key. Select the key, then select Allow administrator interaction when theprivate key is accessed by the CA. Click Next.
6. In the Cryptography for CA window, select the appropriate hash algorithm and click Next.7. In the CA Name window, click Next.8. In the Validity Period window, specify the validity period and click Next.9. In the CA Database window, specify the certificate database locations and certificate database
log locations and click Next.10. In the Confirmation window, click Configure.11. Wait for the configuration to complete. After successful completion, close the AD CS
configuration window.12. Verify that the CA service has successfully started by running the command:
>sc query certsvc
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 14
Chapter 2: Procedures
13. Verify the CA key by running the command:
>certutil -verifykeys
Configuring Certificate Enrollment to use CA templatesTo integrate the CA certificate enrollment functionality with a Thales HSM generated CA private key:
1. Create a CA template that uses the Thales HSM KSP:a. Run certtmpl.msc.b. Right-click the Administrator template, and select Duplicate Template. The Properties
window opens, showing Compatability tab.c. Select Windows Server 2012 Under Certificate Authority and Certificate Recipient drop-
down box.The Resulting changes window opens. Click OK.
d. Click the General tab. In Template display name, type a name for the template.e. Click the Request Handling tab, and in Purpose select Signature and click Yes to confirm
changes to the certificate purpose.f. Deselect Allow private key to be exported.g. Click the Cryptography tab and in the Provider category select Key storage provider.h. In Algorithm Name, select an ECC or RSA algorithm.i. Click Requests must use one of the following providers and in Providers, select nCipher
Security World Key Storage Provider only;j. In Request Hash, select a hash type.k. Click Subject Name tab and deselect Include e-mail name in subject name and deselect
E-mail name.l. Click Apply and OK to save the template settings and close the Certificate Templateconsole.
2. Run certsrv.msc.3. In the left-hand pane, double-click the CA name.4. Right-click the Certificate Template node and select New > Certificate Template to Issue.5. Select the template you just created, and click OK.6. Request a certificate based on the template:
a. Run certmgr.msc.b. In the left-hand pane, right-click the Personal node, and select All Tasks > Request New
Certificate.c. Click Next and Next to pass through the first two windows.d. Select the template that you created, and click Enroll.e. The Key Storage Provider window appears. Click Next.f. Select the type of protection you want to use, and click Next.g. If OCS is selected, select the OCS from the Card sets pane, and click Finish.Note: If passphrase authentication is enabled, a prompt for passphrase appears.
7. Verify that the certificate is enrolled successfully.
The enrollment wizard shows if the certificate enrollment was successful or failed. Use the Detailsbutton to check the main information.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 15
Setting up key use counting
Setting up key use counting
Key use counter overviewSetting up key use counting is optional. If you require key use counting, follow the proceduresdescribed in this section. The procedures described in this section do not apply to most setups.
Note: If you do not follow the procedures described in this section, key use counting is not installed.You cannot add key use counting to a key retrospectively.
The key use counter audits usage of the CA signing key. It maintains a count of how many times thekey has been used. The key use counter should only be used with a root CA that has a low volume ofsignings where the count can be logged immediately before servicing a signature request and afterthe signature request has been serviced. This ensures that any illicit use of the CA is revealed throughdiscrepancies in the counter log.
Note: Note the following information about the key use counter:
l The counter is in the NVRAM of the HSM. To access the key count value in NVRAM, users mustpresent the ACS to the HSM.
l The counter is a 64-bit integer counter associated with a single private key.l The counter is started at zero.l If the maximum count is reached, the counter restarts at zero.l The counter can exist only on one HSM. If more than one HSM is attached to the server, you mustchoose which HSM stores the counter.
l If the module firmware is upgraded, the counter value is lost.
l The key counter can only be set at HSM initialization, it cannot be activated after deployment.
Installing Certificate Services with key use countingTo install Certificate Services with key use counting:
1. If it is not already on your system installation, create the file %SystemRoot%\capolicy.inf (where%SystemRoot% is the system environment variable for the Windows installation folder, by defaultC:\WINDOWS\capolicy.inf) with the following content:
[Version]
Signature="$Windows NT$"
[certsrv_server]
EnableKeyCounting=True
Note: You must create the capolicy.inf file before Certificate Services is installed.2. Install the CA using the HSM KSP.3. Enable auditing for the CA service by running the command:
>certutil -setreg ca\auditfilter 1
4. Right-click the CA and click Properties.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 16
Chapter 2: Procedures
5. Click the Auditing tab and check the box for Start and Stop Active Directory CertificateServices.
6. Select Start > Administrative Tools > Local Security Policy.7. Go to Local Policy, expand it and select Audit Policy.8. In the right pane, double-click Audit Object Access and select Success and Failure.9. Click Apply and then OK, then close the window.10. Update the local security policies by opening a command prompt and running the command:
>gpupdate.exe /force
11. Restart the CA service to pick up the changes, by running the commands:
>net stop certsvc
>net start certsvc
12. Run Eventvwr.exe.13. Select Windows Logs > Security.14. Filter for event ID 4881 (CA startup event) or event ID 4880.15. Verify the CA startup event shows the PrivateKeyUsageCount property with a corresponding
value. Make a note of this value.16. Restart the Certificate Server, by running the commands:
>net stop certsvc
>net start certsvc
17. Verify that the event viewer contains a new CA startup event (event ID 4881).18. Make a note of the PrivateKeyUsageCount property value.
CA Backup, migrate and restoreThe most common procedure related to backup, migrate and restore for the CA and HSM is to use theoptions:
l Select a certificate and use its associated private key.l Select an existing private key.
This procedure describes backing up the CA / HSM data on an existing server and then restoring theCA / HSM data onto a new server. Thales have successfully tested this procedure in the followingconfigurations:
l Windows Server 2008 SP2 Enterprise 64-bit (CNG) to Windows Server 2012 (CNG)l Windows Server 2008 R2 SP1 Enterprise 64-bit (CNG) to Windows Server 2012 (CNG)l Windows Server 2008 R2 SP1 Enterprise 64-bit (CNG) to Windows Server 2012 R2 (CNG)l Windows Server 2012 (CNG) to Windows Server 2012 R2 (CNG)
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 17
Backing up, migrating and restoring CA using an existing certificate and its associated private key
Note: If your existing CA is using a custom CAPolicy.inf file, you should copy the file to the newplanned CA server. The CAPolicy.inf file is located in the %SystemRoot% directory, which isusually C:\Windows.
Backing up, migrating and restoring CA using an existing certificate and itsassociated private keyNote: For this procedure your CA must be protected with module-only protection or 1/N OCS
without passphrase as key protection method.
To back up the CA and HSM data on the existing server (machine #1), and then migrate the CA andHSM onto a new server (machine #2):
On machine #1:
1. Back up the CA database by running the command:
>certutil -config <CA_config_string> -backupdb <BackupDirectory>
2. Export the certificate on machine #1:a. Run mmc.b. In the console, go to File > Add/Remove Snap-in.c. Select the Certificates tab and click Add.d. The certificate snap-in window opens. Select Computer Account and click Next.e. Keep the default selection and click Finish, then click OK.f. Go to the directory Trusted Root Certificates > Certificates.g. Right-click the CA certificate, and click All Tasks > Export, then click Next.h. Select Base-64 encoded X.509 (.CER), and click Next.i. Specify the path and file name to save the certificate, and click Next.j. Click Finish.k. Click OK to close the export success message.
3. Back up the contents of the security world data from the following location:C:\ProgramData\nCipher\KeyManagement Data\local.
4. Uninstall the CA from machine #1.
On machine #2:
1. Copy the backed-up security world data on the following path on machine #2:C:\ProgramData\nCipher\KeyManagement Data\local.
2. Load the security world onto the HSM on machine #2, by running the command:
>new-world -l
For more information about loading a security world, refer to the User Guide for the HSM.3. Run the CNG Configuration Wizard.
Note: If selecting operator card set protection, do not check Always use the wizard whencreating or importing keys.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 18
Chapter 2: Procedures
4. Copy and install the X.509 certificate into the local user Trusted Root CA Store on machine #2:a. Right-click the certificate, and click Install.b. Click Next.c. Select Place all certificates in the following store, and click Browse.d. Select Trusted Root Certification Authorities, and click OK.e. Click Next.f. Click Finish.g. Click OK to close the import success message.
5. Install the certificate into my store, by running the following command from the console:
>certutil -addstore my <certificate name>
A success message appears.6. Repair the certificate store by running the following command from the console:
>certutil -f -repairstore -csp "nCipher Security World Key Storage Provider" my "<cert
serial number>"
7. Click Start > Server Manager to open Server Manager.8. Install and configure the CA as described in the section Installing and configuring AD CS on
page 7.9. Install and configure AD CS with the following settings:
a. In the Set Up Private Key window, select Use existing private key and then Select acertificate and use its associated private key .
b. In the existing Certificate window, the imported certificate is shown. Select the certificateand select Allow administrator interaction when the private key is accessed by the CA.Click Next.
c. If your CA is protected with OCS protection with passphrase, then the certificate is notdisplayed in the certificate section. You must remove the passphrase of the operator cardsetin order to view the CA certificate in the certificate section.
d. In the Certificate Database window click Next.e. In the Confirmation window click Configure.
10. When the CA installation is complete, click Close in the installation results window.11. Copy the backed-up CA database data onto machine #2.12. Run the command:
>certutil -shutdown
13. On machine #2, restore the CA database by running the command:
>certutil.exe -f -restoredb <BackupDirectory>
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 19
Backing up, migrating and restoring the CA using an existing private key
14. Restart the CA by running the command:
>net start certsvc
15. Verify that the CA service has started successfully by running the command:
>sc query certsvc
Backing up, migrating and restoring the CA using an existing private keyTo back up the CA and HSM data on the original server (machine #1), and then migrate the CA/HSMon a new server (machine #2):
On machine #1:
1. Back up the CA database by running the command:
>certutil -config <CA_config_string> -backupdb <BackupDirectory>
2. Back up the security world data and the private key, which are found inC:\ProgramData\nCipher\Key Management Data\local. For more information about backing up asecurity world, refer to the User Guide for the HSM.
3. Uninstall the CA from machine #1.
On machine #2:
1. Copy the backed-up security world data and the private key to C:\ProgramData\nCipher\Key
Management Data\local on machine #2.2. Load the security world onto the HSM on machine #2, by running the command:
>new-world -l
For more information about loading a security world, refer to the User Guide for the HSM.3. Run the CNG Configuration Wizard and select Use existing security world.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 20
Chapter 2: Procedures
4. Install Microsoft Active Directory Certificate Services with the following settings:a. In the Private Key window, select Use existing private key and use existing private key
on this computer. Click Next.b. In the Select Existing Key window, click Change. The Change Cryptographic Provider
window opens.c. Select the CSP that contains the created key. Delete the contents of the field CA common
name, and click Search. The search results should find the existing private keyd. Select the key that you generated on machine #1, click Allow administrator interaction
when the private key is accessed by the CA, and click Next.e. On the Cryptography for CA window, click Next.f. In the CA name window, click Next.g. In the Validity Period window, specify the validity period and click Next.h. In the Certificate Database window, specify the certificate database location and click
Next.i. On the Confirmation window, click Configure.j. In the Installation Results window, click Close.
5. Copy the backed-up CA database data onto machine #2.6. Run the command:
>certutil -shutdown
7. On machine #2, restore the CA database by running the command:
>certutil.exe —f —restoredb <BackupDirectory>
8. Restart the CA by running the command:
>net start certsvc
9. Verify that the CA service has started successfully by running the command:
>sc query certsvc
Installing the OCSPNote: If you are installing OCSP on a different server from the CA, see Installing the software and
creating or sharing the security world on page 7 for instructions on sharing the SecurityWorld.
To install Online Responder Services:
1. Open Server Manager. Select Start > Server Manager.2. Click Manage and then click Add Roles & Features.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 21
Installing the OCSP
3. Before you begin window appears. Click Next.4. On the Select installation type window, ensure the default selection of Role or Feature Based
Installation is selected. Click Next.5. On Server selection, select a server from the server pool and click Next.6. On the Select server roles window, select the Active Directory Certificate Services role.7. Expand the Roles section (in the left-hand section) and click Online Responder.8. Click Add Feature, then click Next.9. On Select Feature window click Next.10. OnWeb Server Role Screen click Next.11. On Role Service Screen keep the default selection and click Next, then click Install.12. When the installation completes, click the Configure Online Responder link. Click Next.
The Progress window is displayed during the configuration processing.The Results window appears.
13. Click Close. If the Installation progress window is still open, click Close on that window also.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 22
Chapter 2: Procedures
Configuring the CA to issue an OCSP Response Signing CertificateThis section describes how to update the OCSP certificate template for use with the key storageprovider CNG. This procedure assumes you have an Enterprise CA installed.
Configuring certificate templates for your environment1. Go to Start > Run.2. In the run dialog type mmc and click OK.3. In the mmc console that appears go to File > Add/Remove Snap-in4. In the Add or Remove Snap-Ins dialog box that appears find and click the Certificate Templates
snap-in.5. Click Add and then click OK.6. Under Console Root expand Certificate Templates snap-in. All the available certificate templates
that you can issue with your CA are listed in the middle section.7. Scroll down the list until you locate the OCSP Response Signing template. Right-click the OCSP
Response Signing template and click Properties.8. In the popup dialog that appears click the Security tab and click Add.9. In the Select User, Computers, or Groups dialog that appears type the name of the machine that
is hosting the Online Responder service. Click OK.The machine is not immediately located. Another dialog appears.
10. In this dialog click Object Types and make sure the check box next to Computers is checked.Click OK.
11. Re-enter machine name in the Select User, Computers, or Groups dialog if it is not alreadythere. Click OK.The machine hosting the Online Responder is added to the Group and user names area underthe Security tab.
12. Click the machine name in the Group and user names area and under the Permissions areagive all permissions to machine and click Apply and then OK.
13. Click Request Handling tab and make sure that both Authorize additional service accounts toaccess the private key and Allow private key to be exported are disabled.
14. Click the Cryptography tab. Select the algorithm, hash and key size you want to use from theAlgorithm Name drop-down combo box. We recommend that you choose the same algorithm asyour CA is using, although you can use any.
15. Below the combo box are two radio buttons: select Requests must use one of the followingproviders.
16. Check the box that opens next to the nCipher Security World Key Storage Provider entry. ClickApply, then OK.
17. Select the Subject Name tab.The radio button Build this from Active Directory Information is selected. The following optionsare displayed:l E-maill DNS namel User principal name (UPN)l Service principal name (SPN)Make sure that only Service Principal Name (SPN) is checked.
18. Uncheck any other checked boxes. Click Apply and then OK.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 23
Configuring the CA to support the Online Responder service
Note: To use CAPI CSP, make a copy of an OCSP response signing template. From theCryptographic tab, under the provider category, select Legacy Cryptographic ServiceProvider. Then, select Request must use one of the following providers and checknCipher Enhanced Cryptographic Provider.
Configuring the CA to support the Online Responder service1. Run certsrv.msc.2. Navigate to the Action menu and click Properties.3. Select Extensions tab. In the Select extension list, click Authority Information Access (AIA).4. Click Add and in the Add Location dialog box type under Location http://machinename/ocsp.
Click OK.5. On the Extensions tab make sure that the URL that was just added to the locations area is
highlighted. Then make sure the check boxes next to Include in the AIA extension of issuedcertificates and Include in the online certificate status protocol (OCSP) extension are ticked.
6. Click Apply, let the service restart, then click OK.7. In Certification Authority, right-click Certificate Templates, and then click New Certificate
Templates to Issue.8. In Enable Certificates Templates, select the OCSP Response Signing template and any other
certificate templates that you configured previously, and then click OK.9. Open Certificate Templates in the Certification Authority and verify that the modified certificate
templates appear in the list.
Requesting a certificate from OCSP Response Signing template1. Go to Run, and type cmd to open the command prompt. Run the command:
> certutil -pulse
2. Go to Run, type mmc and click OK.3. In the mmc console that appears, select File > Add/Remove Snap-in.4. In the Add or Remove Snap-Ins pop-up dialog that appears, find the Certificates snap-in (under
the Available snap-ins section).5. Click the snap-in and click Add.6. In the dialog that appears, check the Computer Account radio button, and then click Next.7. In the Select Computer dialog, ensure that Local Computer is selected and click Finish. Then
click OK.8. Under the Console Root, expand the Certificates heading.9. Select the Personal folder and expand it.10. Right-click Certificates and select All Tasks > Request New Certificate.11. On the Before You Begin page click Next.12. On the Select Certificate Enrollment Policy page click Next.13. On the Request Certificates page select OCSP Response Signing template and click Enroll.14. On the Certificate Installation Results page select Finish.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 24
Chapter 2: Procedures
Verifying that the signing certificate is properly configured1. Select the Personal folder and expand it.2. Select the Certificates folder. In the right-hand pane, an OCSP certificate appears.3. Right-click the certificate and click Properties.4. A dialog box appears. On the General tab under Certificate Purposes select Enable Only for
the following purposes. Click Apply and then OK.
Modifying the Online Responder service to use an Thales HSM1. Run Services.msc.2. Locate the Online Responder Service in the list of services.3. Right-click the Online Responder Service and select Properties.4. In the dialog box that appears select the Log on tab.5. Under the Log on as heading, click the radio button next to Local System account. The heading
Allow service to interact with desktop becomes active with a check box next to it.6. Select the check box. Click Apply, then OK.7. From the Services window, right-click Online Responder Service and restart the service.
Setting up a revocation configurationA revocation configuration is needed to respond to status requests about certificates that have beenissued by a specific CA. Revocation configuration settings include:
l The CA certificatel The signing certificate for the online responderl The locations that clients can send their requests to
To set up a revocation configuration:
1. Click Start and click Online Responder Management.2. In the left-hand pane click Revocation Configuration.3. In the right-hand pane under Actions click Add Revocation Configuration.4. Click Next on the Getting started with adding a revocation configuration section.5. In the Name the Revocation Configuration section, type a name for the configuration in the text
box. (For this example we use Test). Then click Next.6. In the Select CA Certificate Location section ensure that the Select a certificate for an Existing
enterprise CA radio button is checked and click Next.7. In the Choose CA Certificate section ensure that the Browse CA certificates published in Active
Directory radio button is selected and then click Browse.8. In the Select Certification Authority dialog box select the CA and click OK then Next.9. In the Select Signing Certificate section ignore the default settings and make sure the Manually
select a signing certificate radio button is selected. Click Next.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 25
Verifying that OCSP works correctly
10. If you are installing OCSP on a different server to the CA:a. On the Revocation Provider section click on Provider tab. The Revocation Provider
Properties dialog is displayed.b. Under Base CRLs, click Add.c. Enter http://<OCSP hostname>/ocsp/<CA-name>.crl in the Open URL dialog box and click
OK.d. Under Base CRLs, select the above URL, click Move Up and then click OK.e. Copy the CRL files from the c:\Windows\System32\certsrv\CertEnroll folder of the CA
server to the C:\Windows\SystemData\ocsp folder of the OCSP server.11. In the next window click Finish. A dialog box opens stating Executing the specified action.... Let
this finish.12. When the wizard completes, the status of the Online Responder is shown in the Revocation
Configuration Status box as Bad Signing Certificate on Array Controller.13. To fix this, click Array Configuration in the left-hand pane and expand it.14. In the directory tree, click the machine name that you are using.15. The revocation configuration that you just created is listed in the middle section, in this case Test.16. In the right-hand pane, click Assign a signing certificate.17. Check the certificate that you set up earlier is listed in the dialog box that opens. Click OK.18. Go back to the Revocation Configuration pane and right-click the revocation configuration you
created (in this case Test) and then click Edit Properties.19. A Properties for Revocation Configuration: Test pane opens. Three tabs are available. Click the
Signing tab.20. Uncheck the Do not prompt for credentials for cryptographic operations check box and click
OK.21. Go back to Online Responder Management, go to Actions and click Refresh .22. In the left-hand pane click Online Responder: Computer Name and check that the Revocation
Configuration Status shows asWorking.
Verifying that OCSP works correctly
Generating a certificate request1. Open Notepad and create a file called rsa.inf with contents similar to the following on your
local C drive:
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 26
Chapter 2: Procedures
[Version]
Signature = "$Windows NT$"
[NewRequest]
Suject = "CN=TEST-CA"
HashAlgorithm = SHA512
KeyAlgorithm = RSA
KeyLength = 2048
ProviderName = "nCipher Security World Key Storage Provider"
KeyUsage = 0xf0
MachineKeySet = True
RequestType = PKCS10
[EnhancedKeyUsageExtension]
OID = 1.3.6.1.5.5.7.3.1
[Extensions]
1.3.6.1.5.5.7.48.1.5 = Empty
In the rsa.inf file replace the subject with your CA common name.2. Go to your local directory and find the file rsa.inf.3. Check that rsa.inf contains the following messages:
Leaf certificate revocation check passed
CertUtil: -verify command completed successfully.
4. From the command prompt navigate to your local C drive and add:
>certreq —new rsa.inf rsa.req
5. Check that rsa.req is listed in the directory.6. In the command line run the command:
>certreq —submit —attrib —CertificateTemplate:WebServer rsa.req
7. Click OK to select the CA certificate and save it as rsa.cer in your local directory.8. Navigate to the directory where you saved the certificate and look for rsa.cer.
Removing information about the certificate's CRL1. Select Start > Run, and enter certsrv.msc. Click OK.2. Click Certificate Authority. A list of folders below the CA appears.3. Right-click the Revoked Certificates folder and click All Tasks, Publish. A Publish CRL dialog
appears.4. Click OK to select a New CRL.5. Right-click the CA and select Properties.6. Click the Extensions tab.7. Check that the Select extension drop-down list box shows CRL Distribution Point (CDP).
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 27
Retrieving information about the certificate's AIA, CRLs, and OCSP
8. Click any of the listed CRL distribution points, and click Remove, then Yes.9. Click Apply. A pop-up box appears saying you need to restart the service.10. Click Yes to restart the service, and then click OK to close the dialog.
Retrieving information about the certificate's AIA, CRLs, and OCSP1. To check that clients can still obtain revocation data in the command prompt, navigate to the
folder where the certificate is stored, then type:
>certutil —url rsa.cer
2. The URL Retrieval Tool appears.3. Select Certs (from AIA) and click Retrieve.4. The list contains the verified Certificate and its URL. Select CRLs (from CDP) and click Retrieve.5. Compare the results to what you had earlier when you removed a CRL distributed point. CRLs
show they have been verified.6. Select OCSP (from AIA) and click Retrieve.7. The list contains the Verified OCSP URL. Click Exit.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 28
Chapter 2: Procedures
Verifying the OCSP Server is Active1. To check details about the certificate and its CA configuration in the command prompt, navigate
to the folder wher the certificate is stored, then type:
>certutil -verify rsa.cer > rsa.txt
2. Open the text file rsa.txt. The last few lines should be as follows:
Verified Issuance Policies: None
Verified Application Policies:
1.3.6.1.5.5.7.3.1 Server Authentication
Leaf certificate revocation check passed
CertUtil: -verify command completed successfully
3. This shows that the OCSP Server is working correctly and there were no errors.
Uninstalling AD CS and OCSPTo uninstall AD CS and OCSP:
1. Open Server Manager and click Start > Server Manager.2. Click Manage and then click Remove Roles & Features.
The Before you begin window opens. Click Next.3. On server selection, select a server from the server pool, and click Next.4. Deselect Active Directory Certificate Services and Online Responder, and click Next.5. When the Removal process is complete, click Close and restart the machine.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 29
Chapter 3: Troubleshooting
Chapter 3: TroubleshootingThe following table provides troubleshooting guidelines.
Problem Cause Resolution
Online Responder reportsBad Signing Certificateon Array Controller.
This error occurs whenthe CA certificate is staleor cannot be located bythe Online Responderclient.
Ensure that the steps above have been correctlycarried out. Also, ensure that the CA is correctlyconfigured and that a valid CA certificate existsfor OCSP Signing.
Using
certutil —url
<certnamehere.cer>
and selecting Certs (fromAIA) shows an entry inthe list called AIA withFailed next to it.
This error occurs whenCertificate AuthorityWeb Enrolment is notinstalled on the CA.
Install Certificate Authority Web Enrolment onthe CA machine. Go to Server Manager.Expand the Roles section (in the left-handsection) and click Active Directory CertificateServices. In the bottom right-hand section, clickAdd Role Services and select CertificateAuthority Web Enrolment.
Using the certreq —new
<.req file here>
command returns anInvalid Provider Specifiederror.
This error occurs whenthe CSPs are not installedand set up on the clientmachine or not set upcorrectly.
Ensure that the Thales CAPI CSP and ThalesCNG CSP providers are correctly installed andset. (Do this by running the CSP Install Wizardand CNG Configuration Wizard under nCipherin the Start menu).
When using the CAPI orCNG wizard to access aprivate key protected byan OCS with password,you are prompted multipletimes to enter thepassword.
This error is due to aproblem in WindowsServer 2012.
To prevent this from happening, download andinstall the hotfix available at the followinglocation:http://support.microsoft.com/kb/2740017/EN-US
When presenting a Javacard OCS (V12 onwardsonly), the ADCSConfiguration Wizarddoes not detect the OCS.cardpp --examine showsTokenSecureChannelError.
TokenSecureChannelError
can occasionally be seenwhen presenting a Javacard OCS.
Remove and re-insert the OCS until it is pickedup by cardpp and the ADCS ConfigurationWizard.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 30
Internet addressesWeb site: http://www.thales-esecurity.com/Support: http://www.thales-esecurity.com/support-landing-pageOnline documentation: http://www.thales-esecurity.com/knowledge-baseInternational sales offices: http://www.thales-esecurity.com/contact
Addresses and contact information for the main Thales e-Security sales offices are provided at thebottom of the following page.
Microsoft AD CS and OCSP Integration Guide for Microsoft Windows Server 2012 and 2012 R2 31
About Thales e-Security
Thales e-Security is a leading global provider of data encryption and cyber securitysolutions to the financial services, high technology manufacturing, governmentand technology sectors. With a 40-year track record of protecting corporate andgovernment information, Thales solutions are used by four of the five largestenergy and aerospace companies, 22 NATO countries, and they secure more than80 percent of worldwide payment transactions. Thales e-Security has offices inAustralia, France, Hong Kong, Norway, United Kingdom and United States.For more information, visit www.thales-esecurity.com
www. t ha les-esecur it y . com
Follow us on: