From fa46d37418ae6f1d0c7fa2b07e25dc9d8438d0e8 Mon Sep 17 00:00:00 2001
From: Demony <60526467+HTDemony@users.noreply.github.com>
Date: Mon, 7 Jul 2025 12:17:12 +0200
Subject: [PATCH] security/acme-client: implement certificate deployment to
Proxmox Backup Server (#4785)
closes #4764
---
.../AcmeClient/forms/dialogAction.xml | 41 +++++++++++++++
.../AcmeClient/LeAutomation/AcmeProxmoxbs.php | 50 +++++++++++++++++++
.../models/OPNsense/AcmeClient/AcmeClient.xml | 39 +++++++++++++++
3 files changed, 130 insertions(+)
create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxbs.php
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 292fd9c23..93167a695 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
@@ -331,6 +331,47 @@
textThe API token. Required.
+
+
+ header
+
+
+
+ action.acme_proxmoxbs_user
+
+ text
+ The user who owns the API key. Defaults to root.
+
+
+ action.acme_proxmoxbs_server
+
+ text
+ The hostname of the proxmox BS node.
+
+
+ action.acme_proxmoxbs_port
+
+ text
+ The port number the management interface is on. Defaults to 8007.
+
+
+ action.acme_proxmoxbs_realm
+
+ text
+ The authentication realm the user authenticates with. Defaults to pam.
+
+
+ action.acme_proxmoxbs_tokenid
+
+ text
+ The name of the API token created for the user account. Defaults to acme.
+
+
+ action.acme_proxmoxbs_tokenkey
+
+ text
+ The API token. Required.
+ header
diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxbs.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxbs.php
new file mode 100644
index 000000000..5a2c6b701
--- /dev/null
+++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeProxmoxbs.php
@@ -0,0 +1,50 @@
+acme_env['DEPLOY_PROXMOXBS_USER'] = (string)$this->config->acme_proxmoxbs_user;
+ $this->acme_env['DEPLOY_PROXMOXBS_SERVER'] = (string)$this->config->acme_proxmoxbs_server;
+ $this->acme_env['DEPLOY_PROXMOXBS_SERVER_PORT'] = (string)$this->config->acme_proxmoxbs_port;
+ $this->acme_env['DEPLOY_PROXMOXBS_USER_REALM'] = (string)$this->config->acme_proxmoxbs_realm;
+ $this->acme_env['DEPLOY_PROXMOXBS_API_TOKEN_NAME'] = (string)$this->config->acme_proxmoxbs_tokenid;
+ $this->acme_env['DEPLOY_PROXMOXBS_API_TOKEN_KEY'] = (string)$this->config->acme_proxmoxbs_tokenkey;
+ $this->acme_args[] = '--deploy-hook proxmoxbs';
+ 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 2127a7bc6..76e57c6df 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
@@ -1350,6 +1350,7 @@
Remote Command via SSHUpload certificate to FRITZ!Box routerUpload certificate to Palo Alto Networks Firewall
+ Upload certificate to Proxmox Backup EnvironmentUpload certificate to Proxmox VEUpload certificate to HashiCorp VaultUpload certificate to Synology DSM
@@ -1601,6 +1602,44 @@
/^.{1,1024}$/uShould be a string between 1 and 1024 characters.
+
+ root
+ 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.
+
+
+ 8007
+ N
+
+
+ N
+ localhost
+ /^.{1,1024}$/u
+ Should be a string between 1 and 1024 characters.
+
+
+ pam
+ 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