blob: 8c351c6b4d1e5637a8fd3df988a1a3c087144853 [file] [log] [blame]
Mohammed Nasere78b4c52024-06-01 20:49:40 -04001============
2Certificates
3============
4
5Atmosphere simplifies all the management of your SSL certificates for all of
6your API endpoints by automatically issuing and renewing certificates for you
7using `cert-manager <https://cert-manager.io>`_.
8
9Types
10=====
11
12There are two different ways of issuing certificates. It can either issue
13individual certificates for each API endpoint or it can issue a wildcard
14certificate for all of your API endpoints.
15
16Individual Certificates
17-----------------------
18
19If you want to issue individual certificates for each API endpoint, you do not
20need to do anything. This is the default behavior of Atmosphere.
21
22Wildcard Certificate
23--------------------
24
25If you decide to use wildcard certificates, you can either let the certificate
26manager issue and renew the certificate for you or you can use an existing
27wildcard certificate.
28
29Automatically Issued
30~~~~~~~~~~~~~~~~~~~~
31
32If you want to issue a wildcard certificate for all of your API endpoints using
33the certificate manager, you can configure it by setting the the following variable
34in your inventory:
35
36.. code-block:: yaml
37
38 openstack_helm_ingress_wildcard_domain: cloud.atmosphere.dev
39
40This will issue a wildcard certificate for ``*.cloud.atmosphere.dev`` and all
41subdomains. The certificate manager will automatically renew the certificate
42before it expires.
43
44Existing Certificate
45~~~~~~~~~~~~~~~~~~~~
46
47If you want to use an existing wildcard certificate without relying on the
48certificate manager issuing and renewing the certificate, you can use the
49following steps:
50
511. Create a Kubernetes TLS secret using your wildcard certificate, you can refer
52 to the `Kubernetes documentation <https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets>`_
53 for more details.
54
55 .. code-block:: shell
56
57 kubectl -n openstack create secret tls wildcard-certs --key=/path/to/tls.key --cert=/path/to/tls.crt
58
59 .. note::
60
61 If you have a certificate that needs to be combined with an intermediate
62 certificate, you can combine them all to a single file with the certificate
63 first, followed by the intermediate certificate, followed by the root.
64
652. Update the ``openstack_helm_ingress_secret_name`` to point towards the name
66 of the secret you created in step 1.
67
68 .. code-block:: yaml
69
70 openstack_helm_ingress_secret_name: wildcard-certs
71
723. Set ``cluster_issuer_type`` to ``none``, this is required for other roles
73 like for example Horizon.
74
75 .. code-block:: yaml
76
77 cluster_issuer_type: none
78
79.. warning::
80
81 If you decide to use an existing wildcard certificate, you will need to
82 manually renew the certificate before it expires.
83
84Issuers
85=======
86
87In order to be able to automatically issue certificates, you need to configure
88an issuer. There are three different types of issuers that you can use with
89Atmosphere.
90
91.. note::
92
93 If you decide to change the certificate issuer after deployment, you will
94 need to delete the existing certificate secret in order for the new issuer
95 to be able to issue a new certificate.
96
97ACME
98----
99
100Atmosphere uses the `ACME <https://tools.ietf.org/html/rfc8555>`_ protocol by
101default to request certificates from `LetsEncrypt <https://letsencrypt.org>`_.
102
103There are two different challenge types that can be used to verify ownership of
104the domain to issue the certificate using ACME. Regardless of the challenge
105type, you will need to configure an email address to be used for the ACME
106account.
107
108.. code-block:: yaml
109
110 cluster_issuer_type: acme
111 cluster_issuer_acme_email: user@example.com
112
113If you're running your own internal ACME server, you can configure Atmosphere to
114point towards it by setting the ``cluster_issuer_acme_server`` variable.
115
116.. code-block:: yaml
117
118 cluster_issuer_acme_server: https://acme.example.com
119 cluster_issuer_acme_email: user@example.com
120
121If the ACME server is using certificates signed by a custom CA, you can add the
122following configuration to allow Atmosphere to trust the CA.
123
124.. code-block:: yaml
125
126 cluster_issuer_acme_private_ca: true
127
128HTTP-01 Challenge
129~~~~~~~~~~~~~~~~~
130
131This is configured to work out of the box if your APIs are publicly accessible
132since it uses an HTTP-01 challenge to verify ownership of the domain. You just
133need to configure an email address.
134
135DNS-01 Challenge
136~~~~~~~~~~~~~~~~
137
138Atmosphere uses the ``HTTP-01`` solver by default, which means that as long as
139your ACME server can reach your API, you don't need to do anything else.
140
141If your ACME server cannot reach your API, you will need to use the ``DNS-01``
142challenges which require you to configure your DNS provider.
143
144RFC2136
145*******
146
147If you have a DNS server that supports RFC2136, you can use it to solve the DNS
148challenges with the following configuration:
149
150.. code-block:: yaml
151
152 cluster_issuer_acme_email: user@example.com
153 cluster_issuer_acme_solver: rfc2136
154 cluster_issuer_acme_rfc2136_nameserver: <NAMESERVER>:<PORT>
155 cluster_issuer_acme_rfc2136_tsig_algorithm: <ALGORITHM>
156 cluster_issuer_acme_rfc2136_tsig_key_name: <KEY_NAME>
157 cluster_issuer_acme_rfc2136_tsig_secret_key: <SECRET_KEY>
158
159Route53
160*******
161
162If you are using Route53 to host the DNS for your domains, you can use the
163following configuration:
164
165.. code-block:: yaml
166
167 cluster_issuer_acme_email: user@example.com
168 cluster_issuer_acme_solver: route53
169 cluster_issuer_acme_route53_region: <REGION>
170 cluster_issuer_acme_route53_hosted_zone_id: <HOSTED_ZONE_ID>
171 cluster_issuer_acme_route53_access_key_id: <AWS_ACCESS_KEY_ID>
172 cluster_issuer_acme_route53_secret_access_key: <AWS_SECRET_ACCESS_KEY>
173
174.. note::
175
176 You'll need to make sure that your AWS credentials have the correct
177 permissions to update the Route53 zone.
178
179GoDaddy
180*******
181
182If you're using GoDaddy for the DNS of your domain, you can use the following
183configuration which depends on
184`cert-manager-webhook-godaddy <https://github.com/snowdrop/godaddy-webhook>`_.
185
186.. code-block:: yaml
187
188 cluster_issuer_acme_email: user@example.com
189 cluster_issuer_acme_solver: godaddy
190 cluster_issuer_acme_godaddy_api_key: <GODADDY_API_KEY>
191 cluster_issuer_acme_godaddy_secret_key: <GODADDY_SECRET_KEY>
192
193Infoblox
194********
195
196If you're using Infoblox for the DNS of your domain, you can use the following
197configuration which depends on
198`cert-manager-webhook-infoblox-wapi <https://github.com/luisico/cert-manager-webhook-infoblox-wapi>`_.
199
200.. code-block:: yaml
201
202 cluster_issuer_acme_email: user@example.com
203 cluster_issuer_acme_solver: infoblox
204 cluster_issuer_acme_infoblox_view: <VIEW>
205 cluster_issuer_acme_infoblox_host: <HOST>
206 cluster_issuer_acme_infoblox_username: <USERNAME>
207 cluster_issuer_acme_infoblox_password: <PASSWORD>
208
209Venafi
210------
211
212Venafi is a commercial certificate authority which can be used with Atmosphere
213to issue certificates. Regardless of the way that you authenticate to Venafi,
214you will need to configure the issuer.
215
216.. code-block:: yaml
217
218 cluster_issuer_type: venafi
Mohammed Naserc1aac772024-06-02 20:38:27 -0400219 cluster_issuer_venafi_ca: |
220 -----BEGIN CERTIFICATE-----
221 MIIDBjCCAe4CCQDQ3Z0Z2Z0Z0jANBgkqhkiG9w0BAQsFADCBhTELMAkGA1UEBhMC
222 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
223 ...
224 -----END CERTIFICATE-----
Mohammed Nasere78b4c52024-06-01 20:49:40 -0400225 cluster_issuer_venafi_zone: <ZONE>
226 cluster_issuer_venafi_tpp_url: <URL>
227 cluster_issuer_venafi_tpp_ca_bundle: |
228 -----BEGIN CERTIFICATE-----
229 MIIDBjCCAe4CCQDQ3Z0Z2Z0Z0jANBgkqhkiG9w0BAQsFADCBhTELMAkGA1UEBhMC
230 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
231 ...
232 -----END CERTIFICATE-----
233
Mohammed Naserc1aac772024-06-02 20:38:27 -0400234.. note::
235
236 If your issuer is an intermediate certificate, you will need to ensure that
237 the ``certificate`` key includes the full chain in the correct order of issuer,
238 intermediate(s), then root.
239
Mohammed Nasere78b4c52024-06-01 20:49:40 -0400240Authentication
241~~~~~~~~~~~~~~
242
243There are two different ways to authenticate to Venafi to issue certificates,
244either using a username and password or using an access token. The username and
245password method is phased out in newer versions of Venafi, so it is recommended
246to use the access token method.
247
248Username and Password
249*********************
250
251If you are using a username and password to authenticate to Venafi, you can
252configure it with the following variables:
253
254.. code-block:: yaml
255
256 cluster_issuer_venafi_username: <USERNAME>
257 cluster_issuer_venafi_password: <PASSWORD>
258
259Access Token
260************
261
262If you are using an access token to authenticate to Venafi, you can configure it
263with the following variable:
264
265.. code-block:: yaml
266
267 cluster_issuer_venafi_access_token: <ACCESS_TOKEN>
268
269Certificate fields
270~~~~~~~~~~~~~~~~~~
271
272If your Venafi zone is strict about the fields that are required or their
273values, you can use the `cert-manager supported annotations <https://cert-manager.io/docs/usage/ingress/#supported-annotations>`_
274to configure the certificate values.
275
276In order to apply these annotations to all ingresses managed by Atmosphere, you
277can use the ``ingress_global_annotations`` variable in your inventory which will
278apply the annotations to all ingresses.
279
280.. code-block:: yaml
281
282 ingress_global_annotations:
283 cert-manager.io/subject-organizations: VEXXHOST, Inc.
284 cert-manager.io/subject-organizationalunits: Cloud Infrastructure
285 cert-manager.io/subject-localities: Montreal
286 cert-manager.io/subject-provinces: Quebec
287 cert-manager.io/subject-countries: CA
288
289Using Pre-existing CA
290---------------------
291
292If you have an existing CA that you'd like to use with Atmosphere, you can
293configure it by including the certificate and private key:
294
295.. code-block:: yaml
296
297 cluster_issuer_type: ca
298 cluster_issuer_ca_certificate: |
299 -----BEGIN CERTIFICATE-----
300 MIIDBjCCAe4CCQDQ3Z0Z2Z0Z0jANBgkqhkiG9w0BAQsFADCBhTELMAkGA1UEBhMC
301 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
302 ...
303 -----END CERTIFICATE-----
304 cluster_issuer_ca_private_key: |
305 -----BEGIN RSA PRIVATE KEY-----
306 MIIEpAIBAAKCAQEAw3Z0Z2Z0Z0jANBgkqhkiG9w0BAQsFADCBhTELMAkGA1UEBhMC
307 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
308 ...
309 -----END RSA PRIVATE KEY-----
310
311.. note::
312
313 If your issuer is an intermediate certificate, you will need to ensure that
314 the ``certificate`` key includes the full chain in the correct order of issuer,
315 intermediate(s), then root.
316
317Self-signed Certificates
318------------------------
319
320If you are in an environment which does not have a trusted certificate authority
321and it does not have access to the internet to be able to use LetsEncrypt, you
322can use self-signed certificates by adding the following to your inventory:
323
324.. code-block:: yaml
325
326 cluster_issuer_type: self-signed
327
328.. warning::
329
330 Self-signed certificates are not recommended for production environments.
331 They are only recommended for development and testing environments.