Skip to content

Commit d6a4b85

Browse files
committed
[doc] Split peer and root CA for trusted certificates; Add trust purposes
Signed-off-by: Ming Lu <[email protected]>
1 parent a9978f1 commit d6a4b85

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

doc/content/design/pool-certificates.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: TLS vertification for intra-pool communications
33
layout: default
44
design_doc: true
5-
revision: 2
5+
revision: 3
66
status: released (22.6.0)
77
---
88

@@ -62,9 +62,14 @@ The hosts will exploit this to request a particular service when they establish
6262
When initiating a connection to another host in the pool, a server will create requests for TLS connections with the server_name `xapi:pool` with the `name_type` `DNS`, this goes against RFC-6066 as this `server_name` is not resolvable.
6363
This still works because we control the implementation in both peers of the connection and can follow the same convention.
6464

65-
In addition connections to the WLB appliance will continue to be validated using the current scheme of user-installed CA certificates.
66-
This means that hosts connecting to the appliance will need a special case to only trust user-installed certificated when establishing the connection.
67-
Conversely pool connections will ignore these certificates.
65+
As the unified API for the whole system, XAPI also exposes interfaces for users to install and manage trusted certificates that are used by system components for different purposes, such as outbound TLS connections to WLB appliance, License Server, LDAPS servers, etc.
66+
This means that the TLS clients need to only trust the user-installed certificates when establishing a TLS connection for a specific purpose. Conversely pool connections will ignore these certificates.
67+
Two kinds of trusted certificates can be supported when validating a server certificate, which also represent two validation modes:
68+
* root CA certificate, which is used in standard PKI validation where the server’s certificate chain is built with it;
69+
* peer certificate, which represents the expected server leaf certificate and hence can be used to compare with the received server leaf certificate. This model supports quick trust establishment, including Trust‑On‑First‑Use (TOFU) and self-signed server certificate scenarios where the first received leaf certificate is trusted to avoid user intervention or configuration.
70+
71+
It's up to the TLS client to determine how to use the peer and root CA certificates.
72+
6873
| Name | Filesystem location | User-configurable | Used for |
6974
| ---- | ------------------- | ----------------- | -------- |
7075
| Host Default | /etc/xensource/xapi-ssl.pem | yes (using API) | Hosts serve it to normal API clients
@@ -73,13 +78,19 @@ Conversely pool connections will ignore these certificates.
7378
| Trusted Pool | /etc/stunnel/certs-pool/ | no | Certificates that are managed by the pool for host-to-host communications
7479
| Default Bundle | /etc/stunnel/xapi-stunnel-ca-bundle.pem | no | Bundle of certificates that hosts use to verify appliances (in particular WLB), this is kept in sync with "Trusted Default"
7580
| Pool Bundle | /etc/stunnel/xapi-pool-ca-bundle.pem | no | Bundle of certificates that hosts use to verify other hosts on pool communications, this is kept in sync with "Trusted Pool"
81+
| Trusted root CA for \<PURPOSE\>| /etc/stunnel/certs-ca-\<PURPOSE\>/ | no (derived from the \<PURPOSE\>) | Root CA certificates that users have installed to validate the server certificate for \<PURPOSE\>
82+
| Trusted peer for \<PURPOSE\>| /etc/stunnel/certs-peer-\<PURPOSE\>/ | no (derived from the \<PURPOSE\>) | Peer certificates that users have installed to validate the server certificate for \<PURPOSE\>
83+
| Trusted root CA bundle for \<PURPOSE\>| /etc/stunnel/ca-\<PURPOSE\>-bundle.pem | no (derived from the \<PURPOSE\>) | Bundle of root CA certificates containing all certificates under /etc/stunnel/certs-ca-\<PURPOSE\>/
84+
| Trusted peer bundle for \<PURPOSE\>| /etc/stunnel/peer-\<PURPOSE\>-bundle.pem | no (derived from the \<PURPOSE\>) | Bundle of peer certificates containing all certificates under /etc/stunnel/certs-peer-\<PURPOSE\>/
85+
86+
The \<PURPOSE\> is used to separate different purposes and is extensible for more use cases.
7687

7788
## Cryptography of certificates
7889

7990
The certificates until now have been signed using sha256WithRSAEncryption:
8091

8192
* Pre-8.0 releases use 1024-bit RSA keys.
82-
* 8.0, 8.1 and 8.2 use 2048-bit RSA keys.
93+
* 8.0, 8.1, 8.2, and 8.4 use 2048-bit RSA keys.
8394

8495
The Default Certificates served to API clients will continue to use sha256WithRSAEncryption with 2048-bit RSA keys. The Pool certificates will use the same algorithms for consistency.
8596

@@ -295,6 +306,11 @@ This call imposes the same requirements in a pool as the pool secret rotation: I
295306
The API call is Pool.rotate_internal_certificates.
296307
It is exposed by xe as pool-rotate-internal-certificates.
297308

309+
## U13. Install trusted peer certificates for Licensing
310+
311+
The licensing function itself is not in the XAPI process. But a user can use the XAPI API to install peer certificates for licensing purposes.
312+
Then the licensing function, which is another process, can use the bundle file "/etc/stunnel/peer-licensing-bundle.pem" to validate the License Server certificate when establishing a TLS connection to the License Server.
313+
298314
# Changes
299315

300316
Xapi startup has to account for host changes that affect this feature and modify the filesystem and pool database accordingly.
@@ -304,6 +320,8 @@ Xapi startup has to account for host changes that affect this feature and modify
304320
* Pool certificate changed: On first boot, after a pool join and after having done emergency repairs the internal server certificate record may not match the contents of the filesystem. A check is to be introduced that detects if the database does not associate a certificate with the host or if the certificate's public key in the database and the filesystem are different. This check is made aware whether the host is joining a pool or is on first-boot, it does this by counting the amount of hosts in the pool from the database. In the case where it's joining a pool it simply updated the database record with the correct information from the filesystem as the filesystem contents have been put in place before the restart. In the case of first boot the public part of the certificate is copied to the directory and the bundle for internally-trusted certificates: /etc/stunnel/certs-pool/ and /etc/stunnel/xapi-pool-ca-bundle.pem.
305321

306322
The xapi database records for certificates must be changed according with the additions explained before.
323+
Particularly, the existing "type" field of Certificate class is extended to accept a new enum value "peer", besides its current supported values "ca", "host", and "host_internal". The new value is for the peer trusted certificates which are just the server leaf certificates.
324+
And a new field "purposes" is added to the class as a set of new type "purpose". By default it is an empty set to stand for the existing "Trusted Default" for backwards compatibility.
307325

308326
### API
309327

@@ -313,10 +331,12 @@ Additions
313331
* TLS_VERIFICATION_ENABLE_IN_PROGRESS is a new error that is produced when trying to do other pool operations while enabling TLS verification is in progress
314332
* Host.emergency_disable_tls_verification: this called is allowed for role _R_LOCAL_ROOT_ONLY: it's an emergency command and acts locally. It forces connections in xapi to stop verifying the peers on outgoing connections. It generates an alert to warn the administrators of this uncommon state.
315333
* Host.emergency_reenable_tls_verification: this call is allowed for role _R_LOCAL_ROOT_ONLY: it's an emergency command and acts locally. It changes the configuration so xapi verifies connections by default after being switched off with the previous command.
316-
* Pool.install_ca_certificate: rename of Pool.certificate_install, add the ca certificate to the database.
334+
* Pool.install_ca_certificate: rename of Pool.certificate_install, add the ca certificate to the database. A <purposes> argument is appended as a set of purposes. By default it is empty standing for "Trusted Default".
317335
* Pool.uninstall_ca_certificate: rename of Pool.certificate_uninstall, removes the certificate from the database.
318336
* Host.reset_server_certificate: replaces Host.emergency_reset_server_certificate, now it's allowed for role _R_POOL_ADMIN. It adds a record for the generated Default Certificate to the database while removing the previous record, if any.
319337
* Pool.rotate_internal_certificates: This call generates new Pool certificates, and substitutes the previous certificates with these. See the certificate expiry section for more details.
338+
* Pool.install_peer_certificate: adds the peer certificate to the database.
339+
* Pool.uninstall_peer_certificate: removes the peer certificate from the database
320340

321341
Modifications:
322342
* Pool.join: certificates must be correctly distributed. API Error POOL_JOINING_HOST_TLS_VERIFICATION_MISMATCH is returned if the tls_verification of the two pools doesn't match.
@@ -340,6 +360,8 @@ Following API additions:
340360
* host-reset-server-certificate
341361
* host-emergency-disable-tls-verification (emits a warning when verification is off and the pool-level is on)
342362
* host-emergency-reenable-tls-verification
363+
* pool-install-peer-certificate
364+
* pool-uninstall-peer-certificate
343365

344366
And removals:
345367
* host-emergency-server-certificate

0 commit comments

Comments
 (0)