<?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 Re: How to upload a certificate into a Panorama template using XML API? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/200512#M1591</link>
    <description>&lt;P&gt;I am having the same issue.&amp;nbsp; &amp;nbsp;I have a script that can do this process completely on the firewalls themselves as well as in Panorama, just not in Panorama templates.&amp;nbsp; This is where it is needed most.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Palo Alto API team has stated that they don't have enough interest to spend the time to add this feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any interest in the feature, please have your support team request it or "vote" on my existing feature request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 18:45:26 GMT</pubDate>
    <dc:creator>RandallLoux</dc:creator>
    <dc:date>2018-02-14T18:45:26Z</dc:date>
    <item>
      <title>How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/157597#M1371</link>
      <description>&lt;P&gt;I'm trying to upload a set of SSL certificates into some templates on my Panorama using XML API. But I've not been able to find any documentation for doing that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able upload certificates for the Panorama, using APIs. But I also want to be able to upload certificates into specific firewall template configs that I have on the Panorama using API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any pointers here.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 06:19:32 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/157597#M1371</guid>
      <dc:creator>Spongerius</dc:creator>
      <dc:date>2017-05-22T06:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/200512#M1591</link>
      <description>&lt;P&gt;I am having the same issue.&amp;nbsp; &amp;nbsp;I have a script that can do this process completely on the firewalls themselves as well as in Panorama, just not in Panorama templates.&amp;nbsp; This is where it is needed most.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Palo Alto API team has stated that they don't have enough interest to spend the time to add this feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any interest in the feature, please have your support team request it or "vote" on my existing feature request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:45:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/200512#M1591</guid>
      <dc:creator>RandallLoux</dc:creator>
      <dc:date>2018-02-14T18:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/356216#M2478</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/20379"&gt;@Spongerius&lt;/a&gt;&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/45583"&gt;@RandallLoux&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you succeed with this eventually? I need to do the same but struggle with uploading a cert even directly to the firewall. Can you share a snippet of code? API documentation is exteremely scarce in this regard...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 09:12:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/356216#M2478</guid>
      <dc:creator>Nikolay-Matveev</dc:creator>
      <dc:date>2020-10-14T09:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/357834#M2481</link>
      <description>&lt;P&gt;Answering my own question for the record...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appeared to be easy to upload a certificate directly to the firewall - it's just a matter of constructing a correctly formatted MIME message. It must be a POST request with &lt;FONT face="courier new,courier"&gt;Content-type&lt;/FONT&gt;&amp;nbsp;header set to &lt;FONT face="courier new,courier"&gt;multipart/form-data; boundary=&amp;lt;random tag&amp;gt;&lt;/FONT&gt;, followed by &lt;FONT face="courier new,courier"&gt;Content-length&lt;/FONT&gt;&amp;nbsp; set to the length of the form data. Form data has to be constructed along these lines (Python):&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;form = '--'+&amp;lt;the_boundary_tag&amp;gt;+'\r\n'+'Content-Disposition: form-data; name="file"; filename="certificate.cer"\r\n'+'Content-Type: application/octet-stream\r\n\r\n'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;form = form+cert_body+'\r\n'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;form = form+'--'+&amp;lt;the_boundary_tag&amp;gt;+'--\r\n'&lt;BR /&gt;&lt;BR /&gt;cert_body&lt;/FONT&gt; here is a plain string with Base64/PEM-encoded certificate. Form data has also be encoded as UTF-8 before referencing from the actual request object. For example like this:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;form_binary = form.encode('utf-8')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;req = Request(url, form_binary)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;URL in its turn may be constructed like&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;'https://'+fwAddress+'/api/?type=import&amp;amp;category=certificate&amp;amp;certificate-name='+quote(cert_name,safe='&amp;lt;&amp;gt;[]=')+'&amp;amp;format=pem&amp;amp;key='+key&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this help and saves somebody's time from reverse engineering Curl requests...(which is what I had to do to overcome the scarce API docs on this topic :))&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 16:11:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/357834#M2481</guid>
      <dc:creator>Nikolay-Matveev</dc:creator>
      <dc:date>2020-10-21T16:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/446832#M2828</link>
      <description>&lt;P&gt;I am literally trying to do this right now as I have to update all of the NOIP DDNS certs on like 40 firewalls. The cert is installed on the firewalls via panorama though in each device template exactly as you said. Well I guess there is no sense in wasting time looking for the answer to this problem anymore. Seems like the API is a logical tool for this exact thing!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 21:45:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/446832#M2828</guid>
      <dc:creator>jasonwald</dc:creator>
      <dc:date>2021-11-10T21:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload a certificate into a Panorama template using XML API?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/447293#M2832</link>
      <description>&lt;P&gt;For uploading a certificate to a template on Panorama, first set the target template with the first API call:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://{{host}}/api?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;set&amp;gt;&amp;lt;system&amp;gt;&amp;lt;setting&amp;gt;&amp;lt;target&amp;gt;&amp;lt;template&amp;gt;&amp;lt;name&amp;gt;{{template-name}}&amp;lt;/name&amp;gt;&amp;lt;/template&amp;gt;&amp;lt;/target&amp;gt;&amp;lt;/setting&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/set&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then upload the certificate with a second API call, where this API call includes the cert inside form-data (per&amp;nbsp;Nikolay-Matveev's earlier post):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://{{host}}/api/?key={{key}}&amp;amp;type=import&amp;amp;category=certificate&amp;amp;format=pem&amp;amp;certificate-name={{cert-name}}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 20:32:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/how-to-upload-a-certificate-into-a-panorama-template-using-xml/m-p/447293#M2832</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2021-11-12T20:32:30Z</dc:date>
    </item>
  </channel>
</rss>

