You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/content/design/pool-certificates.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ revision: 2
6
6
status: released (22.6.0)
7
7
---
8
8
9
+
This design is modified by [trusted-certificates.md](trusted-certificates.md).
10
+
9
11
## Overview
10
12
11
13
Xenserver has used TLS-encrypted communications between xapi daemons in a pool since its first release.
@@ -353,22 +355,30 @@ This feature needs clients to behave differently when initiating pool joins, to
353
355
Several alerts are introduced:
354
356
* POOL_CA_CERTIFICATE_EXPIRING_30, POOL_CA_CERTIFICATE_EXPIRING_14, POOL_CA_CERTIFICATE_EXPIRING_07, POOL_CA_CERTIFICATE_EXPIRED: Similar to host certificates, now the user-installable pool's CA certificates are monitored for expiry dates and alerts are generated about them. The body for this type of message is:
355
357
358
+
```
356
359
<body><message>The trusted TLS server certificate {is expiring soon|has expired}.</message><date>20210302T02:00:01Z</date></body>
360
+
```
357
361
358
362
* HOST_INTERNAL_CERTIFICATE_EXPIRING_30, HOST_INTERNAL_CERTIFICATE_EXPIRING_14, HOST_INTERNAL_CERTIFICATE_EXPIRING_07, HOST_INTERNAL_CERTIFICATE_EXPIRED: Similar to host certificates, the newly-introduced hosts' internal server certificates are monitored for expiry dates and alerts are generated about them. The body for this type of message is:
359
363
364
+
```
360
365
<body><message>The TLS server certificate for internal communications {is expiring soon|has expired}.</message><date>20210302T02:00:01Z</date></body>
366
+
```
361
367
362
368
* TLS_VERIFICATION_EMERGENCY_DISABLED: The host is in emergency mode and is not enforcing tls verification anymore, the situation that forced the disabling must be fixed and the verification enabled ASAP.
363
369
370
+
```
364
371
<body><host>HOST-UUID</host></body>
372
+
```
365
373
366
374
* FAILED_LOGIN_ATTEMPTS: An hourly alert that contains the number of failed attempts and the 3 most common origins for these failed alerts. The body for this type of message is:
title: Trusted certificates for identity validation in TLS connections
3
3
layout: default
4
4
design_doc: true
5
-
revision: 1
5
+
revision: 2
6
6
status: draft
7
7
---
8
8
9
9
# Overview
10
10
11
11
In various use cases, TLS connections are established on the host on which XAPI runs.
12
12
When establishing a TLS connection, the peer identity needs to be validated.
13
-
This is done using either a root CA certificate to perform certificate chain validation, or a known peer certificate for validation with certificate pinning.
14
-
The root CA certificates and peer certificates involved in this process are referred to as trusted certificates.
13
+
This is done using either a root CA certificate to perform certificate chain validation, or a pinned certificate for validation with certificate pinning.
14
+
The root CA certificates and pinned certificates involved in this process are referred to as trusted certificates.
15
15
When a trusted certificate is installed, the local endpoint can validate the peer identity during TLS connection establishment.
16
16
Certificate chain validation is a general-purpose, standards-based approach but requires additional steps, such as getting the peer's certificate signed by a CA.
17
17
In contrast, certificate pinning offers a quicker way to set up trust in some cases without the overhead of CA signing.
@@ -21,13 +21,13 @@ This allows the use case to start in quicker and easier way without prior CA sig
21
21
22
22
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.
23
23
24
-
The base design described in [pool-certificates.md](https://github.com/minglumlu/xen-api/blob/5d1ea1520825d502c57a90a02db476cd7d6a9132/doc/content/design/pool-certificates.md) defines the database, API, and trust store in the filesystem for managing trusted certificates.
24
+
The base design described in [pool-certificates.md](pool-certificates.md) defines the database, API, and trust store in the filesystem for managing trusted certificates.
25
25
This document introduces the following enhancements to that design:
26
26
27
-
* Explicit separation of root CA certificates and peer certificates:
27
+
* Explicit separation of root CA certificates and pinned certificates:
28
28
In the base design, both certificate types share the same database schema, APIs, and are stored together in a single bundle file.
29
29
This makes it difficult to determine the appropriate validation approach based on the certificate type.
30
-
The improvement introduces a type value to separate root CA certificates and peer certificates explicitly.
30
+
The improvement introduces a type value to separate root CA certificates and pinned certificates explicitly.
31
31
32
32
* Add a "purpose" attribute for trusted certificates:
33
33
According to the base design, only certificates used for internal TLS connections among XAPI processes within a pool are stored separately.
@@ -49,13 +49,13 @@ This case benefits from the improvements introduced in this design as well.
49
49
## Database schema
50
50
The *Certificate* class in database is defined to represent general certificates, including trusted certificates.
51
51
One existing class field "type" supports the following enumeration values:
52
-
* "ca": trusted certificates including both root CA and peer.
52
+
* "ca": trusted certificates including both root CA and pinned.
53
53
* "host": identity certificate of a host for communication with entities outside the pool.
54
54
* "host_internal": identity certificate of a host for communication with other pool members.
55
55
56
56
Two improvements in this design:
57
-
* A new value "peer" is introduced in this design so that the existing "ca" now represents trusted root CA only.
58
-
The new "peer" will represent trusted peer certificates.
57
+
* A new value "pinned" is introduced in this design so that the existing "ca" now represents trusted root CA only.
58
+
The new "pinned" will represent trusted pinned certificates.
59
59
60
60
* A new enumeration type "purpose" is introduced to indicate the intended usage of a trusted certificate.
61
61
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.
@@ -79,27 +79,122 @@ For the same reason, "pool.uninstall_ca_certificate" will also be deprecated.
79
79
This is a new API introduced in this design with its arguments being defined as:
80
80
* session (ref session_id): reference to a valid session;
81
81
* self (ref Pool): reference to the pool;
82
-
* ca (boolean): the trusted certificate is a root CA certificate used to verify a chain (true), or a peer certificate used for certificate pinning (false);
82
+
* ca (boolean): the trusted certificate is a root CA certificate used to verify a chain (true), or a pinned certificate used for certificate pinning (false);
83
83
* cert (string): the trusted certificate in PEM format;
84
84
* purpose (string list): the purposes of the trusted certificate.
85
85
86
86
This new API is used to install trusted certificate.
87
87
When *purpose* is an empty set, it stands for a root CA certificate for general purpose.
88
-
The *purpose* can not be an empty set when the *ca* is false, because each peer certificate is specific to a single server and therefore unsuitable for a shared trusted certificate for general purpose.
88
+
The *purpose* can not be an empty set when the *ca* is false, because each pinned certificate is specific to a single server and therefore unsuitable for a shared trusted certificate for general purpose.
89
89
90
90
It returns *void* when succeed. Otherwise, return corresponding API error.
91
91
92
92
### pool.uninstall_trusted_certificate
93
93
This is a new API introduced in this design to uninstall a trusted certificate with its arguments being defined as:
94
94
* session (ref session_id): reference to a valid session;
95
95
* certificate (ref Certificate): reference to the trusted certificate;
96
-
* force (bool): remove the database entry even if the file doesn't exist.
97
96
98
97
It returns *void* when succeed. Otherwise, return corresponding API error.
99
98
100
99
### pool.join
101
-
Prior to this design, trusted certificates are exchanged between the pool and the joining host during the pre‑join phase.
102
-
This design preserves that behavior to ensure the joiner works correctly both before and after joining the pool.
100
+
According to the base design, trusted certificates are exchanged between the pool and the joining host during the pre‑join phase.
101
+
This design basically preserves that behavior to ensure the joiner works correctly both before and after joining the pool.
102
+
However, a number of modifications have been introduced compared with the base design.
Note over join: Copy all certificates from coordinator
188
+
rect rgba(0,0,0,0.05)
189
+
join->>coor: Host.copy_primary_host_certs
190
+
coor->>join: Host.cert_distrib_atom Write
191
+
join-->>coor:
192
+
coor->>join: Host.cert_distrib_atom GenBundle
193
+
join-->>coor:
194
+
coor-->>join: return from Host.copy_primary_host_certs
195
+
end
196
+
197
+
~~~
103
198
104
199
### pool.eject
105
200
The trusted certificates will be removed from any host which is being eject from the pool.
@@ -130,10 +225,10 @@ The stores for the certificates installed via "pool.install_trusted_certificate"
130
225
| Name | Filesystem location | Used for |
131
226
| ---- | ------------------- | -------- |
132
227
| 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.
133
-
| 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\>.
228
+
| Trusted Peer | /etc/trusted-certs/pinned-\<PURPOSE\>/ | Trusted pinned certificates that users can install to validate a peer’s identity when establishing a TLS connection for \<PURPOSE\>.
134
229
| 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\>.
135
230
| 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.
136
-
| 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\>.
231
+
| Peer Bundle | /etc/trusted-certs/pinned-bundle-\<PURPOSE\>.pem | Bundle of trusted pinned certificates under /etc/trusted-certs/pinned-\<PURPOSE\>/ to verify a peer's identity when establishing a TLS connection for \<PURPOSE\>.
137
232
| 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\>.
138
233
139
234
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.
0 commit comments