Skip to content

Commit 0f20a98

Browse files
author
Matt Pryor
authored
Support custom CAs by distributing a trust bundle (#618)
* Support custom CAs by distributing a trust bundle * Disable TLS verification for 'zenith-client init' when custom CAs are specified
1 parent 812aeb8 commit 0f20a98

File tree

25 files changed

+160
-213
lines changed

25 files changed

+160
-213
lines changed

playbooks/deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
when: cloud_metrics_enabled
2121
- role: azimuth_cloud.azimuth_ops.clusterapi
2222
when: azimuth_kubernetes_enabled
23-
- role: azimuth_cloud.azimuth_ops.awx
24-
when: azimuth_clusters_enabled
2523
- role: azimuth_cloud.azimuth_ops.consul
2624
when: azimuth_apps_enabled or azimuth_clusters_enabled
2725
- role: azimuth_cloud.azimuth_ops.azimuth_caas_operator

playbooks/provision_cluster.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
- hosts: k3s
1515
tasks:
1616
- block:
17+
- include_role:
18+
name: azimuth_cloud.azimuth_ops.system_trust
19+
1720
- include_role:
1821
name: azimuth_cloud.azimuth_ops.sysctl_inotify
1922

roles/awx/defaults/main.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

roles/awx/tasks/main.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

roles/awx/templates/kustomization.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

roles/awx/templates/patch-delete-ns.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

roles/azimuth/defaults/main.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ azimuth_ingress_tls_key: >-
4646
}}
4747
4848
# Custom trust bundle for SSL verification
49-
azimuth_trust_bundle: |-
50-
{%- if trust_bundle is defined %}
51-
{%- for certificate in trust_bundle.values() %}
52-
{{ certificate }}
53-
{%- endfor %}
54-
{%- endif %}
55-
# The name of the configmap into which the trust bundle should be placed
56-
azimuth_trust_bundle_configmap_name: "{{ trust_bundle_configmap_name | default('azimuth-trust-bundle') }}"
49+
azimuth_trust_bundle: "{{ system_trust_ca_bundle | default('') }}"
5750

5851
# The Django secret key, used mainly for ensuring session cookies are not tampered with
5952
azimuth_secret_key: "{{ undef(hint = 'azimuth_secret_key is required') }}"
@@ -279,7 +272,17 @@ azimuth_apps_base_domain: >-
279272
azimuth_apps_verify_ssl: true
280273
#  Indicates whether SSL should be verified by clients when associating keys with the
281274
# registrar using the external endpoint
282-
azimuth_apps_verify_ssl_clients: "{{ azimuth_apps_verify_ssl }}"
275+
# By default, clients will verify SSL when Azimuth itself does
276+
# The exception to this is when custom CAs are specified, as there is currently no mechanism
277+
# for propagating the custom CAs into the trust store of the appliance
278+
azimuth_apps_verify_ssl_clients: >-
279+
{{-
280+
azimuth_apps_verify_ssl and
281+
not (
282+
(system_trust_extra_root_cas is defined and system_trust_extra_root_cas) or
283+
(trust_bundle is defined and trust_bundle)
284+
)
285+
}}
283286
# The external URL for the Zenith registrar
284287
azimuth_apps_registrar_external_url: >-
285288
{{-
@@ -347,12 +350,7 @@ azimuth_release_defaults:
347350
enabled: "{{ azimuth_ingress_tls_enabled }}"
348351
secretName: "{{ azimuth_ingress_tls_secret_name }}"
349352
annotations: "{{ azimuth_ingress_tls_annotations }}"
350-
trustBundleConfigMapName: >-
351-
{{-
352-
azimuth_trust_bundle_configmap_name
353-
if azimuth_trust_bundle
354-
else None
355-
}}
353+
trustBundle: "{{ azimuth_trust_bundle }}"
356354
settings:
357355
secretKey: "{{ azimuth_secret_key }}"
358356
availableClouds: "{{ azimuth_linked_clouds }}"

roles/azimuth/tasks/main.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@
2525
tls.key: "{{ azimuth_ingress_tls_key }}"
2626
when: azimuth_ingress_tls_certificate
2727

28-
- name: Install trust bundle
29-
command: kubectl apply -f -
30-
args:
31-
stdin: "{{ azimuth_trust_bundle_configmap_definition | to_nice_yaml }}"
32-
vars:
33-
azimuth_trust_bundle_configmap_definition:
34-
apiVersion: v1
35-
kind: ConfigMap
36-
metadata:
37-
name: "{{ azimuth_trust_bundle_configmap_name }}"
38-
namespace: "{{ azimuth_release_namespace }}"
39-
data:
40-
ca-certificates.crt: "{{ azimuth_trust_bundle }}"
41-
when: azimuth_trust_bundle
42-
4328
- name: Install Azimuth on target Kubernetes cluster
4429
kubernetes.core.helm:
4530
chart_ref: "{{ azimuth_chart_name }}"

roles/azimuth_caas_operator/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ azimuth_caas_operator_release_name: azimuth-caas-operator
1212
# The timeout to wait for operator to become ready
1313
azimuth_caas_operator_wait_timeout: 10m
1414

15+
# Custom trust bundle for SSL verification
16+
azimuth_caas_operator_trust_bundle: "{{ system_trust_ca_bundle | default('') }}"
17+
1518
# The ansible-runner image and tag to use
1619
# Leave blank to use the defaults
1720
azimuth_caas_operator_ansible_runner_image_repository:
@@ -63,6 +66,7 @@ azimuth_caas_operator_release_defaults:
6366
)
6467
}}
6568
globalExtraVars: "{{ azimuth_caas_operator_global_extravars }}"
69+
trustBundle: "{{ azimuth_caas_operator_trust_bundle }}"
6670
azimuth_caas_operator_release_overrides: {}
6771
azimuth_caas_operator_release_values: >-
6872
{{-

roles/azimuth_capi_operator/defaults/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ azimuth_capi_operator_release_name: azimuth-capi-operator
1313
# The timeout to wait for CAPI operator to become ready
1414
azimuth_capi_operator_wait_timeout: 10m
1515

16+
# Custom trust bundle for SSL verification
17+
azimuth_capi_operator_trust_bundle: "{{ system_trust_ca_bundle | default('') }}"
18+
1619
# The timer interval to use for the CAPI operator
1720
azimuth_capi_operator_timer_interval: 60
1821

@@ -39,7 +42,8 @@ azimuth_capi_operator_capi_helm_dns_nameservers:
3942

4043
# Bundle of certificates that should be added to the system trustroots for provisioned clusters
4144
# E.g. for pulling containers from a registry with a custom CA chain
42-
azimuth_capi_operator_capi_helm_trust_bundle: "{{ trust_bundle | default({}) }}"
45+
azimuth_capi_operator_capi_helm_trust_bundle: >-
46+
{{ system_trust_extra_root_cas | default(trust_bundle) | default({}) }}
4347
# The registry mirrors for provisioned clusters
4448
azimuth_capi_operator_capi_helm_registry_mirrors: >-
4549
{{-
@@ -494,6 +498,7 @@ azimuth_capi_operator_release_defaults:
494498
# Enable the metrics with the service monitor by default
495499
metrics:
496500
enabled: true
501+
trustBundle: "{{ azimuth_capi_operator_trust_bundle }}"
497502
azimuth_capi_operator_release_overrides: {}
498503
azimuth_capi_operator_release_values: >-
499504
{{-

0 commit comments

Comments
 (0)