From 6b2127d40461db330441ae4d217f8004bf27140b Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Thu, 13 Jul 2023 11:29:10 +0200 Subject: [PATCH] security/acme: support for Proxmox VE deployhook, closes #3422 --- security/acme-client/pkg-descr | 1 + .../AcmeClient/forms/dialogAction.xml | 29 +++++++++++ .../AcmeClient/LeAutomation/AcmeProxmoxve.php | 48 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 25 ++++++++++ 4 files changed, 103 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxve.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a2aafd3fb..3dfd89e56 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog Added: * add support for TrueNAS deployhook (#3421) +* add support for Proxmox VE deployhook (#3422) 3.17 diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index 906dd9cde..58d92f24c 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -283,6 +283,35 @@ text + + + header + + + + action.acme_proxmoxve_user + + text + The user who owns the API key. Defaults to root. + + + action.acme_proxmoxve_realm + + text + The authentication realm the user authenticates with. Defaults to pam. + + + action.acme_proxmoxve_tokenid + + text + The name of the API token created for the user account. Defaults to acme. + + + action.acme_proxmoxve_tokenkey + + text + The API token. Required. + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxve.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxve.php new file mode 100644 index 000000000..6e4c8e16f --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxve.php @@ -0,0 +1,48 @@ +acme_env['DEPLOY_PROXMOXVE_USER'] = (string)$this->config->acme_proxmoxve_user; + $this->acme_env['DEPLOY_PROXMOXVE_USER_REALM'] = (string)$this->config->acme_proxmoxve_realm; + $this->acme_env['DEPLOY_PROXMOXVE_API_TOKEN_NAME'] = (string)$this->config->acme_proxmoxve_tokenid; + $this->acme_env['DEPLOY_PROXMOXVE_API_TOKEN_KEY'] = (string)$this->config->acme_proxmoxve_tokenkey; + $this->acme_args[] = '--deploy-hook proxmoxve'; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 1eca8d91b..c9e6f1bef 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1172,6 +1172,7 @@ Remote Command via SSH Upload certificate to FRITZ!Box router Upload certificate to Palo Alto Networks Firewall + Upload certificate to Proxmox VE Upload certificate to HashiCorp Vault Upload certificate to Synology DSM Upload certificate to TrueNAS Core Server @@ -1381,6 +1382,30 @@ /^.{1,1024}$/u Should be a string between 1 and 1024 characters. + + root + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + pam + N + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + acme + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N /^.{1,1024}$/u