Skip to content

client cert authentication doesn't work with intermediate CAs #41

@geekofalltrades

Description

@geekofalltrades

If your client certificate is issued from an intermediate CA, rather than from the Root CA, then it seems this plugin doesn't send the intermediate with the request, which causes a 401 from Kubernetes. I tested this with check-kube-nodes-ready.rb; I'm unsure if it affects the other plugins, as well.

Steps to reproduce:

  • kube-apiserver is running with a Root CA ROOT as its --client-ca-file argument.
  • Issue an intermediate, INT, from ROOT.
  • Issue a client cert, CLI, from INT.
  • Configure a sensu-plugins-kubernetes check, either via kubeconfig or directly via flags, to use the CLI cert and key to authenticate. Include the full chain from CLI back to ROOT in the cert file configured.
  • Get a 401 from Kubernetes: Unable to authenticate the request due to an error: x509: certificate signed by unknown authority

If you instead send the INT cert and key, you are able to authenticate.

This makes me suspect that the plugin isn't sending the full chain from the client cert.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions