Skip to content

Commit 699498a

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

1 file changed

Lines changed: 35 additions & 30 deletions

File tree

doc/content/design/trusted-certificates.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,27 @@ This is an existing API to install a trusted certificate into the pool with its
7070
* name (string): the name of the certificate;
7171
* cert (string): the certificate in PEM format.
7272

73-
In this design, it is used to install root CA certificates only.
74-
A new argument "purpose" is appended to specify the purposes of the trusted certificate to be installed. By default it is an empty set.
73+
Prior to this design, the API's name parameter represents the certificate file name as persisted on the dom0 file system.
74+
In this design, this API will be deprecated because it exposes implementation details that should remain internal and hidden from users.
75+
The new "pool.install_root_certificate" should be used instead.
76+
77+
### pool.install_root_certificate
78+
This is a new API introduced in this design with its arguments being defined as:
7579
* session (ref session_id): reference to a valid session;
76-
* name (string): the name of the certificate;
77-
* cert (string): the certificate in PEM format;
78-
* purpose (string list): the purposes of the certificate
80+
* self (ref Pool): reference to the pool;
81+
* cert (string): the trusted root CA certificate in PEM format;
82+
* purpose (string list): the purposes of the trusted root CA certificate; it stands for a general purpose when it is an empty set.
83+
84+
This new API is used to install trusted root CA certificates only.
7985

8086
### pool.install_peer_certificate
8187
This is a new API introduced in this design with its arguments being defined as:
8288
* session (ref session_id): reference to a valid session;
83-
* name (string): the name of the certificate;
84-
* cert (string): the certificate in PEM format;
85-
* purpose (string list): the purposes of the certificate.
89+
* self (ref Pool): reference to the pool;
90+
* cert (string): the trusted peer certificate in PEM format;
91+
* purpose (string list): the purposes of the trusted peer certificate; can't be an empty set.
8692

87-
This new API can be used to install trusted peer certificates only.
88-
The "purpose" parameter cannot be empty.
93+
This new API is used to install trusted peer certificates only.
8994

9095
### pool.uninstall_certificate
9196
This is a new API introduced in this design to uninstall a trusted certificate with its arguments being defined as:
@@ -94,10 +99,10 @@ This is a new API introduced in this design to uninstall a trusted certificate w
9499
* force (bool): remove the database entry even if the file doesn't exist.
95100

96101
### pool.join
97-
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.
98-
Instead, all trusted certificates from the pool will be synchronized to the new host in the pre-join phase.
102+
Prior to this design, trusted certificates are exchanged between the pool and the joining host during the pre‑join phase.
103+
This design preserves that behavior to ensure the joiner works correctly both before and after joining the pool.
99104

100-
### Other APIs
105+
### Other APIs of managing trusted certificates
101106
The install/uninstall APIs above are not the only ways of managing the trusted certificates.
102107
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.
103108
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.
@@ -112,35 +117,35 @@ The existing stores defined in the base design are:
112117
| 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"
113118
| 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"
114119

115-
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.
116-
117-
When a trusted certificate is being installed via "pool.install_ca_certificate" but with an empty "purpose",
118-
the trusted certificate will be stored in the existing "Trusted Default" and "Default Bundle" for general purpose.
120+
Regarding the "User-configurable", when it is "yes", it means a user can only install and remove the file with "name" parameter of "pool.install_ca_certificate" ; 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.
119121

120-
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.
122+
When a trusted certificate is being installed via "pool.install_ca_certificate", the trusted certificate will be stored in the "Trusted Default" and "Default Bundle".
123+
This design doesn't change this for backwards compatibility. But the API "pool.install_ca_certificate" will be marked as *deprecated*.
121124

122125
The pool "Trusted Pool" and "Pool Bundle" are for host-to-host TLS communications within a pool. This design doesn't change them.
123126

124-
125-
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:
126-
| Name | Filesystem location | User-configurable | Used for |
127-
| ---- | ------------------- | ----------------- | -------- |
128-
| 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\>
129-
| 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\>
130-
| 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\>
131-
| 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\>
127+
The stores for the certificates installed via "pool.install_root_certificate" or "pool.install_peer_certificate" are defined as:
128+
| Name | Filesystem location | Used for |
129+
| ---- | ------------------- | -------- |
130+
| Trusted General CA | /etc/trusted-certs/ca-general/ | Trusted root CA certificates that users can install to validate a peer’s identity when establishing a TLS connection for general purpose.
131+
| Trusted Peer | /etc/trusted-certs/peer-\<PURPOSE\>/ | Trusted peer certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>.
132+
| Trusted CA | /etc/trusted-certs/ca-\<PURPOSE\>/ | Trusted root CA certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>.
133+
| General Bundle | /etc/trusted-certs/ca-bundle-general.pem | Bundle of trusted root CA certificates under /etc/trusted-certs/ca-general/ to verify a peer's identity when establishing a TLS connection for general purpose.
134+
| Peer Bundle | /etc/trusted-certs/peer-bundle-\<PURPOSE\>.pem | Bundle of trusted peer certificates under /etc/trusted-certs/peer-\<PURPOSE\>/ to verify a peer's identity when establishing a TLS connection for \<PURPOSE\>.
135+
| CA Bundle | /etc/trusted-certs/ca-bundle-\<PURPOSE\>.pem | 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\>.
132136

133137
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.
134-
The certificate file names under filesystem locations of "Trusted Peer" and "Trusted CA" should not rely on the "name" field of *Certificate* objects anymore.
135-
Instead, the UUIDs of the *Certificate* objects are used as the file names.
138+
The certificate file names under filesystem locations of "Trusted General CA", "Trusted Peer" and "Trusted CA" will be the UUIDs of the *Certificate* objects.
139+
140+
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.
136141

137142
## Precedence order of choosing trust stores
138143
The "Peer Bundle", "CA Bundle", and "Default Bundle" can be directly used when establishing TLS connections.
139144
The endpoint to validate the peer's identity must unambiguously choose only one non-empty bundle from them with the following precedence order:
140145
1. "Peer Bundle"
141146
2. "CA Bundle"
142-
3. "Default Bundle"
147+
3. "General Bundle"
143148

144149
No more attempts on remaining bundles when validation with the selected one fails (the server certificate is not trusted by the selected bundle).
145150

146-
For example, if "Peer Bundle" doesn't exist and "CA Bundle" (not empty) is selected to do the validation, the endpoint should not try with "Default Bundle" even when the validation with "CA Bundle" failed.
151+
For example, if "Peer Bundle" doesn't exist and the "CA Bundle" (if not empty) is selected to do the validation, the endpoint should not try with "General Bundle" even when the validation with "CA Bundle" failed.

0 commit comments

Comments
 (0)