Unable to use Client Certificate Authentication with CCP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Unable to use Client Certificate Authentication with CCP

L4 Transporter

Hi,

 

I am trying implement Client Certificate Authentication with CCP but all my efforts are going in vain, hence, expecting some help from the community.

 

Our users are currently using CCP with only "Allowed Machines" method without any issues and now the ask is to add the Certificate Authentication along with allowed machines.

 

I have followed the CyberArk documentation and below are high level steps that I have done as part of the POC:

  1. On the IIS > AIMWebService, I have checked the "Require SSL" box and tested with "Accept" and "Require" Client Certificates. (PVWA certificate is in place and https is working)
  2. Created a self-signed certificate
  3. Imported the certificate on IIS server Trusted Root Certificate authority. (Tried testing with both public cert and Cert with Private Key)
  4. Imported the certificate on the application machine (Windows) in the personal store (with priv key) to be used while doing REST call.
  5. Added the serial number in the Authentication Methods of the Application
  6. Used CyberArk provided Powershell REST API script : https://cyberark-customers.force.com/s/article/CCP-Client-Certificate-Authentication-Example-Script

 

The output is always:

Invoke-RestMethod : 

403 - Forbidden: Access is denied.

Server Error

 

 403 - Forbidden: Access is denied.

 You do not have permission to view this directory or page using the credentials that you supplied

 

Has anyone configured or using Client Certificate Authentication along with "Allowed Machines" or the Client Certificate authentication alone?

 

Are there any steps that I am missing or something needs to be done differently?

 

 

13 REPLIES 13

L6 Presenter

yes I got it working. did you install windows role "IIS Client Certificate Mapping Authentication"

most probably you are not passing certificate incorrectly. use Pspas credential retriever to pass certificate in rest call

https://github.com/pspete/CredentialRetriever/tree/master/CredentialRetriever/Functions

L4 Transporter

yes I got it working. did you install windows role "IIS Client Certificate Mapping Authentication"

most probably you are not passing certificate incorrectly. use Pspas credential retriever to pass certificate in rest call

https://github.com/pspete/CredentialRetriever/tree/master/CredentialRetriever/Functions

Hi @Ankush Agarwal​ , The windows server role "IIS Client Certificate Mapping Authentication" was not installed, which I have installed it now.

 

Also, I have imported the psPAS credential retriever module and tested the certificate authentication with get-ccpcredential, but still getting the same 403 error .

Field_Content_versions_oct20__0682J00000CCQ0yQAH.pngpsPAS have two ways to parameters for passing certificate. One is via CertificateThumbprint and second is via the actual certificate.

Here is how I am passing the actual certificate:

 

Certificate from Current User personal store:

$certThumbprint = "<thumbprint>"

$certPath = "Cert:\CurrentUser\My\" + $certThumbprint

$myCert = Get-ChildItem -Path $certPath

 

OR

 

Certificate from LocalMachine personal store:

$certThumbprint = "<Thumbprint>"

$certPath = "Cert:\LocalMachine\My\" + $certThumbprint

$myCert = Get-ChildItem -Path $certPath

 

$pass = Get-CCPCredential -AppID AppRatulTest -Safe <SafeName> -Object ratul_API_TEST -URL <https://PVWA> -Certificate $myCert

 

FYI : Get-CCPCredential is working without the certificate authentication.

@Pete Maan​  Would you be able to suggest something here?

L2 Linker

@Ratul Gandhi​  we are also facing the same issue while to try to get the password using CCP with Certificate authentication getting following error. Did you get any solution?

 

Invoke-RestMethod : 

403 - Forbidden: Access is denied.

Server Error

 

 403 - Forbidden: Access is denied.

 You do not have permission to view this directory or page using the credentials that you supplied

 

 

@Manikandan Krishnasamy​  No, couldn't make it work so far.

L2 Linker

Hi

After testing with certificates generated in the Microsoft CA, we found out that we have an SSL certificate that is not valid to use an app_id. A certificate with user signature template has been generated, added the serial number in the app and the thumbprint in the powershell script and works correctly

 

Regards

L0 Member

We had a very similar issue. Found out it was as we had a non-self signed certificate in the 'Local machine' ROOT certificate store. If you have this is breaks the client authentication and you get the 403 - Forbidden error.

See

iis - HTTP error 403.16 - client certificate trust issue - Stack Overflow

L4 Transporter

Thanks @adminpki​  @Tony Dowling​  I'll do some test as per your suggestions and update here.

L2 Linker

IIS log files in %WINDIR%\System32\Logfiles gives the exact cause of 403 forbidden -Access denied error. My issue happend due to 403.16  similar to @Tony Dowling​  (Link : HTTP Error 403.16 when you access a website - Internet Information Services | Microsoft Docs) After cleaning up the store it worked. Few more discoveries from our testing that may help you saving troubleshooting time:

  1. Cyberark CCP installation document (Install the Central Credential Provider | CyberArk Docs) not mentioned any where in the docs to turn on server (CertificateMappingAuthenticationModule" and "IISCertificateMappingAuthenticationModule" ) roles, our testing confirms certificate validation of SN# implemented inside server side code of CCP software .
  2. CCP client authentication validates Serial Number of the certificate , not thumbprint
  3. CCP server requires only root certificate in ROOT certificate store and if client certificate signed with any intermediate certificates , then these certs should be placed in intermediate certificate store.
  4. Make sure to use applicable client certificate EKU and Key usages and subject Alternative names on client certificate and verify certificate is OK .

 

 

 

Hi @Shashidhar Pullkandam​ I've got the certificates in the certificate store on CCP. Which certificates should I place at the application end?

 

I've two options at application web console, either to upload the Client Certificate or Server Certificate. Do I've to upload the certificate that the application url uses or the CCP certificate? If it is CCP, will it be safe to share my CCP server pfx?

 

I was in a impression that Application url certificate needs to be mapped under Client/Server certificate and I've to add that certificate serial number in PVWA, is my understanding correct?

L2 Linker

Do not share or use CCP server pfx certificates which contains private key to the end points where application resides.

Do not use Server Certificates and Serial Numbers for CCP Client Certificate Authentication feature.

 

Create Client Certificate with private key and deploy in Client Application Keystores/Certificate stores . If client certificate signed with chain of intermediate and root certificates then place root signed certificate in CCP Servers certificate store.

Register Client certificate Serial Number in PVWA->Application ID

 

L0 Member

Hi, I faced the same issue, and the error details provided by IIS Logs were :

sc-status : 403

sc-substatus : 16

sc-win32-status : 2148204809

time-taken : 46

I followed this solution : https://docs.microsoft.com/en-us/troubleshoot/iis/http-403-forbidden-access-website

The root cause was the presence of not-self-signed certificates in Intermediate CA and Trusted RootCA certificates stores.

The solution was by removing the not-self-signed certificates from both stores.

Hope it will help.

Regards.

  • 5885 Views
  • 13 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!