Proxmox Certificate ManagementΒΆ
Certificates for Intra-Cluster CommunicationΒΆ
Each Proxmox VE cluster creates by default its own (self-signed) Certificate Authority (CA) and generates a certificate for each node which gets signed by the aforementioned CA. These certificates are used for encrypted communication with the cluster's pveproxy service and the Shell/Console feature if SPICE is used.
The CA certificate and key are stored in the Proxmox Cluster File System (pmxcfs).
Certificates for API and Web GUIΒΆ
The REST API and web GUI are provided by the pveproxy service, which runs on each node. You have the following options for the certificate used by pveproxy:
- By default the node-specific certificate in
/etc/pve/nodes/NODENAME/pve-ssl.pem
is used. This certificate is signed by the cluster CA and therefore not automatically trusted by browsers and operating systems. - Use an externally provided certificate (e.g. signed by a commercial CA).
- Use ACME (Let's Encrypt) to get a trusted certificate with automatic renewal, this is also integrated in the Proxmox VE API and web interface.
For options 2 and 3 the file /etc/pve/local/pveproxy-ssl.pem
(and
/etc/pve/local/pveproxy-ssl.key
, which needs to be without password) is used.
Keep in mind that /etc/pve/local
is a node specific symlink to
/etc/pve/nodes/NODENAME
.
Certificates are managed with the Proxmox VE Node management command
(see the pvenode(1)
manpage).
Do not replace or manually modify the automatically generated node
certificate files in /etc/pve/local/pve-ssl.pem
and
/etc/pve/local/pve-ssl.key
or the cluster CA files in
/etc/pve/pve-root-ca.pem
and /etc/pve/priv/pve-root-ca.key
.
Upload Custom CertificateΒΆ
If you already have a certificate which you want to use for a Proxmox VE node you can upload that certificate simply over the web interface. Note that the certificates key file, if provided, mustn't be password protected.
Trusted certificates via Let's Encrypt (ACME)ΒΆ
Proxmox VE includes an implementation of the Automatic Certificate Management Environment ACME protocol, allowing Proxmox VE admins to use an ACME provider like Let's Encrypt for easy setup of TLS certificates which are accepted and trusted on modern operating systems and web browsers out of the box.
Currently, the two ACME endpoints implemented are the
Let's Encrypt (LE) production and its staging
environment. Our ACME client supports validation of http-01 challenges using
a built-in web server and validation of dns-01 challenges using a DNS plugin
supporting all the DNS API endpoints acme.sh
does.
ACME AccountΒΆ
You need to register an ACME account per cluster with the endpoint you want to
use. The email address used for that account will serve as contact point for
renewal-due or similar notifications from the ACME endpoint.
You can register and deactivate ACME accounts over the web interface
Datacenter -> ACME
or using the pvenode
command line tool.
|
Because of rate-limits you should use LE staging for experiments or if you use ACME for the first time.
ACME PluginsΒΆ
The ACME plugins task is to provide automatic verification that you, and thus the Proxmox VE cluster under your operation, are the real owner of a domain. This is the basis building block for automatic certificate management.
The ACME protocol specifies different types of challenges, for example the http-01 where a web server provides a file with a certain content to prove that it controls a domain. Sometimes this isn't possible, either because of technical limitations or if the address of a record to is not reachable from the public internet. The dns-01 challenge can be used in these cases. This challenge is fulfilled by creating a certain DNS record in the domain's zone.
Proxmox VE supports both of those challenge types out of the box, you can configure
plugins either over the web interface under Datacenter -> ACME
, or using the
pvenode acme plugin add
command.
ACME Plugin configurations are stored in /etc/pve/priv/acme/plugins.cfg
.
A plugin is available for all nodes in the cluster.
Node DomainsΒΆ
Each domain is node specific. You can add new or manage existing domain entries
under Node -> Certificates, or using the pvenode config
command.
After configuring the desired domain(s) for a node and ensuring that the desired ACME account is selected, you can order your new certificate over the web-interface. On success the interface will reload after 10 seconds.
Renewal will happen automatically.
ACME HTTP Challenge PluginΒΆ
There is always an implicitly configured standalone plugin for validating http-01 challenges via the built-in webserver spawned on port 80.
The name standalone
means that it can provide the validation on it's
own, without any third party service. So, this plugin works also for cluster
nodes.
There are a few prerequisites to use it for certificate management with Let's Encrypts ACME.
- You have to accept the ToS of Let's Encrypt to register an account.
- Port 80 of the node needs to be reachable from the internet.
- There must be no other listener on port 80.
- The requested (sub)domain needs to resolve to a public IP of the Node.
ACME DNS API Challenge PluginΒΆ
On systems where external access for validation via the http-01 method is not possible or desired, it is possible to use the dns-01 validation method. This validation method requires a DNS server that allows provisioning of TXT records via an API.
Configuring ACME DNS APIs for validationΒΆ
Proxmox VE re-uses the DNS plugins developed for the acme.sh project. Please refer to its documentation for details on configuration of specific APIs.
The easiest way to configure a new plugin with the DNS API is using the web
interface (Datacenter -> ACME
).
Choose DNS as challenge type. Then you can select your API provider, enter the credential data to access your account over their API.
See the acme.sh
How to use DNS API
wiki for more detailed information about getting API credentials for your
provider.
As there are many DNS providers and API endpoints Proxmox VE automatically generates the form for the credentials for some providers. For the others you will see a bigger text area, simply copy all the credentials KEY=VALUE pairs in there.
DNS Validation through CNAME AliasΒΆ
A special alias mode can be used to handle the validation on a different
domain/DNS server, in case your primary/real DNS does not support provisioning
via an API. Manually set up a permanent CNAME record for
_acme-challenge.domain1.example
pointing to _acme-challenge.domain2.example
and set the alias property in the Proxmox VE node configuration file to
domain2.example
to allow the DNS server of domain2.example
to validate all
challenges for domain1.example
.
Combination of PluginsΒΆ
Combining http-01 and dns-01 validation is possible in case your node is reachable via multiple domains with different requirements / DNS provisioning capabilities. Mixing DNS APIs from multiple providers or instances is also possible by specifying different plugin instances per domain. Accessing the same service over multiple domains increases complexity and should be avoided if possible.
Automatic renewal of ACME certificatesΒΆ
If a node has been successfully configured with an ACME-provided certificate
(either via pvenode
or via the GUI), the certificate will be automatically
renewed by the pve-daily-update.service
. Currently, renewal will be attempted
if the certificate has expired already, or will expire in the next 30 days.
ACME Examples with pvenodeΒΆ
Example: Sample pvenode
invocation for using Let's Encrypt certificates
|
Example: Setting up the OVH API for validating a domain
The account registration steps are the same no matter which plugins are used, and are not repeated here.
OVH_AK and OVH_AS need to be obtained from OVH according to the OVH API documentation
First you need to get all information so you and Proxmox VE can access the API.
Now you can setup the ACME plugin:
ββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ β key β value β ββββββββββͺβββββββββββββββββββββββββββββββββββββββββββ‘ β api β ovh β ββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ€ β data β OVH_AK=XXXXXXXXXXXXXXXX β β β OVH_AS=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY β β β OVH_CK=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ β ββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ€ β digest β 867fcf556363ca1bea866863093fcab83edf47a1 β ββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ€ β plugin β example_plugin β ββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ€ β type β dns β ββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββ
At last you can configure the domain you want to get certificates for and place the certificate order for it:
Example: Switching from the staging to the regular ACME directoryΒΆ
Changing the ACME directory for an account is unsupported, but as Proxmox VE supports more than one account you can just create a new one with the production (trusted) ACME directory as endpoint. You can also deactivate the staging account and recreate it.
Example: Changing the default ACME account from staging to directory using pvenode
|