Skip to content

Commit 5a5e2a2

Browse files
committed
fixup! [doc] Improvements on management of trusted certificates
Signed-off-by: Ming Lu <ming.lu@cloud.com>
1 parent 08d29ff commit 5a5e2a2

1 file changed

Lines changed: 31 additions & 13 deletions

File tree

doc/content/design/trusted-certificates.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Two improvements in this design:
5656
The new "peer" will represent trusted peer certificates.
5757

5858
* A new enumeration type "purpose" is introduced to indicate the intended usage of a trusted certificate.
59-
A new *Certificate* class field "purposes" (a set of values of enumeration type "purpose") will be added to represent all applicable purposes of a trusted certificate.
60-
By default, this set is empty which corresponds to the existing general "ca" certificates.
59+
A new *Certificate* class field "purpose" (a set of values of enumeration type "purpose") will be added to represent all applicable purposes of a trusted certificate.
60+
By default, this set is empty which corresponds to the existing "ca" certificates for general purpose.
6161

6262
## API
6363

@@ -68,21 +68,22 @@ This is an existing API to install a trusted certificate into the pool with its
6868
* name (string): the name of the certificate;
6969
* cert (string): the certificate in PEM format.
7070

71-
In this design, it is recommended to use it to install root CA certificates only.
72-
And a new argument "purposes" is appended to specify the purposes of the trusted certificate to be installed. By default it is an empty set.
71+
In this design, it is used to install root CA certificates only.
72+
A new argument "purpose" is appended to specify the purposes of the trusted certificate to be installed. By default it is an empty set.
7373
* session (ref session_id): reference to a valid session;
7474
* name (string): the name of the certificate;
7575
* cert (string): the certificate in PEM format;
76-
* purposes (string list): the purposes of the certificate
76+
* purpose (string list): the purposes of the certificate
7777

7878
### pool.install_peer_certificate
7979
This is a new API introduced in this design with its arguments being defined as:
8080
* session (ref session_id): reference to a valid session;
8181
* name (string): the name of the certificate;
8282
* cert (string): the certificate in PEM format;
83-
* purposes (string list): the purposes of the certificate.
83+
* purpose (string list): the purposes of the certificate.
8484

8585
This new API can be used to install trusted peer certificates only.
86+
The "purpose" parameter cannot be empty.
8687

8788
And corresponding "pool.uninstall_peer_certificate" for uninstalling a trusted peer certificate with arguments:
8889
* session (ref session_id): reference to a valid session;
@@ -93,6 +94,11 @@ And corresponding "pool.uninstall_peer_certificate" for uninstalling a trusted p
9394
Since the trusted certificates managed in this design are pool-wide, any existing trusted certificates on the joining host should be removed during pool.join.
9495
Instead, all trusted certificates from the pool will be synchronized to the new host in the pre-join phase.
9596

97+
### Other APIs
98+
The install/uninstall APIs above are not the only ways of managing the trusted certificates.
99+
A particular API, e.g. "pool.set_wlb_url", may also install the trusted certificate used to validate the WLB server on subsequent TLS connections.
100+
However, regardless of the entry point, all trusted certificates must be represented by a *Certificate* database object and stored in the same way described below as if installed by the install APIs.
101+
96102
## Trust store
97103
The trusted certificates are stored in individual hosts' filesystems.
98104
The existing stores defined in the base design are:
@@ -103,20 +109,32 @@ The existing stores defined in the base design are:
103109
| 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"
104110
| 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"
105111

106-
For backwards compatibility, when a trusted certificate is being installed via "pool.install_ca_certificate" or "pool.install_peer_certificate" but with empty "purposes",
107-
the trusted certificate will be stored as "Trusted Default" and "Default Bundle".
112+
Regarding the "User-configurable", when it is "yes", it means a user can only install and remove the file via APIs; when it is "no", it means the user can't install or remove it even via APIs. In any cases, a user can't change the certificate files directly.
113+
114+
When a trusted certificate is being installed via "pool.install_ca_certificate" but with an empty "purpose",
115+
the trusted certificate will be stored in the existing "Trusted Default" and "Default Bundle" for general purpose.
116+
117+
There is no general‑purpose store for trusted peer certificates, because each peer certificate is specific to a single server and therefore unsuitable for a shared trust bundle for general purpose.
118+
108119
The pool "Trusted Pool" and "Pool Bundle" are for host-to-host TLS communications within a pool. This design doesn't change them.
109120

110-
When the "purposes" is not empty, the stores for the certificates installed via "pool.install_ca_certificate" or "pool.install_peer_certificate" are defined as:
121+
122+
When the "purpose" is not empty, the stores for the certificates installed via "pool.install_ca_certificate" or "pool.install_peer_certificate" are defined as:
111123
| Name | Filesystem location | User-configurable | Used for |
112124
| ---- | ------------------- | ----------------- | -------- |
113-
| Trusted Peer | /etc/trusted-certs/peer-\<PURPOSE\>/ | no | Trusted peer certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>
114-
| Trusted CA | /etc/trusted-certs/ca-\<PURPOSE\>/ | no | Trusted root CA certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>
125+
| Trusted Peer | /etc/trusted-certs/peer-\<PURPOSE\>/ | yes (using API) | Trusted peer certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>
126+
| Trusted CA | /etc/trusted-certs/ca-\<PURPOSE\>/ | yes (using API) | Trusted root CA certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>
115127
| Peer Bundle | /etc/trusted-certs/peer-bundle-\<PURPOSE\>.pem | no | Bundle of trusted peer certificates under /etc/trusted-certs/peer-\<PURPOSE\>/ to verify a peer's identity when establishing a TLS connection for \<PURPOSE\>
116128
| CA Bundle | /etc/trusted-certs/ca-bundle-\<PURPOSE\>.pem | no | Bundle of trusted root CA certificates under /etc/trusted-certs/ca-\<PURPOSE\>/ to verify a peer's identity when establishing a TLS connection for \<PURPOSE\>
117129

118130
The filesystem location is derived from the \<PURPOSE\>. Each \<PURPOSE\> string corresponds to a predefined value of the "purpose" type in the database, implemented as predefined constants.
119131

120-
The "Peer Bundle" and "CA Bundle" can be directly used by other non-XAPI processes when establishing TLS connections.
121-
Users can select the appropriate bundle based on the chosen validation method: certificate chain validation or certificate pinning.
132+
## Precedence order of choosing trust stores
133+
The "Peer Bundle", "CA Bundle", and "Default Bundle" can be directly used when establishing TLS connections.
134+
The endpoint to validate the peer's identity must unambiguously choose only one from these bundles with the following precedence order:
135+
1. "Peer Bundle"
136+
2. "CA Bundle"
137+
3. "Default Bundle"
122138

139+
For example, if "Peer Bundle" exists for the particular purpose, use this bundle file and certificate pinning to validate the peer's identity.
140+
No more attempts with "CA Bundle" or "Default Bundle" even when the validation with "Peer Bundle" failed.

0 commit comments

Comments
 (0)