- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-05-2023 07:33 AM
Can anyone point me to some coherent instructions for setting up PKI access from scratch? Everything I have found assumes we already have all the required certificates and keys for users and servers. we don't and we don't have the skillset available to get this. The CyberArk PKI instructions show me how to generate a server cert and install it onto the vault, but not how to generate client certs to match with that, or how and where I should install them to assign them to individual users.
I would really appreciate some help here. Thanks
04-13-2023 02:50 AM
Hi Nibs.
You're in luck. I worked in PKI for 5 years!
First of all, I think it is important to separate users and servers. Two different subjects.
On the server side, first of all you need a local certification authority that can issue certificates to your domain-connected servers and your end users. Does your organisation have an in-house CA? If not, then PKI authentication is probably not the way to go.
If so, I have created an inf file (see below) which will allow you to go on a server - say the pvwa - as an local admin user who has the rights to request certificates. You just need to modify a couple of parameters to match your own environment and then run the commands as indicated (they are at the top in the commented section). These commands will:
1. Generate a certificate signing request (CSR);
2. Submit the CSR for signature to the local CA, which sends back the signed cert;
3. Install the certificate in the server's local cert store.
You need to save the file as somthing.inf and then execute the commands from the directory in which the inf is located.
Once you sort out all the tricky stuff (CA, certificate template, access rights, etc.), the process of requesting or updating a certificate takes about a minute.
For users, if user certificates have been configured, they can request their own certificates either through a URL (https://<CA_server_address>/certsrv) or through the Microsoft Management Console > Add remove snap-ins > Certificates > Local user.
Let me know if I can answer any other questions.
======================================================
;----------------- comp01a_request.inf -----------------
; Request file for comp01a certificate.
; Log in to Windows as an admin who is a domain user and a local administrator
; Run an admin command prompt and CD to the directory where this inf file is located.
; The series of commands to create the CSR, submit it for signing, and importing into the local environment are:
; certreq -new comp01a_request.inf comp01a_request.req
; certreq -submit comp01a_request.req
; You will be prompted for the CA, click OK and then save the file as components_request.cer
; certreq -accept comp01a_request.cer
; You will then need to move the new certificate from the personal store of the local machine (whatever that is) and into the Web Hosting store.
; Make sure the new certificate is bound to IIS.
[Version]
Signature="$Windows NT$"
[NewRequest]
Subject = "C=US, ST=MA, L=Newton, OU=CyberArk Training, O=ACME, CN=comp01a.acme.corp"
; Subject = "CN=SERVER.CONTOSO.COM" ; For a wildcard use "CN=*.CONTOSO.COM" for example
; For an empty subject use the following line instead or remove the Subject line entierely
; Subject =
; Friendly name goes on the "front" of the cert. It is for human consumption.
FriendlyName = "comp01a"
Exportable = FALSE ; Private key _is_ exportable
; Key length should match your organisational requirements
KeyLength = 4096 ; Common key sizes: 512, 1024, 2048, 4096, 8192, 16384
HashAlgorithm = SHA256
KeySpec = 1 ; AT_KEYEXCHANGE
KeyUsage = 0xA0 ; Digital Signature, Key Encipherment
MachineKeySet = True ; The key belongs to the local computer account
ProviderName = "Microsoft Enhanced RSA and AES Cryptographic Provider"
ProviderType = 12
SMIME = FALSE
; At least certreq.exe shipping with Windows Vista/Server 2008 is required to interpret the [Strings] and [Extensions] sections below
[Strings]
szOID_SUBJECT_ALT_NAME2 = "2.5.29.17"
szOID_ENHANCED_KEY_USAGE = "2.5.29.37"
szOID_PKIX_KP_SERVER_AUTH = "1.3.6.1.5.5.7.3.1"
szOID_PKIX_KP_CLIENT_AUTH = "1.3.6.1.5.5.7.3.2"
[Extensions]
; The line below should be modified to include all the aliases by which the particular server is known
; Here we have comp01a - its FQDN, hostname, "pvwa" alias, pvwa FQDN, and its ip address
; So you can access this server with "https://pvwa/PasswordVault" and so forth
%szOID_SUBJECT_ALT_NAME2% = "{text}dns=comp01a.acme.corp&dns=comp01a&dns=pvwa&dns=pvwa.acme.corp&ipaddress=10.0.20.1"
%szOID_ENHANCED_KEY_USAGE% = "{text}%szOID_PKIX_KP_SERVER_AUTH%,%szOID_PKIX_KP_CLIENT_AUTH%"
; This line needs to match a certificate template that is available (and to which the user has access)
[RequestAttributes]
CertificateTemplate = WebServer
04-13-2023 02:50 AM
Hi Nibs.
You're in luck. I worked in PKI for 5 years!
First of all, I think it is important to separate users and servers. Two different subjects.
On the server side, first of all you need a local certification authority that can issue certificates to your domain-connected servers and your end users. Does your organisation have an in-house CA? If not, then PKI authentication is probably not the way to go.
If so, I have created an inf file (see below) which will allow you to go on a server - say the pvwa - as an local admin user who has the rights to request certificates. You just need to modify a couple of parameters to match your own environment and then run the commands as indicated (they are at the top in the commented section). These commands will:
1. Generate a certificate signing request (CSR);
2. Submit the CSR for signature to the local CA, which sends back the signed cert;
3. Install the certificate in the server's local cert store.
You need to save the file as somthing.inf and then execute the commands from the directory in which the inf is located.
Once you sort out all the tricky stuff (CA, certificate template, access rights, etc.), the process of requesting or updating a certificate takes about a minute.
For users, if user certificates have been configured, they can request their own certificates either through a URL (https://<CA_server_address>/certsrv) or through the Microsoft Management Console > Add remove snap-ins > Certificates > Local user.
Let me know if I can answer any other questions.
======================================================
;----------------- comp01a_request.inf -----------------
; Request file for comp01a certificate.
; Log in to Windows as an admin who is a domain user and a local administrator
; Run an admin command prompt and CD to the directory where this inf file is located.
; The series of commands to create the CSR, submit it for signing, and importing into the local environment are:
; certreq -new comp01a_request.inf comp01a_request.req
; certreq -submit comp01a_request.req
; You will be prompted for the CA, click OK and then save the file as components_request.cer
; certreq -accept comp01a_request.cer
; You will then need to move the new certificate from the personal store of the local machine (whatever that is) and into the Web Hosting store.
; Make sure the new certificate is bound to IIS.
[Version]
Signature="$Windows NT$"
[NewRequest]
Subject = "C=US, ST=MA, L=Newton, OU=CyberArk Training, O=ACME, CN=comp01a.acme.corp"
; Subject = "CN=SERVER.CONTOSO.COM" ; For a wildcard use "CN=*.CONTOSO.COM" for example
; For an empty subject use the following line instead or remove the Subject line entierely
; Subject =
; Friendly name goes on the "front" of the cert. It is for human consumption.
FriendlyName = "comp01a"
Exportable = FALSE ; Private key _is_ exportable
; Key length should match your organisational requirements
KeyLength = 4096 ; Common key sizes: 512, 1024, 2048, 4096, 8192, 16384
HashAlgorithm = SHA256
KeySpec = 1 ; AT_KEYEXCHANGE
KeyUsage = 0xA0 ; Digital Signature, Key Encipherment
MachineKeySet = True ; The key belongs to the local computer account
ProviderName = "Microsoft Enhanced RSA and AES Cryptographic Provider"
ProviderType = 12
SMIME = FALSE
; At least certreq.exe shipping with Windows Vista/Server 2008 is required to interpret the [Strings] and [Extensions] sections below
[Strings]
szOID_SUBJECT_ALT_NAME2 = "2.5.29.17"
szOID_ENHANCED_KEY_USAGE = "2.5.29.37"
szOID_PKIX_KP_SERVER_AUTH = "1.3.6.1.5.5.7.3.1"
szOID_PKIX_KP_CLIENT_AUTH = "1.3.6.1.5.5.7.3.2"
[Extensions]
; The line below should be modified to include all the aliases by which the particular server is known
; Here we have comp01a - its FQDN, hostname, "pvwa" alias, pvwa FQDN, and its ip address
; So you can access this server with "https://pvwa/PasswordVault" and so forth
%szOID_SUBJECT_ALT_NAME2% = "{text}dns=comp01a.acme.corp&dns=comp01a&dns=pvwa&dns=pvwa.acme.corp&ipaddress=10.0.20.1"
%szOID_ENHANCED_KEY_USAGE% = "{text}%szOID_PKIX_KP_SERVER_AUTH%,%szOID_PKIX_KP_CLIENT_AUTH%"
; This line needs to match a certificate template that is available (and to which the user has access)
[RequestAttributes]
CertificateTemplate = WebServer
04-18-2023 10:08 AM
Thanks JRD! this certainly helps 🙂
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

