<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic (Question) CCP with Client Cert Auth vis PoSh or Python in Secrets Management</title>
    <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361090#M1058</link>
    <description>&lt;P&gt;We have configured CCP client certificate auth and have the Windows browser and a MacOS browser pulling the credentials but are having trouble getting a PowerShell (Invoke-Rest-Method) or Python (Import Requests) script working. Does anyone have the syntax or a script that can pass either the cert or the thumbprint/SN via Python or Powershell?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The curl command working looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Convert the .pfx to .cer&lt;/P&gt;&lt;P&gt;openssl pkcs12 -in /path/to/CERT_export.pfx -out /path/to/CERT_export.cer -nodes&lt;/P&gt;&lt;P&gt;Enter Import Password:&lt;/P&gt;&lt;P&gt;MAC verified OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Call the CCP&lt;/P&gt;&lt;P&gt;curl --request GET --url 'https://cyberark.com/AIMWebService/api/Accounts?AppID=&amp;lt;APPID&amp;gt;&amp;amp;Safe=&amp;lt;SAFE&amp;gt;&amp;amp;Folder=Root&amp;amp;Object=&amp;lt;OBJECT-NAME&amp;gt;' --header 'Content-Type: application/json' --cert '/PATH/TO/CERT_export.cer'&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 13:49:38 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2018-08-02T13:49:38Z</dc:date>
    <item>
      <title>(Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361090#M1058</link>
      <description>&lt;P&gt;We have configured CCP client certificate auth and have the Windows browser and a MacOS browser pulling the credentials but are having trouble getting a PowerShell (Invoke-Rest-Method) or Python (Import Requests) script working. Does anyone have the syntax or a script that can pass either the cert or the thumbprint/SN via Python or Powershell?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The curl command working looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Convert the .pfx to .cer&lt;/P&gt;&lt;P&gt;openssl pkcs12 -in /path/to/CERT_export.pfx -out /path/to/CERT_export.cer -nodes&lt;/P&gt;&lt;P&gt;Enter Import Password:&lt;/P&gt;&lt;P&gt;MAC verified OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Call the CCP&lt;/P&gt;&lt;P&gt;curl --request GET --url 'https://cyberark.com/AIMWebService/api/Accounts?AppID=&amp;lt;APPID&amp;gt;&amp;amp;Safe=&amp;lt;SAFE&amp;gt;&amp;amp;Folder=Root&amp;amp;Object=&amp;lt;OBJECT-NAME&amp;gt;' --header 'Content-Type: application/json' --cert '/PATH/TO/CERT_export.cer'&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 13:49:38 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361090#M1058</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-02T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361091#M1059</link>
      <description>&lt;P&gt;I hope this is what you're looking for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-RestMethod -Uri "https://cyberark.com/AIMWebservice/api/Accounts?AppID=&amp;lt;AppID&amp;gt;&amp;amp;Safe=&amp;lt;Safe&amp;gt;&amp;amp;object=&amp;lt;Object-Name&amp;gt;" -Method Get -CertificateThumbprint &amp;lt;Cert Thumbprint w/ no spaces&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 15:21:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361091#M1059</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-02T15:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361092#M1060</link>
      <description>&lt;P&gt;Thanks for the reply. There must've been an issue with how the cert was imported because that syntax wasn't working but I have two versions that work now. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;B&gt;This will ingest the cert and ask for the pfx password at runtime.&lt;/B&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Declare Variables&lt;/P&gt;&lt;P&gt;$BASEURL="____"&lt;/P&gt;&lt;P&gt;$APPID="____"&lt;/P&gt;&lt;P&gt;$SAFE="____"&lt;/P&gt;&lt;P&gt;$FOLDER="____"&lt;/P&gt;&lt;P&gt;$OBJECT="____"&lt;/P&gt;&lt;P&gt;$CERTPATH="____"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Retrieve Certificate&lt;/P&gt;&lt;P&gt;$CERT=Get-PfxCertificate -FilePath $CERTPATH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Call the CCP&lt;/P&gt;&lt;P&gt;Invoke-RestMethod -Uri "https://$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $CERT.ThumbPrint&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;       2. &lt;B&gt;This assumes that the cert is imported in the local machine personal store.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Declare Variables&lt;/P&gt;&lt;P&gt;$BASEURL="____"&lt;/P&gt;&lt;P&gt;$APPID="____"&lt;/P&gt;&lt;P&gt;$SAFE="____"&lt;/P&gt;&lt;P&gt;$FOLDER="____"&lt;/P&gt;&lt;P&gt;$OBJECT="____"&lt;/P&gt;&lt;P&gt;$THUMBPRINT="XXXXXXXXXXXXXXXXXXXXXXXXX"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Call the CCP&lt;/P&gt;&lt;P&gt;Invoke-RestMethod -Uri "$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $THUMBPRINT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 17:59:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361092#M1060</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-03T17:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361093#M1061</link>
      <description>&lt;P&gt;Hi @James Stutes​&amp;nbsp; and @Peter Greenwood​&amp;nbsp; you can use now Code Snippet &amp;lt;/&amp;gt; for getting better presentation of code:&lt;/P&gt;&lt;CODE&gt;# Declare Variables
$BASEURL="____"
$APPID="____"
$SAFE="____"
$FOLDER="____"
$OBJECT="____"
$THUMBPRINT="XXXXXXXXXXXXXXXXXXXXXXXXX"
&amp;nbsp;
# Call the CCP
Invoke-RestMethod -Uri "$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $THUMBPRINT&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 20:45:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361093#M1061</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-03T20:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361094#M1062</link>
      <description>&lt;P&gt;@Yaron Zorea​&amp;nbsp; How do you insert a code snippet? It doesn't look like I have that format option.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__06850000004OhJRAA0.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/84597i5D874B89F326D315/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__06850000004OhJRAA0.png" alt="Field_Content_versions_oct20__06850000004OhJRAA0.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 21:00:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361094#M1062</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-03T21:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361095#M1063</link>
      <description>&lt;P&gt;Hi @Peter Greenwood​&amp;nbsp;I have a different user license and permissions. I have checked it now with a the same user type that you are using and this option is not available.&lt;/P&gt;&lt;P&gt;I will investigate it next week and will update.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yaron&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 21:11:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361095#M1063</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-03T21:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361096#M1064</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Field_Content_versions_oct20__06850000005Pgl9AAC.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/84609i6C266F9FD1711A5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Field_Content_versions_oct20__06850000005Pgl9AAC.png" alt="Field_Content_versions_oct20__06850000005Pgl9AAC.png" /&gt;&lt;/span&gt;Hi @Peter Greenwood​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;We have enabled code snippet for community users.  Please let us know if it is working for you.&lt;/P&gt;&lt;P&gt;Yaron&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 12:48:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361096#M1064</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-06T12:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361097#M1065</link>
      <description>&lt;CODE&gt;--- Sample Code
# Declare Variables
$BASEURL="____"
$APPID="____"
$SAFE="____"
$FOLDER="____"
$OBJECT="____"
$THUMBPRINT="XXXXXXXXXXXXXXXXXXXXXXXXX"
 
# Call the CCP
Invoke-RestMethod -Uri "$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $THUMBPRINT&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 12:49:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361097#M1065</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-06T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361098#M1066</link>
      <description>&lt;P&gt;The code snippet option is enabled now. That is great! Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to close the loop on this thread, I will include the sample scripts I pasted earlier that work for CCP with Client Cert Auth:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;B&gt;PowerShell: Assuming the certificate has been imported to your machines cert store, this script will authenticate to the CCP using the cert thumbprint.&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;CODE&gt;# Declare Variables
$BASEURL="____"
$APPID="____"
$SAFE="____"
$FOLDER="____"
$OBJECT="____"
$THUMBPRINT="XXXXXXXXXXXXXXXXXXXXXXXXX"
&amp;nbsp;
# Call the CCP
Invoke-RestMethod -Uri "$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $THUMBPRINT&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;B&gt;PowerShell: This script will ingest the pfx cert at runtime, prompt        the user for the cert file password, and input the Thumbprint into the REST call .&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;CODE&gt;# Declare Variables
$BASEURL="____"
$APPID="____"
$SAFE="____"
$FOLDER="____"
$OBJECT="____"
$CERTPATH="____"
&amp;nbsp;
# Retrieve Certificate
$CERT=Get-PfxCertificate -FilePath $CERTPATH
&amp;nbsp;
# Call the CCP
Invoke-RestMethod -Uri "https://$BASEURL/AIMWebService/api/Accounts?AppID=$APPID&amp;amp;Safe=$SAFE&amp;amp;Folder=$FOLDER&amp;amp;Object=$OBJECT" -Method Get -CertificateThumbprint $CERT.ThumbPrint&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 13:09:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361098#M1066</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2018-08-06T13:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: (Question) CCP with Client Cert Auth vis PoSh or Python</title>
      <link>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361099#M1067</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first time dealing with CCP Cert Authentication. When you say "This is assuming that certificate has been imported to your machines cert store." Do you mean the machine from where the call is being made or the CCP server? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance, &lt;/P&gt;&lt;P&gt;Douglas Galan&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 23:01:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/secrets-management/question-ccp-with-client-cert-auth-vis-posh-or-python/m-p/1361099#M1067</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2021-07-16T23:01:00Z</dc:date>
    </item>
  </channel>
</rss>

