Skip to content

[magnum-auto-healer] Add certificate validation - #3170

Open
stephenfin wants to merge 1 commit into
kubernetes:masterfrom
shiftstack:magnum-auto-healer-cert-validation
Open

[magnum-auto-healer] Add certificate validation#3170
stephenfin wants to merge 1 commit into
kubernetes:masterfrom
shiftstack:magnum-auto-healer-cert-validation

Conversation

@stephenfin

Copy link
Copy Markdown
Member

What this PR does / why we need it:

The controller always sets InsecureSkipVerify. The two modern Magnum drivers in use today both use CAPI and thus kubeadm under the hood. kubeadm injects nodes internal IPs as SANs into the certs it generates, meaning certificate validation should pass when using the same root cert. Thus, we add two new configuration knobs: one to point to a CA file to use (defaulting to the well-known location k8s mounts certs to) and another to explicitly disable verification as an escape hatch.

Which issue this PR fixes(if applicable):

(none)

Special notes for reviewers:

Release note:

[magnum-auto-healer] Certificate validation is now enabled by default when using HTTPS

The controller always sets InsecureSkipVerify. The two modern Magnum
drivers in use today both use CAPI and thus kubeadm under the hood.
kubeadm injects nodes internal IPs as SANs into the certs it generates,
meaning certificate validation should pass when using the same root
cert. Thus, we add two new configuration knobs: one to point to a CA
file to use (defaulting to the well-known location k8s mounts certs to)
and another to explicitly disable verification as an escape hatch.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Assisted-by: Claude Sonnet 4.8 <noreply@anthropic.com>
@kubernetes-prow kubernetes-prow Bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 27, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from mandre and zetaab August 27, 2026 16:52
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kayrus for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 27, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

@stephenfin: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cloud-provider-openstack-check 669bc27 link true /test pull-cloud-provider-openstack-check

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

caPool, err = cert.NewPool(check.CAFile)
if err != nil {
log.Errorf("Node %s, failed to load CA file %s: %v", nodeName, check.CAFile, err)
return true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it return false since a fail has happened when loading the CA?

tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
tlsConfig := &tls.Config{InsecureSkipVerify: check.TLSInsecure}
if check.CAFile != "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to load CAFile if TLSInsecure is set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants