8000 Feat: external LDAP as a source of truth · Issue #915 · sebadob/rauthy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat: external LDAP as a source of truth #915

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

Open
xeoneox opened this issue May 7, 2025 · 12 comments
Open

Feat: external LDAP as a source of truth #915

xeoneox opened this issue May 7, 2025 · 12 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@xeoneox
Copy link
xeoneox commented May 7, 2025

It would be nice if Rauthy supported external sources of truth, such as LDAP. LDAP is not great at being an authentication protocol, but is excellent for a centralized authentication database. LDAP + OIDC is the ideal combination.

@sebadob
Copy link
Owner
sebadob commented May 7, 2025

We had this question a few times by now.

I don't have any single use case for LDAP and as long as not someone else provides a PR with a complete integration, or an external company requests this as a paid feature, it will not be implemented.

If you need LDAP support, take a look at kanidm.

@sebadob sebadob added enhancement New feature or request help wanted Extra attention is needed labels May 7, 2025
@xeoneox
Copy link
Author
xeoneox commented May 8, 2025

"I don't have any single use case for LDAP"

S3 policies
PostgreSQL Auth
SMTP/IMAP engines
a query-able authentication source for authentication relationships
PAM

KanIDM sadly hasn't been able to meet my needs.

I will continue to recommend LLDAP with Authelia, but I hope this project will eventually come around when you get a good PR. It's really nice, and I hope it can compete with Authelia eventually.

@sebadob
Copy link
Owner
sebadob commented May 8, 2025

S3 policies

Running self-hosted Garage, which does not support LDAP and AWS policies.

PostgreSQL Auth

Usually not using Postgres anymore, but if so, instances are usually set up via K8s operators which generate all creds as K8s secrets which can be accessed from all necessary deployments without me needing to touch them.

SMTP/IMAP engines

Is done on our side via a centralized, self-written cloud service already, which directly talks to the mail server and manages credentials automatically.

a query-able authentication source for authentication relationships

Kind of have that when taking a look at Rauthys Roles / Groups

PAM

Rauthy will eventually get its own PAM module which will probably even take care of hardware based FIDO 2 Keys in the console. The module itself is already working, but very experimental, and does not use FIDO2 keys yet.


So yeah, I have no real need for LDAP.

It's really nice, and I hope it can compete with Authelia eventually.

Thanks, but it's not my goal to compete with anyone. Rauthy is a product out the need for a proper, internal solution and everything that existed back then (including Authelia) didn't really work out. I just don't see any advantage in having LDAP right now. It would be an additional attack vector, use more resources, is something else you need to manage.

But if someone provides an integration at some point (which I doubt, because it would be a huge amount of work), I would of course happily merge it.

@helmut72
Copy link
helmut72 commented May 11, 2025

Is done on our side via a centralized, self-written cloud service already, which directly talks to the mail server and manages credentials automatically.

Is it possible to explain a bit more about your workflow for new user and how you manage your self hosted mail server with your own domain onh your single source of truth user database, rauthy?

Edit: Do you have mail aliases enabled on your mailserver? Where are these stored? Using custom attributes in rauthy to still have a real single source of truth? How will this be pushed/pulled to the mailserver?

@sebadob
Copy link
Owner
sebadob commented May 13, 2025

Is it possible to explain a bit more about your workflow for new user and how you manage your self hosted mail server with your own domain onh your single source of truth user database, rauthy?

Rauthy is the single source of truth for all auth and user related values, not for every existing config value overall. Values that are needed in multiple places or just make sense to save together with a user are stored as custom attributes and managed by Rauthy.

However, some data is managed in other places, when it's only really necessary over there. For instance in case of Postgres creds, they are auto-generated inside K8s as secrets and never leave the cluster. Whenever another application needs them, they are injected into the pods by referencing the original secret, so they only exist in one place and never leave it.
The same is true for things like E-Mail aliases or catch all addresses. Each user on our side has a main E-Mail address, which is also the reference for Rauthy. Additional ones only exist inside another custom application. Aliases do not exist on the E-Mail server. I think it's just a waste of resources to try to manage them there. Instead, the application has a catch all handler and dynamically checks if any incoming mails should be mapped to a temp alias for a user. These temp emails will not even be saved on the E-Mail server itself. If an alias is needed, it's often once and then only for max 24h.

Since Rauthy v0.29, in case of a new user, all we need is a registration on Rauthy. Everything that's necessary afterward is handled fully automatically via SCIM and some custom handlers. Most of the custom logic is inside the cloud app I mentioned. Any user / group updates will be pushed over there via SCIM and it manages the mail server via API calls (create mailboxes, create some custom folders, ...). In other situations, when something does not support SCIM and a registration is necessary or nice to have before the user logs in for the very first time, like e.g. our VPN, it is handled by the cloud app as well.
If you like more separation, you could also have another client in Rauthy that only maps to an application that handles SCIM events and converts them into API calls to custom apps. This client does not even need any login, only manage SCIM updates.

Depending on your mail server, you could also just manage them automatically via SCIM dire 8000 ctly. We just want to have some custom logic and a specific mailbox / address naming and additional things, so that it's easier to do this in the other application than to connect the mail server directly.


You could use Rauthy as a single source of truth for most of the data via custom attributes. I just think it's better and easier to keep some stuff in even more locked down, not even publicly available locations (like e.g. K8s secrets with private K8s API), if you don't need them anywhere else. These days, I very much always follow the KISS principle.

@helmut72
Copy link

in case of Postgres
(...)
for things like E-Mail aliases

IMHO different usage. 1st one belongs to a service/environment, 2nd belongs to a human/user account.

some data is managed in other places, when it's only really necessary over there

For example birthday is also stored to a user directory (regardless if it's LDAP or rauthy) even if it is used rarely.

for things like E-Mail aliases

Also the 2nd mail address belongs to a user!?

SCIM (...) Most of the custom logic is inside the cloud app I mentioned.

What's the name of this cloud app, how to install? I'm not aware of a mail server right now, that supports SCIM

@sebadob
Copy link
Owner
sebadob commented May 22, 2025

IMHO different usage. 1st one belongs to a service/environment, 2nd belongs to a human/user account.

Yes, everything service / env related lives only inside K8s on our side to keep it simple and the attack surface lower.

For example birthday is also stored to a user directory (regardless if it's LDAP or rauthy) even if it is used rarely.

True, that's where SCIM comes in handy. Whenever a value is updated on Rauthy's side, the update will be propagated to downstream clients.

Also the 2nd mail address belongs to a user!?

Yes, but this is dynamically managed and after they expire, they are blacklisted for 1 year to never have any overlaps, even though the addr has quite a lot of randomness.

What's the name of this cloud app, how to install?

You can't. It's an internal application written from scratch, because of the lack of options out there. Usually, people always refer to Nextcloud, but I have lots of issues with it for different reasons, which is why it has been created from the ground up.
It is unclear, if we will every make this publicly available somehow, because it would be a lot to manage and a lot of work.

I'm not aware of a mail server right now, that supports SCIM

Don't know if any support it out of the box, but I think that e.g. docker-mailserver has it on the roadmap.

@xeoneox
Copy link
Author
xeoneox commented May 22, 2025

I certainly appreciate your enthusiasm and vision. I do however disagree with a K8s solution being simple or having a small attack surface. LDAP would still be my preference. I'm rather fond of both Nomad and Podman Quadlets, so a solution demanding K8s is a non-starter for my auth needs.

I can completely understand if external sources of truth require a lot of work, and it's not where you'd want to take the project.

The PAM module sounds very interesting. That would alleviate a lot of my concerns.

@sebadob
Copy link
Owner
sebadob commented May 27, 2025

I do however disagree with a K8s solution being simple or having a small attack surface.

Well, that is of course only true, if you have it running properly anyway already. Just running K8s to have a distributed storage for configs and secrets would be absolutely insane. It's the easiest and most straight forward in our case, since every single workload runs inside k8s, while its API is private and has multiple layers of protection.

Quadlets are very nice, but I like to treat all my servers as being ephemeral. I want to be able to shut one down or maybe even exchange it as a whole for whatever reason and don't worry about prod at all.

The PAM module sounds very interesting. That would alleviate a lot of my concerns.

Yeah it basically works fine with user + password, but I need to find some additional time to integrate Yubikeys / Webauthn into it and make it fully work. Once that is done, I will push it as a separate project. It cannot be added to the Rauthy repo directly because of licensing issues with some dependencies.

@xeoneox
Copy link
Author
xeoneox commented May 30, 2025

I do however disagree with a K8s solution being simple or having a small attack surface.

Well, that is of course only true, if you have it running properly anyway already. Just running K8s to have a distributed storage for configs and secrets would be absolutely insane. It's the easiest and most straight forward in our case, since every single workload runs inside k8s, while its API is private and has multiple layers of protection.

Quadlets are very nice, but I like to treat all my servers as being ephemeral. I want to be able to shut one down or maybe even exchange it as a whole for whatever reason and don't worry about prod at all.

That's what immutability is all about. CoreOS is alive and well as Fedora / Redhat CoresOS, and there's Nix, for people who are into learning new obscure languages for system management. My point is that Kubernetes is not the only way to achieve this, that's a fallacy being imposed on us all right now. That being said, I use Kubernetes, I just don't wish for projects to require it in the future. There will always be a minority opposed to it, and they are working hard on building new ways to work without it. The underpinnings are now in place, all that needs to happen is for either Fleet to be resurrected, or a new project to come in and replace it, or maybe Nomad gets adapted. Who knows, but choice is good, and Kubernetes is too resource heavy to go unchallenged forever.

The PAM module sounds very interesting. That would alleviate a lot of my concerns.

Yeah it basically works fine with user + password, but I need to find some additional time to integrate Yubikeys / Webauthn into it and make it fully work. Once that is done, I will push it as a separate project. It cannot be added to the Rauthy repo directly because of licensing issues with some dependencies.

If you promoted this front and center, it would prevent dummies like me from interrupting your work :)

@xeoneox
Copy link
Author
xeoneox commented May 30, 2025

Right now, today, with no special knowledge or unproven techniques, I can build a Terraform / Ignition / Ansible / Fedora CoreOS / Nomad solution that is easier to access & comprehend for developers, and is lighter weight, than Kubernetes. That part is a fact. The biggest challenge has been convincing people Nomad is a living, advancing, solution ("It's AWS ECS for everyone" <-- my latest pitch to stakeholders). Nothing technical. I'm convinced that the first API based solution that embraces Podman Quadlets is going to become the next contender; be that Nomad, Fleet, or something else new.

Kubernetes has inertia, and it's de-facto. My concern is the Titanic conjecture; where people begin believing it's unsinkable, and building solutions with that fallacy. That is not guaranteed.

80D5

@sebadob
Copy link
Owner
sebadob commented Jun 2, 2025

My point is that Kubernetes is not the only way to achieve this, that's a fallacy being imposed on us all right now.

I never said that, of course it's not. I cannot think of any task that can only be solved in one specific way in this regard.

I just don't wish for projects to require it in the future.

And again, never said that. Rauthy does not require it at all. You can run it anywhere you like.

(...) and Kubernetes is too resource heavy to go unchallenged forever.

I fully agree on that one.

If you promoted this front and center, it would prevent dummies like me from interrupting your work :)

Yeah I did not on purpose, because I don't want to make promises I cannot hold in the end. And, if I publish this, I want it to be working nicely without much trouble. Username + Password is straight forward and no big deal, but I want Webauthn in the terminal, preferrably even with devices that do the authentication via QR code, even though we only use Hardware Passkeys exclusively. Because I don't know yet how nicely this will work, I have not promoted this in any way yet. Generic PAM modules for OIDC / oauth logins exist already, so there is no need to reinvent the wheel, as long as it's not doing anything special.

Right now, today, with no special knowledge or unproven techniques, I can build a Terraform / Ignition / Ansible / Fedora CoreOS / Nomad solution that is easier to access & comprehend for developers, and is lighter weight, than Kubernetes.

I looked at a stack like this in the past as well, but it was not fully meeting my needs. In fact, I would really like ditching K8s for something lighter weight. I use k3s these days most often because we don't manage thousands of servers and it's already a big improvement in terms of resource usage, but I would still like it to be more light weight. One of the biggest reasons for me to create Rauthy in the first place was having something more light weight and faster than Keycloak, which we relied on for years.
The last time I took a look at Nomad was quite a while ago, maybe I should revisit it. The reason we are fully on K8s is that we know it very well, it is super solid and just gets the job done. We will migrate to probably a new environment in a couple of months and if there is something better, I would ditch K8s immediately. I am not a fanboy at all, I use whatever gets the job done in the (for me) best way in a specific situation. Right now, it's managing config maps and secrets inside K8s, because it's there anyway already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants
0