CCP - Client Certificate Authentication - Example Script

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Scheduled Maintenance: November 14–15 (starting Nov. 14 at 12:00 AM PST)
LIVEcommunity will temporarily operate in read-only mode as we prepare to welcome Idira!
Public content will remain accessible, but log-ins, posting and community interactions will be paused during this period. Thank you for your patience!
Secrets Management Articles
1 min read
L1 Bithead
No ratings
The below PowerShell scripts shows examples of how the CCP can be called using a client certificate for authentication.

These scripts are provided on example basis only, and assume SSL verification is successful between the client and the CCP server.
 

CCP API Request example (this is the format expected in the first two scripts below):

https://ccp.cybr.com/AIMWebService/api/Accounts?appid=sampleapp&safe=demosafe&address=1.1.1.1
 

Steps

For use with .cer certificate file:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$URI = "CCP API request"
$cert = "Absolute path of .cer file"
$res = (Invoke-RestMethod -Method Get -Uri $URI -Certificate $cert)
echo $res

 

For use with .pfx certificate file:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$URI = "CCP API request"
$certPath = "Absolute path of .pfx file"
$cert = Get-PfxCertificate -FilePath $certPath
$res = (Invoke-RestMethod -Method Get -Uri $URI -Certificate $cert)
echo $res


For use with a certificate in the Windows Certificate Store:
See attached Powershell script file.
Rate this article: