security/acme: support cert upload to Palo Alto Firewall, closes #3289

This commit is contained in:
Jan Winkler
2023-02-21 12:25:56 +01:00
parent 6cf9ae6c57
commit ff1f0ab1a0
5 changed files with 89 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= acme-client
PLUGIN_VERSION= 3.15
PLUGIN_VERSION= 3.16
PLUGIN_COMMENT= ACME Client
PLUGIN_MAINTAINER= opnsense@moov.de
PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon
+5
View File
@@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh
Plugin Changelog
================
3.16
Added:
* new automation: deploy certificates on Palo Alto Networks Firewall (#3289)
3.15
Added:
@@ -263,6 +263,26 @@
<label>Password</label>
<type>password</type>
</field>
<field>
<label>Required Parameters</label>
<type>header</type>
<style>method_table method_table_acme_panos</style>
</field>
<field>
<id>action.acme_panos_username</id>
<label>Username</label>
<type>text</type>
</field>
<field>
<id>action.acme_panos_password</id>
<label>Password</label>
<type>password</type>
</field>
<field>
<id>action.acme_panos_host</id>
<label>Host</label>
<type>text</type>
</field>
<field>
<label>Required Parameters</label>
<type>header</type>
@@ -0,0 +1,47 @@
<?php
/*
* Copyright (C) 2023 Jan Winkler
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\AcmeClient\LeAutomation;
use OPNsense\AcmeClient\LeAutomationInterface;
/**
* Run acme.sh deploy hook panos
* @package OPNsense\AcmeClient
*/
class AcmePanos extends Base implements LeAutomationInterface
{
public function prepare()
{
$this->acme_env['PANOS_USER'] = (string)$this->config->acme_panos_username;
$this->acme_env['PANOS_PASS'] = (string)$this->config->acme_panos_password;
$this->acme_env['PANOS_HOST'] = (string)$this->config->acme_panos_host;
$this->acme_args[] = '--deploy-hook panos --insecure';
return true;
}
}
@@ -1147,6 +1147,7 @@
<configd_upload_sftp>Upload certificate via SFTP</configd_upload_sftp>
<configd_remote_ssh>Remote Command via SSH</configd_remote_ssh>
<acme_fritzbox>Upload certificate to FRITZ!Box router</acme_fritzbox>
<acme_panos>Upload certificate to Palo Alto Networks Firewall</acme_panos>
<acme_vault>Upload certificate to HashiCorp Vault</acme_vault>
<acme_synology_dsm>Upload certificate to Synology DSM</acme_synology_dsm>
<acme_unifi>Update local Unifi keystore</acme_unifi>
@@ -1340,6 +1341,21 @@
<mask>/^.{1,1024}$/u</mask>
<ValidationMessage>Should be a string between 1 and 1024 characters.</ValidationMessage>
</acme_fritzbox_password>
<acme_panos_username type="TextField">
<Required>N</Required>
<mask>/^.{1,1024}$/u</mask>
<ValidationMessage>Should be a string between 1 and 1024 characters.</ValidationMessage>
</acme_panos_username>
<acme_panos_password type="TextField">
<Required>N</Required>
<mask>/^.{1,1024}$/u</mask>
<ValidationMessage>Should be a string between 1 and 1024 characters.</ValidationMessage>
</acme_panos_password>
<acme_panos_host type="TextField">
<Required>N</Required>
<mask>/^.{1,1024}$/u</mask>
<ValidationMessage>Should be a string between 1 and 1024 characters.</ValidationMessage>
</acme_panos_host>
<acme_unifi_keystore type="TextField">
<default>/usr/local/share/java/unifi/data/keystore</default>
<Required>N</Required>