Open 0byt3 opened 8 months ago
Hello @0byt3 !
It should still work just fine as long as the upload that you are doing is based on a CSR issue from Panorama.
High level the steps should look like this (an example):
Generate CSR from Panorama:
- name: Generate a csr
paloaltonetworks.panos.panos_op:
provider: '{{ panorama_provider_key }}'
cmd: |
<request>
<certificate>
<generate>
<certificate-name>{{ mgmt_cert_name }}</certificate-name>
<name>{{ ca_cn }}</name>
<algorithm>
<RSA>
<rsa-nbits>2048</rsa-nbits>
</RSA>
</algorithm>
<digest>sha256</digest>
<organization>{{ ca_org }}</organization>
<country-code>{{ ca_country }}</country-code>
<state>{{ ca_state }}</state>
<locality>{{ ca_location }}</locality>
<ca>no</ca>
<ip>
{% for ip in ca_ipv4_list %}
<member>{{ ip }}</member>
{% endfor %}
</ip>
<signed-by>external</signed-by>
</generate>
</certificate>
</request>
cmd_is_xml: true
Download generated CSR (notice the cert name):
- name: Download the generated CSR
paloaltonetworks.panos.panos_export:
provider: '{{ panorama_provider_key }}'
category: certificate
certificate_name: '{{ mgmt_cert_name }}'
certificate_format: pkcs10
filename: 'csr/{{ inventory_hostname }}.csr'
- name: Upload certificate
paloaltonetworks.panos.panos_import:
provider: '{{ panorama_provider }}'
category: certificate
certificate_name: "{{ mgmt_cert_name }}"
format: pem
filename: 'pem/{{ inventory_hostname }}.pem'
template: '{{ ci_template_name }}'
If the certificate name won't match the generated CSR - Panorama/firewall will not "recognise" that certificate and will prompt you to also upload the private key for it.
@0byt3 did you get a chance to test/confirm the above ?
Unless we receive a reply soon - we will proceed to close the issue.
Describe the bug
Unable to import certificate into panorama.
Expected behavior
I should be able to import a PEM certificate into panorama and templates.
Current behavior
I receive the error "Import of letsencrypt_chain01 failed. private key doesn't exist for csr" when using paloaltonetworks.panos.panos_import.
It seems that something has change such that importing PEM is only used for completing a certificate request now? Used to be the case that I could use this to import trusted certificates.
Possible solution
Not sure how it is to be fixed. It used to work, but no longer does.
Steps to reproduce
Context
I am trying to automate the deployment of my LetsEncrypt chain certificates into Panorama.
Your Environment
PAN-OS Python Library