[magnum-auto-healer] Add TLS cert verification#3110
Conversation
…alth check Replace the hardcoded InsecureSkipVerify: true with proper TLS certificate verification using the in-cluster Kubernetes CA by default. Add ca-file and insecure-skip-verify config options so operators can override behaviour when needed (e.g. when the API server cert does not include node IPs as SANs). Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… guide Add a parameter reference table covering all Endpoint check options, including the newly added ca-file and insecure-skip-verify fields. Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test pull-cloud-provider-openstack-check |
|
@stephenfin does it make sense to reuse |
There's some overlap but |
What this PR does / why we need it:
When the protocol is HTTPS, we were creating a HTTP transport with
InsecureSkipVerify: truewhich causes Go's TLS client to skip all certificate verification. This leaves the connection open to man-in-the-middle attacks.I suspect things were done this way since the function connects directly to a node's raw IP address, but Kubernetes API server TLS certificates are typically issued for hostnames or DNS names (e.g.,
api.cluster.example.com) rather than raw IPs. Certificate hostname verification would fail unless the certificate includes the node IP as a Subject Alternative Name (SAN), which isn't guaranteed. Additionally, the Kubernetes cluster CA cert that signed the API server's certificate isn't typically included in theOS trust store and must be loaded explicitly. Neither of these issues are insurmountable though, and we should be secure-by-default.Fix things by adding a configurable CA file and an explicit opt-in
insecure-skip-verifyflag, defaulting to the in-cluster Kubernetes CA.Which issue this PR fixes(if applicable):
(none)
Special notes for reviewers:
Please note the AI was used to assist in generation of this patch. This is noted in the relevant commit messages.
Release note: