Skip to content

Commit 1e69787

Browse files
committed
Do not validate certs when we use letsencrypt on the endpoints
Due to https://issues.redhat.com/browse/ACM-4398 we cannot leave validate_certs always on. Since we do not want to always disable it as that would be a security regression, we simply disable it only when the helm variable "letsencrypt.api_endpoint" is set to true. In that case we know that we are going to use letsencrypt certificates so it is okay to disable the verification until then. Once/if the ACM bug above gets fixed we can drop this. Tested on MCG
1 parent 1e02e45 commit 1e69787

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ansible/roles/vault_utils/tasks/vault_spokes_init.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
loop_control:
5858
label: "{{ item.key }}"
5959

60+
# FIXME(bandini): validate_certs is false due to an ACM bug when using
61+
# letsencrypt certificates with API endpoints: https://issues.redhat.com/browse/ACM-4398
62+
# We always verify the CA chain except when letsencrypt.api_endpoint is set to true
63+
- name: If we are using letsencrypt on the API endpoints we cannot use the validate_certs later
64+
ansible.builtin.set_fact:
65+
validate_certs_api_endpoint: "{{ not letsencrypt.api_endpoint | default(True) | bool }}"
66+
6067
- name: Fetch remote ansible to remote cluster
6168
kubernetes.core.k8s_info:
6269
api_key: "{{ item.value['bearerToken'] }}"
@@ -66,6 +73,7 @@
6673
namespace: "{{ external_secrets_ns }}"
6774
name: "{{ external_secrets_secret }}"
6875
api_version: v1
76+
validate_certs: "{{ validate_certs_api_endpoint }}"
6977
register: remote_external_secrets_sa
7078
when:
7179
- clusters_info[item.key]['bearerToken'] is defined

0 commit comments

Comments
 (0)