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/trusted-certificates.md
+31-13Lines changed: 31 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,8 @@ Two improvements in this design:
56
56
The new "peer" will represent trusted peer certificates.
57
57
58
58
* 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.
61
61
62
62
## API
63
63
@@ -68,21 +68,22 @@ This is an existing API to install a trusted certificate into the pool with its
68
68
* name (string): the name of the certificate;
69
69
* cert (string): the certificate in PEM format.
70
70
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.
73
73
* session (ref session_id): reference to a valid session;
74
74
* name (string): the name of the certificate;
75
75
* 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
77
77
78
78
### pool.install_peer_certificate
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
* name (string): the name of the certificate;
82
82
* 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.
84
84
85
85
This new API can be used to install trusted peer certificates only.
86
+
The "purpose" parameter cannot be empty.
86
87
87
88
And corresponding "pool.uninstall_peer_certificate" for uninstalling a trusted peer certificate with arguments:
88
89
* session (ref session_id): reference to a valid session;
@@ -93,6 +94,11 @@ And corresponding "pool.uninstall_peer_certificate" for uninstalling a trusted p
93
94
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.
94
95
Instead, all trusted certificates from the pool will be synchronized to the new host in the pre-join phase.
95
96
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
+
96
102
## Trust store
97
103
The trusted certificates are stored in individual hosts' filesystems.
98
104
The existing stores defined in the base design are:
@@ -103,20 +109,32 @@ The existing stores defined in the base design are:
103
109
| 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"
104
110
| 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"
105
111
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
+
108
119
The pool "Trusted Pool" and "Pool Bundle" are for host-to-host TLS communications within a pool. This design doesn't change them.
109
120
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:
111
123
| Name | Filesystem location | User-configurable | Used for |
| 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\>
115
127
| 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\>
116
128
| 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\>
117
129
118
130
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.
119
131
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"
122
138
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