Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: TLS between load balancer and kanidm #2731

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChanceHarrison
Copy link

@ChanceHarrison ChanceHarrison commented Apr 29, 2024

tl;dr

Give users some options to consider for how they could implement TLS between a load balancer (LB) and kanidm.

Motivation

While the docs make it clear that kanidm must be accessed over HTTPS, they do not provide much information regarding how to accomplish this between a LB and kanidm; this is left as an exercise to the reader.

For users who have their LB and kanidm on the same host and simply wish to have their reverse proxy communicate with kanidm using HTTP over localhost, this requirement can be quite the pain point.

In lieu of providing a more seamless solution for users, I think it would be ideal to at least somewhat enumerate the options available to accomplish this.

Why is this in draft?

Because I'm not super confident with what I have written so far and would like some input from others so I can iterate.

Related

#1726 (comment)
#2403
Various discussions in the kanidm Gitter community.

❤️

Copy link
Author

@ChanceHarrison ChanceHarrison left a comment

Choose a reason for hiding this comment

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

General thought that I would like input on:

Is it worth even mentioning the option to reuse the certificates that the load balancer uses to secure outbound connections?

Ultimately, any option that maintains the confidentiality and integrity of the communication will
suffice. Some options include, but are not limited to:

- Generating a self-signed certificate
Copy link
Author

Choose a reason for hiding this comment

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

Can we recommend a generic process for accomplishing this? kanidmd cert-generate exists, but the help text says the following:

[...] These certificates should not be used in production, they are for testing and evaluation only!

It feels odd to recommend something that comes with such a strong warning. But maybe, given the context, the warning doesn't necessarily apply?

Copy link
Member

Choose a reason for hiding this comment

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

The self-signed certificates generated by Kanidm aren't designed for any production use, so until that changes the help text is correct.

Copy link
Author

Choose a reason for hiding this comment

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

@yaleman Thank you for the input. Can we point to some concrete technical attributes of kanidm's own self-signed certificates as justification for them being unsuitable for production? e.g., things that should be done differently?

If it's just a matter of kanidm's self-signed certs not being designed for that purpose, perhaps it would be worthwhile to evaluate whether they are actually fit for the designed use-case or not? And perhaps that can open the door to contributions that would allow for this use case to be entertained?

Copy link
Member

Choose a reason for hiding this comment

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

They're designed (ref: build_cert) for test/dev purposes only with a 5 day expiry and some simple defaults.

There's a whole bunch more config that goes into a well-formed certificate, including location, hostnames, contact details etc. If someone wanted to make it easy to generate them then it might be entertained, but ... there's also SO many other software platforms that can do this, and duplicating production quality features for the sake of it is something we try to avoid.

Copy link
Author

Choose a reason for hiding this comment

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

I appreciate the context!

If the certificate is never going to be publicly exposed (e.g., LB and kanidm are on the same host), presumably the "well-formed" characteristics that you mentioned (location, contact, etc.) aren't really relevant?

Of course, stuff like hostnames and expiry need to be right regardless. (edit: on second thought, do they though? does certificate pinning care about inconsistent hostnames or expired certificates?) And those other characteristics start to matter a lot more if the LB and kanidm aren't local anymore, right?

also SO many other software platforms that can do this [generate self-signed certificates?\

Aside from smallstep (which just seems like running your own CA), mkcert (also makes a local CA, but tries to abstract that away for you), or cfssl (still uses a local CA), do you have any other suggestions?

For the use case of securing localhost communications, maybe I'm trying to hard to find something that isn't necessary? Perhaps it shouldn't be more complicated than a couple trusty openssl commands?

Copy link
Member

Choose a reason for hiding this comment

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

It depends on the threat model of your environment, like most security decisions. If folks are reading our docs to decide on how to generate a the cert between their app and a load balancer, simple openssl commands would do fine. 😄

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should just make a cert-helper for that specific use case?

Copy link
Member

Choose a reason for hiding this comment

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

on second thought, do they though? does certificate pinning care about inconsistent hostnames or expired certificates

that's up to your load balancer configs.

@Firstyear we could do that, sure

Copy link
Member

Choose a reason for hiding this comment

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

If only I was already planning to make a CA ....

book/src/frequently_asked_questions.md Show resolved Hide resolved
book/src/frequently_asked_questions.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants